Closed k-janssens closed 5 months ago
I've got it running on both a Linux and Windows machine. The steps to setup the environment are:
PlatformIO should install everything automatically.
please note that you need to patch the eModbus code in order for it to work correctly.
You can upload the code by pressing the upload button. This will only update the first code partition (ota_0). You can also use the /update endpoint for uploading the firmware, but this will update ota_1, and set the boot partition to ota_1. If you now upload the code with the USB cable it will update ota_0, so your changes are written to flash, but not active. This can be very frustrating when debugging, so it's best to only use the USB method, or /update, but not both..
There is no way to locally test the software.
Thanks for the information!
One last question about doing an actual update: If I use the /update endpoint and my code screws up the EVSE due to a coding error. As this update is written to the ota_1 partition, activating ota_0 should fix it? How can I re-activate ota_0 again if the firmware on ota_1 is faulty?
Update: I risked it, update went without problem. My changes are working BUT I'm getting an error on the unit: "Error no serial comm check wiring"
So the sensorbox data is not processed anymore, any idea what went wrong?
Good question. The ESP will do some tests if the partition is bootable, if not it will boot the previous partition. But if you for example upload a firmware without /update feature working, then the only way to revert things is to erase the 'otadata' partition in flash.
This should work: (replace the COM7 port with the SmartEVSE's com port)
python esptool.py --chip esp32 --port "COM7" --before default_reset --after hard_reset erase_region 0xe000 0x2000
Good to know I can revert, maybe need it today :)
You have an idea why the modbus isn't working anymore?
Modbus is working, as the master can read/write to the sensorbox, modbus kWh meters, and connected node SmartEVSE's. It's just that the library i used does not allow an extra modbus master on the bus.
As long as there is one modbus master, and all the other devices are unique nodes/slaves it should work.
I'll see if i can write up a minimal set of commands, to send to each node for it to not display a comm error.
No it is not about me using modbus with the EVSE. And now there is the possibility of adding web api this is less of an issue for me.
But on the EVSE screen I get this screen after the update:
Also on the status page there is not L1/2/3 data anymore.
And would it be possible to upload the firmware.bin you used? This should also allow me to go back to the stock fw
Sure, here you go:
Did you also patch RTUutils.cpp (two modifications are needed) ? see https://github.com/SmartEVSE/SmartEVSE-3/issues/2
No ... I've seen the issue but did not make the link I had to change this in the emod lib, all is working again, thanks!
So I was able to add 2 functional endpoints:
It is still a WiP, but I can create a PR in time if this could be of interest to you? https://github.com/serkri/SmartEVSE-3
I have just checked your fork, Wow. Great work!
I like that you got rid of websockets, and now uses ajax instead, it might not be the most responsive, but it's a lot more stable. The Rest API is absolutely something i like to add. So yes a PR is definitely appreciated. I will go through your changes in the next few days.
Thanks again!
If you don't want to clutter your system with another IDE, and are happy with just a CLI compiler, this dev environment will work for you (actually uses the same scripts that vscode is using), KISS method: 1) install platformio-core https://docs.platformio.org/en/latest/core/installation/methods/index.html 2) cd to the smartevse directory where platformio.ini is located 3) compile firmware.bin: platformio run 4) compile spiffs.bin: platformio run -t buildfs
If you are not using the webserver /update endpoint:
Added to the manual...
Not an issue but a question on how I (and others) can help growing this great product.
I've installed the V3 last week and it is working great (except for the modbus issue :)).
The only issue I've experiencing is the conflict between my inverter who wants to load the home battery, and the EVSE who wants to load my car battery. The result is that the EVSE will always go to the highest current possible as the home battery will jump in if there isn't enough solar power.
So I was thinking of creating a PR for adding a API on your new webserver that will accept home battery current information to adjust the calculation of the car current.
I've already configured VSC with the PlatformIO plugin, but it seems the project.cmake file is missing.
So my questions: