Skip to content

Commit

Permalink
add firmware and update docu
Browse files Browse the repository at this point in the history
  • Loading branch information
raibisch committed Dec 18, 2023
1 parent bc1161b commit 75bc76a
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 25 deletions.
82 changes: 57 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,38 @@

![Android-App](/pict/Screenshot_app_index.png)

Monitor and control your ABL-Wallbox with an WEB-Application and integrate it in your homeautomation software with simple REST-Interface (see example for DOMOTICZ below) for less than 10€.
Monitor and control your ABL-Wallbox with an WEB-Application and integrate it (optional) in your homeautomation software with simple REST-Interface (see example for DOMOTICZ below) for less than 10€.

The user interface was designed very simply to enable switching between two charging currents (possible application: reduced charging current for operation with a PV system).
The two values could be individual defined in the 'config-data' page (for use without external setting via WEB-API, or as "HIGH/LOW Quit-Set" values)
## 'Virtual' consumption for ABL-Boxes without phase current sensor

With the WEB-API the state and consumption values of the Wallbox could be monitored and charge-current could be set from 6A up to 16A in external applications like homeautomation software.
For (new) ABL-Boxes without internal per phase current sensor, the current could "pre-measured" external and defined in the APP-configuration per Imax setting. So it it possible to have a "poor man's" power and consumption measurement. If you charge every time the same car, the typical power for a defined Ipwm is near to the real measurement with a current-sensor, but that has also an error, because the voltage 'U' for power calulation (P=U*(I1+I2+I2) is not measured. I get the power from my "offical" smartmeter and set them into the config-file.

For (new) ABL-Boxes without internal per phase current sensor, the current could "pre-measured" external and defined in the APP-configuration per Imax setting. So it it possible to have a "poor man's" power and consumption measurement. If you charge every time the same car, the typical power for a defined Ipwm is near to the real measurement with a current-sensor (that has also an error because U is not measured). (I get the consumption from my "offical" smartmeter and set them into the config-file). If the Box has a current-sensor it was automatic detected and the value is calculated based on the current sum of the 3-phases.
If the Box has a current-sensor it was automatic detected and the value is calculated based on the current sum of the 3-phases...For future versions it would be possible to expand the software to get the power or current over the WEB-API from an external meter.

Additional functions (Setup) in Web-Interface
## Manual Charge-Current-Setting

* CONFIG-DATA: set and store parameter and WiFi-credentials and the the "Quick-Set charge-current"
* EVENT-LOG: Serial debug logging
* OTA-UPDATE: Software update (Over the air software update)
* HISTORY: Set and Store total kW/h sum in internal FLASH
The user interface was designed very simply to enable manual switching between two charging currents (possible application: reduced charging current for operation with a PV system).
The two values could be individual defined in the 'config-data' page (for external setting use the WEB-API)

* V.1. NEW: calulate consuption for ABL-Boxes without internal phase-current-sensor
## External Charge-Current-Setting and reading values (WEB-API)

### WEB-API for external Software
With the WEB-API the state and consumption values of the Wallbox could be monitored and charge-current could be set from 6A up to 16A in external applications like homeautomation software.

#### Fetch aktual Values and State
### Fetch aktual Values and State

**GET-Values:**
`http:<your-ip>/fetch`

Receive:
`8.00,0.00,A1,0.00,103980`

decoded:
`<Imax [A]>,<aktual Power [kW]>,<Status>,<aktual Work [kW/h]>,<Sum Work [kW/h]>`
`<Imax [A]>,<aktual Power [kW]>,<Status>,<aktual Work [kW/h]>,<Sum Work [W/h]>`

### Set value Imax

**Set value Imax:**
`http:<your-ip>/fetch?imax=xx` (xx= 6,8,10,12,14,16)

#### Domoticz Integration
### Domoticz Integration

...see above 'WEB-API' for other external integration (e.g. other homeautomation software)

Expand Down Expand Up @@ -81,10 +78,19 @@ domoticz_updateDevice(63,'',values[1]) -- Imax
domoticz_updateDevice(65,'',tonumber(values[2])*1000) -- Watt !!
domoticz_updateDevice(62,'ABL-Status',values[3]) -- Status-String
domoticz_updateDevice(66,'',values[4]) -- kW/h
domoticz_updateDevice(67,'',values[5]) -- kW/h SUM
domoticz_updateDevice(67,'',values[5]) -- W/h SUM
```

#### Hardware
## Additional functions (Setup) in Web-Interface

* CONFIG-DATA: set and store parameter and WiFi-credentials and the the "Quick-Set charge-current"
* EVENT-LOG: Serial debug logging
* OTA-UPDATE: Software update (Over the air software update)
* HISTORY: Set and Store total kW/h sum in internal FLASH

* V.1. NEW: calulate consuption for ABL-Boxes without internal phase-current-sensor

## Hardware

This example is realised with an 'ESP32-S2 mini' board and an 'MAX485 TTL to RS485' Converter.
...but any other ESP-Board could be used with small modifications in the code and platformio.ini.
Expand All @@ -94,7 +100,7 @@ This example is realised with an 'ESP32-S2 mini' board and an 'MAX485 TTL to RS4

## Helpful Infos and links and investigations (most in german)

#### Software
### Software

my shared investigations and notes:
[my-doc](/doc/knowhow.txt)
Expand All @@ -106,7 +112,7 @@ https://www.goingelectric.de/forum/viewtopic.php?f=34&t=38749&start=60

https://www.goingelectric.de/forum/viewtopic.php?p=1550459#

#### Hardware
### Hardware

![prototype](/pict/ABL_Modbus_Connector.jpg)
connect RS485 to Pin1 (=A) and Pin2 (=B) of left RJ45-Connector in Wallbox
Expand All @@ -125,13 +131,42 @@ https://github.com/evcc-io/evcc/discussions/2801
* To download click the DOWNLOAD ZIP button, rename the uncompressed folder 'ESP32_ABL'
...or clone it with git

#### PlatformIO and Arduino-IDE
### PlatformIO and Arduino-IDE

Projekt was build and testet with PlatformIO.

Take care to upload the 'data' folder to the SPIFFS filesystem
see: https://randomnerdtutorials.com/esp32-vs-code-platformio-spiffs/

### Flash Program (without PlatformIO or Arduino-IDE)

If you do not want to compile the program from source:

for the ESP32-S2 mini board I supply the actual firmware-version
* got to subfolder `firmware/lolin_s2_mini/V1_1`

* put ESP32-S2 board to flash-mode:
** disconnect USB then press and hold "0"-button
** reconnect USB hold "0"-button
** then release "0"-button
--> now the board is in program-mode

* run `flash.sh` (for Linux) or `flash.bat` (for Windows)
(needs 'esptool.py') --> ask google

* after flashing reset or disconnect USB
* search WIFI connetions for "ABLWALLBOX"
* connect (without password)
* start your webbrowser at "192.168.4.1" (this is the startpage for the APP)
* to connect to your home-route navigate to "Setup" --> "Config-Data" and change:

```
varWIFI_s_Mode=STA;
varWIFI_s_Password=mypassword;
varWIFI_s_SSID=myrouter;
```


## Version History
V1.0 initial version, first test with real charging car (VW ID.3)

Expand All @@ -140,6 +175,3 @@ V1.1 ABL-Box without internal current-sensor: calculate power and consumption fr
## todo
- test "PAUSE" function and switch Ipwm at charging time.
- MQTT-client (does someone need this ?)
- publish compiled firmware


2 changes: 2 additions & 0 deletions firmware/flash_firmware.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
esptool.py write_flash -x 0x10000 ./firmware.bin

Binary file added firmware/lolin_s2_mini/V1_1/bootloader.bin
Binary file not shown.
Binary file added firmware/lolin_s2_mini/V1_1/firmware.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions firmware/lolin_s2_mini/V1_1/flash.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
esptool.py write_flash -z 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin 0x290000 spiffs.bin

5 changes: 5 additions & 0 deletions firmware/lolin_s2_mini/V1_1/flash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
esptool.py write_flash -z \
0x1000 ./bootloader.bin \
0x8000 ./partitions.bin \
0x10000 ./firmware.bin \
0x290000 ./spiffs.bin
Binary file added firmware/lolin_s2_mini/V1_1/partitions.bin
Binary file not shown.
Binary file added firmware/lolin_s2_mini/V1_1/spiffs.bin
Binary file not shown.

0 comments on commit 75bc76a

Please sign in to comment.