Giter Club home page Giter Club logo

smartevse-2's Introduction

SmartEVSE

Smart Electric Vehicle Charge Controller

Image of SmartEVSE

What is it?

It's a open source EVSE (Electric Vehicle Supply Equipment). It supports 1-3 phase charging, fixed charging cable or charging socket. Locking actuator support (3 different types). And it can directly drive a mains contactor for supplying power to the EV. It features a display from which all module parameters can be configured.
Up to 8 modules can be connected together to charge up to eight EV's from one mains connection without overloading it.
The mains connection can be monitored by the (optional) sensorbox or a modbus kWh meter. This allows smart charging. Communication between the SmartEVSE(s) / Sensorbox or kWh meters is done over RS485(modbus).

The project consists of two parts:

  • Smart EVSE controller
  • Sensorbox

Features

  • Fits into a standard DIN rail enclosure.
  • Measures the current consumption of other appliances, and automatically lowers or increases the charging current to the EV. (sensorbox required)
  • The load balancing feature let's you connect up to 8 SmartEVSE's to one mains supply.
  • Switched 230VAC output, for contactor/relay.
  • Powered RS485 communication bus for sensorbox / Modbus kWh Meters.
  • Can be used with fixed cable, or socket and charging cable.
  • Automatically selects current capacity of the connected cable (13/16/32A)
  • Locking actuator support, locks the charging cable in the socket, automatically unlocks on a power failure.
  • RFID reader support, restrict the use of the charging station to max 20 RFID cards.
  • An optional modbus kWh meter will measure power and charged energy, and display this on the LCD.
  • Built-in temperature sensor.
  • All module parameters can be configured using the display and buttons.
  • Setup can also be done through serial CLI.
  • Firmware upgradable through serial bootloader.

New V2.20 features are:

  • Added EVMETER and EVADR option to the menu. Use a modbus kWh meter to measure the charged energy.
  • Added charged energy to the LCD (Smart/Solar mode)
  • Uses condensed characters on the LCD, so the 'i' will not use the same space as the 'w'
  • Increased the nr of nodes to 7.
  • Added RFID reader option. Learn up to 20 RFID cards.

The Sensorbox

The Sensorbox should be placed where the Mains connection enters the building. Usually just after the kWh meter, this way it will be able to measure the total current per phase and send this information to the SmartEVSE.

In order to measure the current, Current transformers are used. Clip them around the L1,L2 and L3 wires, and plug the other end into the sensorbox.

Image of Sensorbox

Configuring the SmartEVSE

The SmartEVSE has a display, which shows the charging status, and if smart mode is used, also the measured current per phase. It is possible to configure all settings using the built-in menu.

Three buttons below the display are used for navigating the menu.

Hold the center button for 2 seconds to enter the menu. You can now use the left and right buttons to go to the different menu options.

Pressing the center button, selects the option, and allows you change the value (for example change the charging current)

Image of Menu

Building the EVSE

In order to build a complete EVSE (charging station) you will need:

  • SmartEVSE.
  • 4 pole NO Contactor rated for the max charging current. (for example Hager ESC440 or ISKRA IKA432-40)
  • Fixed charging cable or socket with locking solenoid.
  • Enclosure with DIN rail.
  • Terminal blocks (Wago TOPJOB S)

The EVSE needs to be protected with a circuit breaker and residual-current circuit breaker, usually located near or in the distribution board.

Purchase the SmartEVSE

You can buy a complete assembled SmartEVSEv2 here
Information on how to compile and setup the controller can be found on the smartevse.nl website.

The assembled SmartEVSE v2 modules come pre-programmed with the latest firmware (v2.20), and are fully tested!

Predefined electric meters

  • Sensorbox (1)
  • PHOENIX CONTACT EEM-350-D-MCB (2)
  • Finder 7E.78.8.400.0212 (3)
  • Eastron SDM630 (4)
  • ABB B23 212-100 (5)
  • SolarEdge SunSpec (6)
  • WAGO 879-30x0 (7)
  • Finder 7M.38.8.400.0212 (8)
  • Custom (9)

Modbus

Baudrate is 9600bps 8N1 (8bit, no parity bit, one stop bit). All registers are 16 bit unsigned integers. Address depends on the Load Balancing configuration:

Load Balancing Modbus Address
Disabled/Master 0x01
Node 1 0x02
Node 2 0x03
Node 3 0x04
Node 4 0x05
Node 5 0x06
Node 6 0x07
Node 7 0x08

Broadcast to all SmartEVSE with address 0x09.

Modbus register have changed after version 2.20. Use this readme as reference for version 2.20 or older

Register 0x00*: EVSE status

Register Access Description Unit Values
0x0000 R/W State 0:A / 1:B / 2:C / 3:D / 4:Node request B / 5:Master confirm B / 6:Node request C / 7:Master confirm C / 8:Activation mode / 9:B1 / 10:C1
0x0001 R/W Error Bit 1:LESS_6A / 2:NO_COMM / 4:TEMP_HIGH / 8:Unused / 16:RCD / 32:NO_SUN
0x0002 R/W Charging current 0.1 A 0:no current available / 6-80
0x0003 R/W EVSE mode (without saving) 0:Normal / 1:Smart / 2:Solar
0x0004 R/W Solar Timer s
0x0005 R/W Access bit 0:No Access / 1:Access
0x0006 R/W Configuration changed (Not implemented)
0x0007 R Maximum charging current A
0x0008 R/W Number of used phases (Not implemented) 0:Undetected / 1 - 3
0x0009 R Real charging current (Not implemented) 0.1 A
0x000A R Temperature K
0x000B R Serial number
0x0020 - 0x0027 W Broadcast charge current. SmartEVSE uses only one value depending on the "Load Balancing" configuration 0.1 A 0:no current available

Register 0x01*: Node specific configuration

Register Access Description Unit Values
0x0100 R/W Configuration 0:Socket / 1:Fixed Cable
0x0101 R/W Cable lock 0:Disable / 1:Solenoid / 2:Motor
0x0102 R/W MIN Charge Current the EV will accept A 6 - 16
0x0103 R/W MAX Charge Current for this EVSE A 6 - 80
0x0104 R/W Load Balance 0:Disabled / 1:Master / 2-8:Node
0x0105 R/W External Switch on pin SW 0:Disabled / 1:Access Push-Button / 2:Access Switch / 3:Smart-Solar Push-Button / 4:Smart-Solar Switch
0x0106 R/W Residual Current Monitor on pin RCM 0:Disabled / 1:Enabled
0x0107 R/W Use RFID reader 0:Disabled / 1:Enabled
0x0108 R/W Type of EV electric meter *
0x0109 R/W Address of EV electric meter 10 - 247

Register 0x02*: System configuration (same on all SmartEVSE in a LoadBalancing setup)

Register Access Description Unit Values
0x0200 R/W EVSE mode 0:Normal / 1:Smart / 2:Solar
0x0201 R/W EVSE Circuit max Current A 10 - 160
0x0202 R/W Grid type to which the Sensorbox is connected 0:4Wire / 1:3Wire
0x0203 R/W CT calibration value 0.01 Multiplier
0x0204 R/W Max Mains Current A 10 - 200
0x0205 R/W Surplus energy start Current A 1 - 16
0x0206 R/W Stop solar charging at 6A after this time min 0:Disable / 1 - 60
0x0207 R/W Allow grid power when solar charging A 0 - 6
0x0208 R/W Type of Mains electric meter *
0x0209 R/W Address of Mains electric meter 10 - 247
0x020A R/W What does Mains electric meter measure 0:Mains (Home+EVSE+PV) / 1:Home+EVSE
0x020B R/W Type of PV electric meter *
0x020C R/W Address of PV electric meter 10 - 247
0x020D R/W Byte order of custom electric meter 0:LBF & LWF / 1:LBF & HWF / 2:HBF & LWF / 3:HBF & HWF
0x020E R/W Data type of custom electric meter 0:Integer / 1:Double
0x020F R/W Modbus Function (3/4) of custom electric meter
0x0210 R/W Register for Voltage (V) of custom electric meter 0 - 65530
0x0211 R/W Divisor for Voltage (V) of custom electric meter 10x 0 - 7
0x0212 R/W Register for Current (A) of custom electric meter 0 - 65530
0x0213 R/W Divisor for Current (A) of custom electric meter 10x 0 - 7
0x0214 R/W Register for Power (W) of custom electric meter 0 - 65534
0x0215 R/W Divisor for Power (W) of custom electric meter 10x 0 - 7 /
0x0216 R/W Register for Energy (kWh) of custom electric meter 0 - 65534
0x0217 R/W Divisor for Energy (kWh) of custom electric meter 10x 0 - 7
0x0218 R/W Maximum register read (Not implemented)
0x0219 R/W WiFi mode
0x021A R/W Limit max current draw on MAINS (sum of phases) A 9:Disable / 10 - 200
  • Number in brackets in section "Predefined electric meters"

smartevse-2's People

Contributors

arjanmels avatar bobosch avatar links2004 avatar maximevince avatar mstegen avatar pa1rb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartevse-2's Issues

RCM error screen stuck at "PRESS BUTTON TO RESET"

Was playing today a bit with SmartEVSE and there is a small issue with RCM error display. But the issue is only cosmeticall with an easy improvement.

When RCM error is detected a massage is shown that toggles between "RESIDUAL FAULT CURRENT DETECTED" and "PRESS BUTTON TO RESET". No error is displayed over CLI.

When the user presses the button while "PRESS BUTTON TO RESET" massage is displayed, the next time the RCM error is detected there will be "PRESS BUTTON TO RESET" massage displayed and not "RESIDUAL FAULT CURRENT DETECTED" if the detected fault is present for a long period of time.

I made two modifications that improve the RCM trip situation:

GLCD.c
Meld_qwKixlzubQ

EVSE.c
Meld_furZQFrci6

is that any possible way to get the State (Charging,Disconnect,Connected) and the Other configuration Values(Max Power ,Min Power) Parrallely?

Hi @wido @bobosch @Links2004 @mstegen @maximevince I am Working on the Smart EVSE. I Connected the EVSE with Compute Module 3+ over the USART, and I am able to get the Values from the Terminal and set the EVSE Configuration Values through the terminal. actually, my concern to get the STATE info and the other configuration parallelly from the EVSE, as per my understanding about EVSE respond only one Command at a time. so is that any other way to get the STATE from the EVSE parallel to the Configuration.

Solar charging stability

I noticed possible undesirable behaviour of the available current calculation.

Screenshot_20220227-105450

My Hyundai Kona connected and the SmartEVSE set to smart charging, with max 6A import set and timer at 60min. Solar panels on phase 1 and 3 are happily producing and solar charging started a 4A export.

At 10:47 you see the variation in power drawn on all phases starting. Looking at the SmartEVSE display, I saw the available current flipping from 7A, to 6A (timer started) and back to 7A again and flipping to 6A again.

Screenshot_20220227-105901
Screenshot_20220227-110545

At 10:52, I've manually changed the import to 5A to stop the switching.

Is this behaviour intended and ok? Or should there be a stabilising functionality that avoids the switching back and fort every 10 seconds?

Switch between single phase and 3 phase

In theory ... would it be possible to switch between single phase charging and 3 phase charging using 2 relays? Would it possible to control those 2 relays, instead of the default 1 using the current SmartEVSE2 hardware, by changing the firmware?

Let me elaborate:

I want to make my SmartEVSE even more smart by reading the battery status from the car (not via SmartEVSE, but directly using the cars' API). And based on that, calculate what the most ideal charging current would be.
Why? Because in Belgium you get charged based on the current peaks you cause on the network, so you benefit by keeping the charging current as low as possible.

The minimum charging current is always 6A:

  • On a single phase: 6A x 230V x 1 = 1380W
  • On three phases: 6A x 230V x 3 = 4140W
    This could have a big impact on the monthly energy bill.

So if I calculate that 6A or 10A single phase charging would be enough to charge the car overnight, I would tell SmartEVSE to only use a single phase (over Modbus), which would then only switch on relay 1 controlling phase 1.
If I calculate that multiple phases are needed, I would again instruct SmartEVSE to do so, which would then switch on relay 1 for phase 1, and relay 2 for phase 2 and 3.

When switching between single and three phase charging, SmartEVSE would need to pause charging for a couple of seconds, because some vehicles might not handle the switch between single and multi phase charging well.

Your thoughts please...

Setting LOG_DEBUG from menu?

Is is possible to set this from the menu?

#define LOG_EVSE LOG_DEBUG                                                       // Default: LOG_INFO
#define LOG_MODBUS LOG_DEBUG                                                // Default: LOG_WARN

Or only through re-compiling in MP Lab X and flashing the modified FW?

ERROR NO SERIAL COM CHECK WIRING Should I use 120Ω termination resistors ?

I have the SmartEVSE running fw 2.20 connected to Sensorbox 2. New this weekend: (finally) also connected to the Eastron SDM630-Modbus V2 meter.

Functionally, everything works (charching, kWh counting, smart reaction to other loads to prevent MAINS overload)
but I also get this error regularly: ERROR NO SERIAL COM CHECK WIRING.

I used very short (10-15cm) non-twisted older phone cables with 4 non-stranded wire cores, hooked op 12V, GND, A and B for the Sensorbox-2 and hooked up A B and GND for the Eastrom

Given these errors (which do not seem to hinder the functionality):

  1. Should I use twisted pair wiring even for these short RS-485 connectrions?

  2. I not only connected not only A and B between SmartEVSE and Eastron, but also GND; is this correct?

  3. Should I use 120 Ω termination resistors that seems to be recommended for RS-485 bus topology wiring?

EVSE V3 Set Access bit

I am trying to set the access bit via a serial port. Looks like I am doing something wrong?

Example for Node 3:

Node 3 = 0x4
Access register = 0xA7

Sending for Access:
4,6,0,A7,0,1 + CRC

Sending for No Access

4,6,0,A7,0,0 + CRC

Hope someone can give me some help.

Advice how to implement charging over night

Hi, I would like some advice how to implement charging during specific periods and/or remotely controlled.

A super naive way I can do right now is to MITM Sensorbox report and replace it with predefined frame that tells the controller "no energy is available", but that will result in my car complaining that charging cannot be started.

I could also expand solar timer logic to achieve something similar.

Which way should I take? Thanks!

Proposal for a SmartEVSE to MQTT bridge to enable integration into home automation

I am about to start working on a solution to integrate SmartEVSE into home automation, in my case that would be Home Assistant.

The idea is to create an additional physical slave (pardon: server) device (let's call it a bridge), hooked to the Modbus RTU bus of the SmartEVSE system, that holds a copy of certain registers of the SmartEVSE controllers, which can be updated and read by the primary SmartEVSE controller. The value of these registers is in-turn exchanged by the bridge with Home Assistant based on the MQTT protocol over ethernet.

In a first iteration, the primary EVSE controller will only write information to the bridge. This will allow the home automation system to monitor the SmartEVSE controller's states and certain values.

In a future iteration, the primary EVSE controller will also read information from the bridge that was pushed there from the home automation system, thereby influencing the charge process based on various rules within Home Assistant. These rules can include planning charge time and charge speed based on planned travel schedules, cost of electricity and/or knowledge from the car itself like battery state, etc.

I plan to take an approach where I leave the operation of SmartEVSE as-is, and ensure it will continue to operate as usual and autonomously in case of absence of a connection to the bridge. Also, none of the EVSE safety-related parameters shall be write-accessible through MQTT.

Potentially the device may include the functionality of a Sensorbox to reduce the number of required devices, but I do not pursue that myself.

Any interest in or thoughts on this approach?
Anyone who already started on a similar solution?

Cannot open include file error

I'm attempting to build the project using MPLAB X IDE 6.10, but I'm getting the followng error:


EVSE.c:3103:86: warning: (373) implicit signed to unsigned conversion
"/opt/microchip/xc8/v2.41/bin/xc8-cc"  -mcpu=18F26K22 -Wl,-Map=dist/default/production/SmartEVSE2.X.production.map  -DXPRJ_default=default  -Wl,--defsym=__MPLAB_BUILD=1   -mdfp="/home/lhn/.mchp_packs/Microchip/PIC18F-K_DFP/1.1.58/xc8"  -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto      -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/SmartEVSE2.X.production.elf  build/default/production/EVSE.p1 build/default/production/GLCD.p1 build/default/production/bootloader.p1 build/default/production/utils.p1 build/default/production/modbus.p1 build/default/production/OneWire.p1 build/default/production/font2.p1 build/default/production/font.p1     
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
Non line specific message::: advisory: (1492) using updated 32-bit floating-point libraries; improved accuracy might increase code size
modbus.c:765:: warning: (765) degenerate unsigned comparison
/tmp/xcXLCGDGG/driver_tmp_1.s:8:: error: (140) can't open include file "/home/lhn/.mchp_packs/Microchip/PIC18F-K_DFP/1.1.58/xc8/pic/include/proc/18f26k22.cgen.inc": No such file or directory
/tmp/xcXLCGDGG/driver_tmp_1.s:29758:: error: (800) undefined symbol "tblptrl"
/tmp/xcXLCGDGG/driver_tmp_1.s:29760:: error: (800) undefined symbol "tblptrh"
...

The pack is installed:

 ls -d .mchp_packs/Microchip/PIC18F-K_DFP/1.1.58/xc8/pic/include/
.mchp_packs/Microchip/PIC18F-K_DFP/1.1.58/xc8/pic/include/

but there is no proc in the include dir

I have tried reinstalling the pack, but still no proc.

I successfully built this earlier using 6.05

Smart mode

Hi,
I have problem with smart and solar mode, I cannot get current below zero from current sensor. Current transformator is OK,
it gives +mV and -mV when it s clip oposide, but it is still +A, I can t get -A on controller.
Can you help me solve this problem?

Enable or facilitate support for EVCC

It would be nice if SmartEVSE could be made compatible with https://github.com/evcc-io/evcc .

EVCC would act as a charge controller so you don't have to put clamps in and it does this by combining all metered devices (solar inverters, digital meters etc) and combine this with the SoC of a car to efficiently charge one or multiple cars.

Real current Register 0x01 V220

The master is updating every 2 seconds register 0x01

[9,16,0,1,0,8,16,0,**160,**0,0,0,0,0,0,0,0,0,0,0,0,0,0,227,194]

It does show the current which is set (16,0 A in this example). But it does not update the real charging current?

How can I activate this?

Outdated smartevse.nl website

Yesterday I upgraded my SmartEVSE-2 to firmware 2.30 following the instructions on smartevse website.
I did check out this repository because it contains the newer 2.30 release. The other repository only includes 2.17.
It took me quite some time as I could not find the application to flash new firmware.

Eventually I found it in the project for the first version of the SmartEVSE thanks to this message

After this I could successfully upgrade the firmware.

Is there a way to improve the information on the website? Now information about V1 and V2 is mixed and it confused me.

Reading Modbus interface EVSE

Hi,

I'm trying to read registers via Modbus RTU from the EVSE with iobroker and a USB-modbus converter.
All works well reading the SDM630 I connected as well but I don't get any values for the EVSE.

As an example I try to read the register 0x00C0 Configuration value 0 socket, value 1 fixed.
I've set in the menu of the EVSE the configuration to fixed cable, still reading this register comes with value 0.

Probably the register setting is wrong in iobroker, is it a input register, a coil or a holding register ?

Since these registers are in HEX format I need to convert them, 192 right ?

Maybe the issue is that the EVSE is a Master and probably the iobroker (raspi 4) as well ?

Thanks for your feedback!

XC8 compiler version

The documentation here says to use version 1.45 of the XC8 compiler, but the latest (2.40) version seems to work fine now. Should I still use 1.45?

Output from XC8 v2.40 with Ide v6.05:

CLEAN SUCCESSFUL (total time: 58ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/lhn/extsrc/SmartEVSE-2/SmartEVSE2.X'
make  -f nbproject/Makefile-default.mk dist/default/production/SmartEVSE2.X.production.hex
make[2]: Entering directory '/home/lhn/extsrc/SmartEVSE-2/SmartEVSE2.X'
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/EVSE.p1 EVSE.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/GLCD.p1 GLCD.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/bootloader.p1 bootloader.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/utils.p1 utils.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/modbus.p1 modbus.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/OneWire.p1 OneWire.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/font.p1 font.c 
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -c    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits   -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto     -o build/default/production/font2.p1 font2.c 
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
modbus.c:640:44: warning: (373) implicit signed to unsigned conversion
modbus.c:640:129: warning: (373) implicit signed to unsigned conversion
modbus.c:643:40: warning: (373) implicit signed to unsigned conversion
modbus.c:656:27: warning: (373) implicit signed to unsigned conversion
modbus.c:657:31: warning: (373) implicit signed to unsigned conversion
modbus.c:658:27: warning: (373) implicit signed to unsigned conversion
modbus.c:672:15: warning: (373) implicit signed to unsigned conversion
modbus.c:688:99: warning: (373) implicit signed to unsigned conversion
modbus.c:798:36: warning: (373) implicit signed to unsigned conversion
modbus.c:841:60: warning: (373) implicit signed to unsigned conversion
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
EVSE.c:848:22: warning: (346) declaration of "serialnr" hides outer declaration
EVSE.c:856:22: warning: (373) implicit signed to unsigned conversion
EVSE.c:880:47: warning: (373) implicit signed to unsigned conversion
EVSE.c:897:47: warning: (373) implicit signed to unsigned conversion
EVSE.c:920:55: warning: (373) implicit signed to unsigned conversion
EVSE.c:956:44: warning: (373) implicit signed to unsigned conversion
EVSE.c:957:49: warning: (373) implicit signed to unsigned conversion
EVSE.c:959:42: warning: (373) implicit signed to unsigned conversion
EVSE.c:992:49: warning: (373) implicit signed to unsigned conversion
EVSE.c:992:54: warning: (373) implicit signed to unsigned conversion
EVSE.c:993:42: warning: (373) implicit signed to unsigned conversion
EVSE.c:1009:53: warning: (373) implicit signed to unsigned conversion
EVSE.c:1024:64: warning: (373) implicit signed to unsigned conversion
EVSE.c:1026:67: warning: (373) implicit signed to unsigned conversion
EVSE.c:1027:1: warning: (373) implicit signed to unsigned conversion
EVSE.c:1027:59: warning: (373) implicit signed to unsigned conversion
EVSE.c:1029:42: warning: (373) implicit signed to unsigned conversion
EVSE.c:1085:78: warning: (373) implicit signed to unsigned conversion
EVSE.c:1103:41: warning: (373) implicit signed to unsigned conversion
EVSE.c:1187:66: warning: (373) implicit signed to unsigned conversion
EVSE.c:1188:35: warning: (373) implicit signed to unsigned conversion
EVSE.c:1285:37: warning: (373) implicit signed to unsigned conversion
EVSE.c:1605:28: warning: (373) implicit signed to unsigned conversion
EVSE.c:1609:28: warning: (373) implicit signed to unsigned conversion
EVSE.c:1613:28: warning: (373) implicit signed to unsigned conversion
EVSE.c:1617:28: warning: (373) implicit signed to unsigned conversion
EVSE.c:1804:22: warning: (373) implicit signed to unsigned conversion
EVSE.c:2188:50: warning: (373) implicit signed to unsigned conversion
EVSE.c:2272:43: warning: (373) implicit signed to unsigned conversion
EVSE.c:2339:25: warning: (373) implicit signed to unsigned conversion
EVSE.c:2340:23: warning: (373) implicit signed to unsigned conversion
EVSE.c:2341:33: warning: (373) implicit signed to unsigned conversion
EVSE.c:2342:30: warning: (373) implicit signed to unsigned conversion
EVSE.c:2352:20: warning: (373) implicit signed to unsigned conversion
EVSE.c:2367:22: warning: (373) implicit signed to unsigned conversion
EVSE.c:3087:86: warning: (373) implicit signed to unsigned conversion
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
utils.c:39:28: warning: (373) implicit signed to unsigned conversion
utils.c:105:130: warning: (373) implicit signed to unsigned conversion
utils.c:139:28: warning: (373) implicit signed to unsigned conversion
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
OneWire.c:184:43: warning: (373) implicit signed to unsigned conversion
OneWire.c:205:40: warning: (373) implicit signed to unsigned conversion
OneWire.c:230:44: warning: (373) implicit signed to unsigned conversion
OneWire.c:263:22: warning: (373) implicit signed to unsigned conversion
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
GLCD.c:92:28: warning: (373) implicit signed to unsigned conversion
GLCD.c:99:35: warning: (373) implicit signed to unsigned conversion
GLCD.c:101:30: warning: (373) implicit signed to unsigned conversion
GLCD.c:138:22: warning: (373) implicit signed to unsigned conversion
GLCD.c:161:22: warning: (373) implicit signed to unsigned conversion
GLCD.c:165:18: warning: (373) implicit signed to unsigned conversion
GLCD.c:173:31: warning: (373) implicit signed to unsigned conversion
GLCD.c:177:18: warning: (373) implicit signed to unsigned conversion
GLCD.c:198:21: warning: (373) implicit signed to unsigned conversion
GLCD.c:201:29: warning: (373) implicit signed to unsigned conversion
GLCD.c:222:38: warning: (373) implicit signed to unsigned conversion
GLCD.c:271:40: warning: (373) implicit signed to unsigned conversion
GLCD.c:274:34: warning: (373) implicit signed to unsigned conversion
GLCD.c:288:58: warning: (373) implicit signed to unsigned conversion
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
"/opt/microchip/xc8/v2.40/bin/xc8-cc"  -mcpu=18F26K22 -Wl,-Map=dist/default/production/SmartEVSE2.X.production.map  -DXPRJ_default=default  -Wl,--defsym=__MPLAB_BUILD=1    -fno-short-double -fno-short-float -memi=wordwrite -mrom=0-FCFB -O3 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c90 -gdwarf-3 -mstack=compiled:auto:auto:auto      -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/SmartEVSE2.X.production.elf  build/default/production/EVSE.p1 build/default/production/GLCD.p1 build/default/production/bootloader.p1 build/default/production/utils.p1 build/default/production/modbus.p1 build/default/production/OneWire.p1 build/default/production/font2.p1 build/default/production/font.p1     
::: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2
Non line specific message::: advisory: (1492) using updated 32-bit floating-point libraries; improved accuracy might increase code size
modbus.c:759:: warning: (765) degenerate unsigned comparison

Memory Summary:
    Program space        used  DE19h ( 56857) of  FCFCh bytes   ( 87.8%)
    Data space           used   7BFh (  1983) of   F38h bytes   ( 50.9%)
    Configuration bits   used     7h (     7) of     7h words   (100.0%)
    EEPROM space         used     0h (     0) of   400h bytes   (  0.0%)
    ID Location space    used     8h (     8) of     8h bytes   (100.0%)

make[2]: Leaving directory '/home/lhn/extsrc/SmartEVSE-2/SmartEVSE2.X'
make[1]: Leaving directory '/home/lhn/extsrc/SmartEVSE-2/SmartEVSE2.X'

BUILD SUCCESSFUL (total time: 17s)
Loading code from /home/lhn/extsrc/SmartEVSE-2/SmartEVSE2.X/dist/default/production/SmartEVSE2.X.production.hex...
Program loaded with pack,PIC18F-K_DFP,1.7.134,Microchip
Loading completed

Read / Write Modbus

I am trying ro read / write registers via modbus but the EVSE does not answer.

  • Configured 8600 8 N 1
  • Checked the bus if the data is there, which is
  • Eg ty to read out register 1

Send out: [1,4,0,1,0,1,96,10]

Also tried as other Unit-ID like 2: [2,4,0,1,0,1,96,57] (this data is showed as decimal)

No answer from the Smart EVSE.

When enable Smart / Loadbalancing. The data is there and working correct between the EVSE and Sensorbox.

What am I doing wrong? What does the EVSE expect?

"Bootloader not found" revisited

Just received a new sensorbox2 but couldn't get it to communicate. Therefore I tried to upgrade the software from 2.04 to 2.30. Unfortunately I get "Bootloader not found" when I try to connect to the SmartEVSE module using a FTDI cable and an1310ui.exe. Normal CLI works.

I tried the suggestion from @mstegen:

  • Make sure nothing is connected to 12 pin connector.
  • connect the FTDI cable to the SmartEVSE.
  • start the AN1310 (bootloader program) and press the break(pause) button (F3)
  • power up the SmartEVSE.

But this also fails.
I never upgraded the unit before. What to do?

Renault ZOE ZE50 start of charge problems on hot days

Hi,

I'm having problems with my ZOE in combination with the SmartEVSE. When it enters the C state with the preset max current the car interrupts the charging to start up its heat pump assisted battery/charger air cooling system first. SmartEVSE goes into a wait mode, the car starts up the cooling but depending on temperature it shuts it's cooling off before the charging is re-started so this sometimes goes on and on... Charge start/stop/restart...

The problem only manifests itself when the vehicle is so hot it needs cooling even before it starts charging so when parked in the sun and outside temperature is around/over 35°C (the new normal for last two weeks...).

From what i tested it always accepts start of charging at 6A no matter the temperature, if the charger waits a few seconds so the car can start all its internal cooling systems than i ramp up the charging current all works well. It goes normal to full charging power without any issues. Slow ramp up of charging current is also beneficial for regulation and fuse safety in a home. In an overcurrent situation the current is reduced instantly but than it ramps up slowly again.

I made this changes to the code and i'm testing this now:
Slow current increase fix2

Slow current increase fix

There is maybe some other more correct/elegant way of doing this, and i have no way to test this in a solar situation, but this slow current ramp up can be beneficial also for solar setups.

I also noticed that some better public chargers perform a slow charge current ramp up.

Any ideas and comments welcome.

Regards, Andrej

Use of Access Bit

Hi @bobosch , @mstegen ,

What is the desired use for the access bit, is it the purpose to enable/disable charging in general, or only in combination with e.g. the RFID ?
I currently don't use RFID or any other access verification , but i do use the access bit in my automation to disable charging at dynamic moments (e.g. i first let my house battery fully charge on solar, only then i enable access bit ( solar is automatically set at 7h in de morning).
If this is not the intended use, then i will have a look and introduce something similar. If it is the intended use, then i will verify if everything works as designed ( e.g. switching from smart to solar "resets" the access bit)

Thanks !

No response for 'state' over Modbus on FW 2.30

Hi

Just updated my SmartEVSE to 2.30.
Where I was able to get the state from address 0x00A0 on FW 2.13, I'm not able to get in from 0x0000 on FW 2.30.
Other addresses seem to work fine.

Any ideas?

Kind regards
M

Car plugged in + Car battery state

I made an integration for Home Assistant but to have a complete automation i'm missing some information :

  • Is there a possibility to detect if a car is plugged in ( which can be published via modbus ) ?
  • Is there a possibility to read the EV battery percentage ? ( If i'm not mistaken this information is shared via the digital protocol, but i couldn't find any starting point of how this protocol works )

Could you please advice me how this can be achieved ?

Thanks !

Loading hex file from Linux

I'm on Linux.
I have compiled the project and now I need to load it.

The instructions here https://www.smartevse.nl/building-and-programming say "Start the AN1310 bootloader program in the /bootloader directory."
I cannot find any program called AN1310, and no bootloader directories related to mplab.

Should I use UnifiedHost-1.19.1 booloader from here https://www.microchip.com/en-us/tools-resources/develop/libraries/microchip-bootloaders/8-bit?
If so, then what are the correct settings?

Or something completely different?

How to enter to bootloader now?

Hello. I deleted this in the EVSE.c file:

            if ((timeout == 0) && !(Error & CT_NOCOMM))                         // timeout if CT current measurement takes > 10 secs
            {
                Error |= CT_NOCOMM;
                setState(STATE_A);                                              // switch back to state A
#ifdef LOG_WARN_EVSE
                printf("\nError, communication error!");
#endif
                ResetBalancedStates();
            } else if (timeout) timeout--;

and I think this is the reason why I cannot enter bootloader mode. It says "bootloader not found". Screen always stays bright and each minute it gives error about temperature. So as far as I understand it thinks that there is a car connected and does not give opportunity to enter bootloader mode. What should I do now? I want to reprogram it back as it was... :(

Add modbus input validation?

I'm still running the 2.17 firmware, but it does crash sometimes when modbus is used (integrated it myself using my https://github.com/ict-one-nl/Modbus2Mqtt library). Looking at the code - maybe I'm looking in the wrong place - but I don't seem to see input validation (expecting an int, make sure it's a valid int) on incoming modbus traffic.

I suspect this could be the issue of my stability issues, in the 2.20 firmware I'm not seeing it either (but I'm not a C++ crack so bear with me :) )

HW fix for LCD re-init?

Hi.
What's with the re-init of LCD at contactor open and close functions? Surely, this is a quick patch not a solution. I'm volunteering to fix the HW issue causing this to be needed, if someone can tell me how exactly to reproduce the LCD issue on my side. What contactor was used, what ware the load conditions, how long ware the wires?

reinit lcd

bootloader not found .

when i tried to load the hex file using AN1310 v1.05. the program show on the bottom left corner that Boot Loader not found . but when i run into Application mode it works fine.

Smart charging not working as expected due to latency

Hi all,

After charging for some while I started checking the system in Smart mode.
I have the SmarEVSE-2 and sensorbox 2 connected with 20m Cat6 cable, the sensorbox uses the P1 port to receive data.
The Green status led is blinking every 2 seconds when data has been received.
All above looks fine, until the load balancing needs to kick in.

The update rate from the sensorbox to the SmartEvSe-2 is way to slow. measured latency from disconnecting or connecting load is almost 10 seconds!! Due to this latency the SmartEVSE-2 is not throttling the output correct and go's to wait for power mode.

To make sure the update rate is fine I checked the RAW data with domoticz and a USB P1 logger, the update rate is 1 second.
Any ideas to fix latency issue?

What is the purpose of the LED at ping +12V and LED

I have updated my smartEVSE V2.02 to version 2.30 because I want to use the solar function.
Between +12V ==> I/O1 (LED) I have an LED and between I/O2 (sw) ==> GND I have switched the button.
I can't figure out how the LED works, it's always on, regardless of whether I'm charging solar, smart or normal.
The button works perfectly.

Greetings from Oldenburg (Odlb)

Ps: sorry, translate whit google.

SmartEVSE not recognising car anymore

Probably hardware issue, not software issue. But want to rule out software before swapping hardware out.
SmartEVSE was always working without issues. Great product. I have 2 in load balancing mode. And an ESP8266 connected to the smart meter and my kwh meters. ESP8266 runs modified sensorbox code to provide the EVSEs with the current numbers and update my smarthome system with readings.

Recently 1 of them started malfunctioning. I plug the EV in, but EVSE does nothing. Sometimes the LED screen will light up, sometimes not.
Most of the time it worked again after turning the EVSE on and off. But even that is now no longer working.
If I put the multimeter on CP and GND, it sometimes shows around 9V, sometimes more around 6V. If I then turn EVSE on and off, it works mostly. Putting the multimeter on there, somehow makes it sometimes work after turning EVSE on and off.
If EVSE turns to smart charging, it typically stays active for quite a while. It might drop every once in a while for unexplained reasons (ie enough power available), but then usually picks it back up again soon

So my guess is a hardwire issue on GND or on CP. Before these problems started, I had quite some unexpected serial comms issues, which went away when I simply disconnected GND. I have the 2 EVSE in load balance.

Any thoughts on how to fix welcome. I might swap the 2 EVSEs to confirm it is really the EVSE (and not the fixed cable connected to it), but have not had time to do this yet and would rather not if I did not have to

Eastron SDM630 config

I bought the smart evse with sensor box. I also bought the eastron SDM630 v2. How to configure the eastron so it will show the consumption of the charger on the display?

Update from 2.06 and solar power

Hi!

I'm currently working on my own solarpower system at home. I've wallbox with SmartEvse (2.06v), and i'm looking how to update it to 2.2v to make it works with a sensorbox2 and use only solar energy.

In addition, i'm looking for some info about what do i need to conect sensorbox to the inverter. As i read Stegen website, i shoul use a "smart meter" and they have a tested list, but... i really don't know what is a sensor box. I'm new on solar energy world and not english expert haha.

Should i connect these "smart meter" to the inverter? how?

In my mind:

Current phase entry to home->Current Transform (i got it)->SensorBox V2 (actually have a v1.5)->SmartMeter (don't know what it is haha). Is this right? If OK, next... From Smartmeter in advance... What is the next step??

SmartMeter is a necessary part of a solar energy installation? If i use a Huawei Sun2000 inverter, can i connect any of those smart meters related previously?

Sorry for this, really new on this world.

Very thankful for your helping.

Regards,

David.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.