Giter Club home page Giter Club logo

diybmsv4esp32's Introduction

diyBMS v4

Version 4 of the diyBMS. Do-it-yourself battery management system for Lithium ion battery packs and cells

If you are looking for version 3 of this project take a look here https://github.com/stuartpittaway/diyBMS

THIS CODE IS FOR THE NEW CONTROLLER (AFTER FEB 2021) AND ESP32 DEVKIT-C

Support the project

If you find the BMS useful, please consider buying me a beer, check out Patreon for more information.

You can also send beer tokens via Paypal - https://paypal.me/stuart2222

Any donations go towards the on going development and prototype costs of the project.

Videos on how to use and build

https://www.youtube.com/stuartpittaway

Video on how to program the devices

https://youtu.be/wTqDMg_Ql98

Video on how to order from JLCPCB

https://youtu.be/E1OS0ZOmOT8

How to use the code

Instructions for programming/flashing the hardware can be found here

Help

If you need help, ask over at the forum

If you discover a bug or want to make a feature suggestion, open a Github issue

Hardware

Hardware for this code is in a seperate repository, and consists of a controller (you need 1 of these) and modules (one per series cell in your battery)

https://github.com/stuartpittaway/diyBMSv4

WARNING

This is a DIY product/solution so don’t use this for safety critical systems or in any situation where there could be a risk to life.

There is no warranty, it may not work as expected or at all.

The use of this project is done so entirely at your own risk. It may involve electrical voltages which could kill - if in doubt, seek help.

The use of this project may not be compliant with local laws or regulations - if in doubt, seek help.

How to compile the code yourself

The code uses PlatformIO to build the code. There isn't any need to compile the code if you simply want to use it, see "How to use the code" above.

If you want to make changes, fix bugs or poke around, use platformio editor to open the workspace named "diybms_workspace.code-workspace"

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales License.

https://creativecommons.org/licenses/by-nc-sa/2.0/uk/

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • Non-Commercial — You may not use the material for commercial purposes.
  • ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Notices: You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

diybmsv4esp32's People

Contributors

atanisoft avatar bertvaneyken avatar danielch58 avatar daromer2 avatar dgrebe avatar garkus98 avatar hotear avatar imkermichel avatar jbuszkie avatar kroesche avatar n1c084 avatar stuartpittaway 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  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

diybmsv4esp32's Issues

Spontaneous reboots of the esp32 controller

Hi Stuart,
I finally got the serial outut when my esp32 controller reboots:
I pasted a bit before and an bit after the reboot so you have an idea what it looks like "normally", hope this helps

[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
[I][influxdb.cpp:65] influxdb_onDisconnect(): Influx disconnected
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][main.cpp:1459] influxdb_task(): Influx task
[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
[I][influxdb.cpp:65] influxdb_onDisconnect(): Influx disconnected
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][main.cpp:1459] influxdb_task(): Influx task
[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x40151736 PS : 0x00060830 A0 : 0x80149f26 A1 : 0x3ffd8d40
A2 : 0x3ffecb3c A3 : 0x00450008 A4 : 0x00000002 A5 : 0x00000000
A6 : 0x3ffd81e4 A7 : 0x3ffd8280 A8 : 0x007ff834 A9 : 0x0080036c
A10 : 0x00000000 A11 : 0x00000359 A12 : 0x00800013 A13 : 0x00000b38
A14 : 0x00060820 A15 : 0x00000000 SAR : 0x00000019 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00450018 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

ELF file SHA256: 0000000000000000

Backtrace: 0x40151736:0x3ffd8d40 0x40149f23:0x3ffd8d70 0x400e5de2:0x3ffd8d90 0x40149064:0x3ffd8db0 0x40092ce2:0x3ffd8de0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8

            _          __ 
_|  o      |_)  |\/|  (_  

(| | / |) | | __)
/
[I][main.cpp:3286] setup(): CONTROLLER - ver:019382f764db386f6cab8d8338ad073d21b7bad0 compiled 2021-10-05T10:47:31.492Z
[I][main.cpp:3291] setup(): ESP32 Chip model = 1, Rev 1, Cores=2, Features=50
[I][HAL_ESP32.cpp:232] ConfigureI2C(): Configure I2C
[I][HAL_ESP32.cpp:291] ConfigureI2C(): Found TCA9534A
[I][HAL_ESP32.cpp:321] ConfigureI2C(): Found TCA6408
[D][HAL_ESP32.h:288] TouchScreenUpdate(): Touch = touch=0 pressure=0 x=0 y=0
[I][main.cpp:3313] setup(): TFT screen is NOT installed
[I][main.cpp:934] SetControllerState(): ** Controller changed state from Unknown to PowerUp **
[I][main.cpp:3328] setup(): LITTLEFS mounted, totalBytes=589824, usedBytes=81920
[I][main.cpp:241] mountSDCard(): Mounting SD card
[W][sd_diskio.cpp:101] sdWait(): Wait Failed
[E][sd_diskio.cpp:123] sdSelectCard(): Select Failed
[W][sd_diskio.cpp:505] ff_sd_initialize(): GO_IDLE_STATE failed
[E][sd_diskio.cpp:775] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[W][sd_diskio.cpp:101] sdWait(): Wait Failed
[E][sd_diskio.cpp:123] sdSelectCard(): Select Failed
[E][main.cpp:260] mountSDCard(): Card Mount Failed
[I][HAL_ESP32.cpp:140] ConfigureCAN(): CAN driver installed. Filter=1621098496 Mask=6291455
[I][HAL_ESP32.cpp:150] ConfigureCAN(): CAN driver started
[D][settings.cpp:20] ReadConfig(): ReadConfig diybms
[D][settings.cpp:42] ReadConfig(): checksum verified
[I][main.cpp:3352] setup():
[D][main.cpp:200] SetupRS485(): Setup RS485
[D][main.cpp:187] ConfigureRS485(): Configure RS485
[D][HAL_ESP32.cpp:86] SetOutputState(): SetOutputState 0=153
[D][HAL_ESP32.cpp:86] SetOutputState(): SetOutputState 1=153
[D][HAL_ESP32.cpp:86] SetOutputState(): SetOutputState 2=153
[D][HAL_ESP32.cpp:86] SetOutputState(): SetOutputState 3=153
Press SPACE BAR to enter terminal based configuration................skipped
[D][settings.cpp:20] ReadConfig(): ReadConfig diybmswifi
[D][settings.cpp:42] ReadConfig(): checksum verified
[I][main.cpp:934] SetControllerState(): ** Controller changed state from PowerUp to Stabilizing **
[D][main.cpp:757] tca6408_isr_task(): tca6408_isr
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
[I][main.cpp:1422] connectToWifi(): Hostname: DIYBMS-0043C924, current state 255
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:419] _eventCallback(): STA IP: 192.168.1.36, MASK: 255.255.255.0, GW: 192.168.1.1
[I][main.cpp:1511] onWifiConnect(): Wi-Fi status=3
[I][main.cpp:1513] onWifiConnect(): Request NTP from time.google.com
[I][DIYBMSServer.cpp:2684] StartServer(): Start Web Server complete
[I][ArduinoOTA.cpp:141] begin(): OTA server at: DIYBMS-0043C924.local:3232
[I][main.cpp:1547] onWifiConnect(): mDNS responder started
[I][main.cpp:1552] onWifiConnect(): You can access DIYBMS interface at http://DIYBMS-0043C924.local or http://192.168.1.36
[I][Rules.cpp:142] SetError(): Set error 4
[I][Rules.cpp:142] SetError(): Set error 4

OOS Error, expected=33A, got=1
[W][AsyncTCP.cpp:969] _poll(): rx timeout 4
[I][main.cpp:934] SetControllerState(): ** Controller changed state from Stabilizing to Running **
[I][main.cpp:1459] influxdb_task(): Influx task
[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
[I][influxdb.cpp:65] influxdb_onDisconnect(): Influx disconnected
[I][main.cpp:1459] influxdb_task(): Influx task
[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
[I][influxdb.cpp:65] influxdb_onDisconnect(): Influx disconnected
[I][Rules.cpp:128] SetWarning(): Set warning 1
[I][main.cpp:1459] influxdb_task(): Influx task
[D][influxdb.cpp:140] influx_task_action(): Create new client
[I][influxdb.cpp:177] influx_task_action(): Influx host 192.168.1.50 port 8086
[D][influxdb.cpp:73] influxdb_onConnect(): Influx connected
[D][influxdb.cpp:126] influxdb_onConnect(): Influx data sent
[D][influxdb.cpp:47] influxdb_onData(): Influx data received
[I][influxdb.cpp:65] influxdb_onDisconnect(): Influx disconnected
[I][Rules.cpp:128] SetWarning(): Set warning 1

Random reboots when InfluxDB enabled

Logging to InfluxDB works, but controller crashes (see below) and reboots at random intervals #during a day.

(Can provide more information if you let me know what you need @stuartpittaway )

Version: 4a507db
Compiled: 2021-07-06T10:45:43.400Z
Language: language
SDK Version:v3.3.5-1-g85c43024c
Min free Heap:51656
Free heap:86920
Heap size:296968

-----------------------------------------------------------------------------------------------------------
[D][main.cpp:163] voltageandstatussnapshot_task():   ##Snap
[I][AsyncMqttClient.cpp:677] _sendPing(): PING
[I][AsyncMqttClient.cpp:387] _addBack(): new back #12
[I][AsyncMqttClient.cpp:419] _handleQueue(): snd #12: 2/2
[I][AsyncMqttClient.cpp:429] _handleQueue(): p #12 rel
[I][AsyncMqttClient.cpp:250] _onAck(): ack 2
[I][AsyncMqttClient.cpp:255] _onData(): data rcv (2)
[I][AsyncMqttClient.cpp:272] _onData(): rcv PINGRESP
[I][AsyncMqttClient.cpp:502] _onPingResp(): PINGRESP
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (influxdb) 
Core 0 register dump:
PC      : 0x4008f3ed  PS      : 0x00060536  A0      : 0x00060530  A1      : 0x3ffd8950  
A2      : 0x3f45603b  A3      : 0x3f456037  A4      : 0x000000ff  A5      : 0x0000ff00  
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x00000000  
A10     : 0x00000000  A11     : 0x3ffd8c10  A12     : 0x00000000  A13     : 0x00000046  
A14     : 0x0000002a  A15     : 0x3ffdc1d0  SAR     : 0x00000004  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffe  

ELF file SHA256: 0000000000000000

Backtrace: 0x4008f3ed:0x3ffd8950 0x0006052d:0x3ffd8a20 0x401243aa:0x3ffd8d30 0x401243e6:0x3ffd8dc0 0x400fdf6e:0x3ffd8e00 0x400de78c:0x3ffd8e60 0x40092cf6:0x3ffd8e80

Rebooting...

Add Russian language

Hello from Russia! I ordered circuit boards to repeat the project. I can translate the web interface and instructions into Russian, but I don’t see where the language data is stored. Sorry for my English if there are any errors.

Best Regards
Evgeny

Is TCA9534A necessary?

Is TCA9534A necessary for the operation of Relays, SSRs. As the part is no longer available at LCSC.Com

ESP32 reboots intermitted when screen is touched

When the controller is running for 8 to 9 hours without being touched the ESP reboots upon touch of the screen.
If there is a way to write logging to SD card I'm happy to try and log this behavior.

Did not notice this behavior in prev. release now running 2021-04-07T08:44:43.615Z

ESP32 errors when trying to connect to wifi via putty

Hi,

Flashed ESP32 with nodemcu-pyflasher and all was ok no issues. Then used putty and connected via serial to try and connect o wifi but getting this response.

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8

            _          __
_|  o      |_)  |\/|  (_

(| | / |) | | __)
/
[I][main.cpp:3286] setup(): CONTROLLER - ver:019382f764db386f6cab8d8338ad073d21b 7bad0 compiled 2021-10-05T10:47:31.492Z
[I][main.cpp:3291] setup(): ESP32 Chip model = 1, Rev 1, Cores=2, Features=50
[I][HAL_ESP32.cpp:232] ConfigureI2C(): Configure I2C
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0x107 (ESP_ERR_TIMEOUT) at 0x400 91293
file: "src/HAL_ESP32.cpp" line 60
func: esp_err_t HAL_ESP32::writeByte(i2c_port_t, uint8_t, uint8_t, uint8_t)
expression: i2c_master_cmd_begin(i2c_num, cmd, pdMS_TO_TICKS(100))
[E][HAL_ESP32.cpp:277] ConfigureI2C(): TCA9534APWR Error
[E][HAL_ESP32.h:181] Halt(): SYSTEM HALTED
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40091 293
file: "src/HAL_ESP32.cpp" line 60
func: esp_err_t HAL_ESP32::writeByte(i2c_port_t, uint8_t, uint8_t, uint8_t)
expression: i2c_master_cmd_begin(i2c_num, cmd, pdMS_TO_TICKS(100))
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40091 293
file: "src/HAL_ESP32.cpp" line 113
func: void HAL_ESP32::Led(uint8_t)
expression: writeByte(I2C_NUM_0, TCA9534APWR_ADDRESS, TCA9534APWR_OUTPUT, TCA953 4APWR_Value)
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40091 293
file: "src/HAL_ESP32.cpp" line 60
func: esp_err_t HAL_ESP32::writeByte(i2c_port_t, uint8_t, uint8_t, uint8_t)
expression: i2c_master_cmd_begin(i2c_num, cmd, pdMS_TO_TICKS(100))
ESP_ERROR_CHECK_WITHOUT_ABORT failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40091 293

Any idea why I am getting these errors.

The esp32 i am using are the recommeneded ones.

https://www.amazon.co.uk/gp/product/B08DXSMZSB/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

cheers

[Question] Networked logging

I am trying to figure out a few values from the rs485 data stream, but cannot always use the serial as Im sometimes too far from the boat. Is there any way to output debug values over network?

I have tried https://github.com/MalteJ/embedded-esp32-component-udp_logging which resulted in a hang on boot, which I could not debug, as I did not have access to serial. It was probably just a bad init on my part.

I have also written some rudamentary functions to just concatenate text serve it as a webpage, but that corrupted the stack. My fault as well :)

[Question] Settings survive after flash new version?

I've just upgraded to the latest automatic version and I've noticed that all the settings have been lost, including wifi connection, shunt config and rules. I'm not using the onboard sd slot nor the display one.

Should the settings had survived if a SD card was used? The screen SD port can also be used? (the onboard port requires disassembly of the screen and the whole bundle if it is inside a box.

lazy_tasks(): ERR: Lazy overflow Q=6

Error - lazyt task is exiting

[E][main.cpp:1878] lazy_tasks(): ERR: Lazy overflow Q=6
E (61413) FreeRTOS: FreeRTOS Task "lazyt" should not return, Aborting now!
abort() was called at PC 0x40092c97 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x40090d84:0x3ffcebc0 0x40091001:0x3ffcebe0 0x40092c97:0x3ffcec00

Rebooting...
ets Jun  8 2016 00:22:57

Random touch screen interrupt reboots controller

Looks like static/esd on the inputs cause multiple interrupts to trigger causing reboots of the controller.

Inputs need to be grounded/held high - in software, change them to outputs for now.

uptime displayed wrong/rebooting when data cannot be written

Hi Stuart,
I downloaded and am currently testing the latest firmware (september 2021).
All spontaneaus rboots are gone!, thanks.
two issues I did find; the uptime counter is not correct;
When the 24hour mark had beenreached, the "day"count is the same as the "hour count", eg when it shoudl display 2days13 hours 5minutes, it shows: 13days13hours5minutes.

The other issues I found is;
when enabling logging via influxdb, but the influxdb server is not available (controllersnot able to write to influxdb server), then the controller reboots. (I tested when putting in wrong credentials, and also temporarily shutting down the influxdb server)

But despite these thing, I am very happy with the new firmware!

Add "Battery capacity"

State of charge
For a State of Charge to work, Shunt needs to know the battery capacity.
Add a "Battery capacity" field in shunt settings.
Display SoC in main window (with one decimal).

"Consumed Ah" would be a nice feature.
When Battery is full, manually reset the SoC is 100% or otherwise set to "now battery is full", Consumed Ah is 0Ah
While discharing, Consumed Ah decresses, it counts down.
When charging, it counts up.
When it hits Consumed Ah 0Ah it stops counting. It will never raise above 0Ah.

Syncronize SoC
There should be a way to manually set SoC. If you know batteries are full, you manually syncronize SoC to 100%.
This resets "Consumed Ah" to 0Ah
Likewize, if you know SoC is 50%, "Consumed Ah" is set to half of "Battery capacity" times minus 1

Automatic SoC syncronize
Introduce a "Battery full voltage".
When shunt voltage reaches this value and stays above this value för "Charge detection time" (3 minutes) and current is less than "Tail current" (1%) (1% of "Battery capacity" eg. 560Ah battery when hits 56V for three minutes and it charges with less than 560*0.01 = 5.6A during this time = battery is full. "Consumed Ah" is reset to 0Ah

Unnecessary values
The other values "Ah In" and "Ah out", contributes with no usefull data (circled green).
image
Personally I don't think they belong in a overview window, more like a "extended data section"
Since they never resed, they are more a "Total Ah in/out" counter.

[Question] Persistance

I need to persist a few values over resets, and for later calculations. What functions or strategies are the best for these scenarios?

Should ideally be persisted every update (ca 5 sec). Needs to be restored on reset

  • currentMonitor.milliamphour_in
  • currentMonitor.milliamphour_out
  • current SOC for each cell

On change

  • capacity of each cell

For visualisations (best to use SD card i assume):

  • Current, power, shunt voltage etc.

Sign on current when shunt connected

When discharging energy is leaving the batteriy, so one would naturaly expect current to be negative when discharging and positive (no sign) when charging.

Firmware updates erase all settings, except wifi

When I did a firmware update, all settings, battery levels, relay settings, shunt settings where erased. Also influx and mqtt settings where erased.
I selected "Wipe Eeprom = No"

The wifi setting was not erased. I did press save wifi and save configuration before the firmware update

image

Changes to support GenerateBinaryFile.py prevent local build of cell module code

This line in the buildscript_versioning.py causes local code build to halt

env.Append(git_sha_short=git_sha[32:])

Error messages:

TypeError: 'NoneType' object is not subscriptable:
  File "/home/user/.platformio/penv/lib/python3.6/site-packages/platformio/builder/main.py", line 176:
    env.SConscript(item, exports="env")
  File "/home/user/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/user/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/user/Build/diyBMSv4ESP32-master/ATTINYCellModule/buildscript_versioning.py", line 27:
    env.Append(git_sha_short=git_sha[32:])

Note that the errant line only exists if the code is downloaded as a zip. Downloading the repository via Git:clone from within VSCode gives a different buildscript_versioning.py without this line.

RFE: monitor2.json on Serial output (micro USB connector)

Is it possible to let the monitor2.json output also go through the serial connection?
Maybe with a checkbox enable/disable in the GUI.

Then it will be (for example) possible to read this from a device directly connected, not needing WLAN/CANBUS/RS485 .....

Now the output is only
[I][Rules.cpp:133] SetError(): Set error 1
[I][Rules.cpp:133] SetError(): Set error 1

ESP32 reboots when relays are triggered

Following stack trace produced sometimes when a relay is switched on.

Backtrace: 0x40090d6c:0x3ffb1ac0 0x40090fe9:0x3ffb1ae0 0x4008dfb5:0x3ffb1b00 0x4008e0e1:0x3ffb1b30 0x401194e3:0x3ffb1b50 0x40114891:0x3ffb1e10 0x401147ed:0x3ffb1e60 0x40093c99:0x3ffb1e90 0x40092bdd:0x3ffb1ec0 0x40106f45:0x3ffb1ee0 0x40103e61:0x3ffb1f00 0x400f73ae:0x3ffb1f20 0x400e1d9d:0x3ffb1f40 0x401077ad:0x3ffb1fb0 0x40092c5e:0x3ffb1fd0
  #0  0x40090d6c:0x3ffb1ac0 in invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:695
  #1  0x40090fe9:0x3ffb1ae0 in abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:695
  #2  0x4008dfb5:0x3ffb1b00 in lock_acquire_generic at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c:143
  #3  0x4008e0e1:0x3ffb1b30 in _lock_acquire_recursive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/newlib/locks.c:171
  #4  0x401194e3:0x3ffb1b50 in _vfiprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:860 (discriminator 2)
  #5  0x40114891:0x3ffb1e10 in fiprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/fiprintf.c:50
  #6  0x401147ed:0x3ffb1e60 in __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:59 (discriminator 8)
  #7  0x40093c99:0x3ffb1e90 in vPortCPUAcquireMutexIntsDisabledInternal at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:4813
      (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.h:98
      (inlined by) vTaskEnterCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:4201
  #8  0x40092bdd:0x3ffb1ec0 in uxQueueMessagesWaiting at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:2038
  #9  0x40106f45:0x3ffb1ee0 in uartAvailable at C:\users\stuart\.platformio\packages\framework-arduinoespressif32\cores\esp32/esp32-hal-uart.c:464
  #10 0x40103e61:0x3ffb1f00 in HardwareSerial::available() at C:\users\stuart\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.cpp:204
  #11 0x400f73ae:0x3ffb1f20 in SerialEncoder::checkInputStream() at .pio\libdeps\esp32-devkitc-debug\SerialEncoder\src/SerialEncoder.cpp:72
  #12 0x400e1d9d:0x3ffb1f40 in loop() at .pio/libdeps/esp32-devkitc-debug/ArduinoJson/src/ArduinoJson/Numbers/parseNumber.hpp:138
  #13 0x401077ad:0x3ffb1fb0 in loopTask(void*) at C:\users\stuart\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:37
  #14 0x40092c5e:0x3ffb1fd0 in vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)

SOC Rule Addition

Hi
Just wondering if State of Charge Rule could be added now that we have that info available?
Thanks
Jason

Browser language does not make relays work

If you have changed the default language in your browser other than English, in this case Spanish, the relays do not act.

We also find that if the screen resolution is small (ex: 1080x720) the relays do not always act.

Gracias.
Slds.

currentMonitor.timestamp always zero

I tried to use the condition currentMonitor.timestamp == 0 to check if the modbus parsing was in its first iteration. Unfortunately this always holds true as esp_timer_get_time() seems to always return 0.

Controller reboots when downloading (large) files in GUI

Downloading any logged files larger than ~100k results in a hang and reboot of controller.
Small files (readme.txt) downloads correctly.


Platform & Version
Host name:DIYBMS-00312664
Processor: ESP32
Version: 4a507db
Compiled: 2021-07-06T10:45:43.400Z
Language: language
SDK Version:v3.3.5-1-g85c43024c
Min free Heap:85328
Free heap:89320
Heap size:297220


[I][AsyncMqttClient.cpp:429] _handleQueue(): p #[I][AsyncMqttClient.cpp:429] _handleQueue(): p #3 rel
[I][DIYBMSServer.cpp:1504] downloadFile(): Download SDCard file /modbus90_20210903.csv
[I][main.cpp:1659] mqtt2(): Send MQTT Status
[I][AsyncMqttClient.cpp:740] publish(): PUBLISH
[I][AsyncMqttClient.cpp:387] _addBack(): new back #3
[D][main.cpp:2315] rs485_rx(): Rec 83 bytes, id=90
[D][main.cpp:2096] ProcessCurrentMonitorRegisterReply(): Read relay trigger settings 1 252
[I][AsyncMqttClient.cpp:740] publish(): PUBLISH
E (31847) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (31847) task_wdt: - async_tcp (CPU 0/1)
E (31847) task_wdt: Tasks currently running:
E (31847) task_wdt: CPU 0: IDLE0
E (31847) task_wdt: CPU 1: loopTask
E (31847) task_wdt: Aborting.
abort() was called at PC 0x40168e5c on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x40090d8c:0x3ffbfd10 0x40091009:0x3ffbfd30 0x40168e5c:0x3ffbfd50 0x4008f46d:0x3ffbfd70 0x401977ef:0x3ffbca00 0x4016a803:0x3ffbca20 0x400944a5:0x3ffbca40 0x40092cf6:0x3ffbca60

Rebooting...
ets Jun 8 2016 00:22:57

TFT: Add option to disable touch

Using a TFT that does not have touch capability results in the TOUCH event being fired constantly. It would be good to have an option to disable this behavior. Or optionally ignore pressure=4095 to drop the event.

TLS support for MQTT cloud broker

Hello stuart,
Is it possible to add fields in integration to submit a TLS certificate to be used in MQTT data transfer to a cloud broker?
Thanks in advance.

Ability to run in AP Mode?

Hi
I am trying run this without a wifi network available. Can I set this to run as AP Mode and run the normal pages? The code seems to support it but I cannot seem to find a setting anywhere to allow it. It asks to select a wifi network and I cannot skip it?
Thanks for any help.
Jason

add an option form a 300A 50mV Shunt

It would be interesting to have an intermediate option between the 200A and 500A Shunts.
That is why I suggest that the selection of a 300A sunt be considered, which would be an intermediate point

Juntek shunts

Today I installed a diyBMS (esp32) setup in my boat. One controller and 8 battery modules. I already have two Juntek VAT-1050 shunts for measuring currents installed (one on all charge connections and one on all consumption connections). These shunts output their data on RS485 (using a USB connector!) and wireless using an nRF24* clone.

These units are rather cheap (~$30) and are available from all the standard Chinese resellers.

They have some "rules" functionality such as over-current and under-voltage which can trigger a relay. The protocol is largely known.

I was thinking about integrating these shunts in a similar way to the way the diyBMS-shunt is handled. Given that it is a rs485-protocol I was thinking I should re-use much of the code you have written for the diyBMS-shunt. Do you have any pointers?

New feature: SOC on LCD

Just wondering if it is easy to add SOC as a % to display of controller from current monitor. I know you are not aiming for much info on the display but this is a pretty basic one.
Jason

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.