RS485 component for pulling battery telemetry

I’ve successfully integrated my 10 X 48v 100ah Ruixu server rack batteries pulling full cell-level telemetry using ESPHome and modifying some existing repos.

https://github.com/chicagoandy/esphome-ruixu-bms/blob/9d32664e2db92c20b5ec121a9fe485c8098aaa7f/esp32-s3-ruixu-48100-multiple-example.yaml

However, I do need some help with some stability challenges.

I am seeing errors int the logfile :
15:17:48][W][component:237]: Component seplos_modbus took a long time for an operation (413 ms).
[15:17:48][W][component:238]: Components should block for at most 30 ms.

I’m not sure I can do much about this?

But my bigger concern is crashes.
This integration pulls metrics for 10 batteries. I’ve offset the timing of each pull via the “update_interval” , a technique suggested by some other repos, including the one I forked… Intervial is set to roughly every 5 seconds, and I’ve offset the seconds so most updates won’t run at the same time.

I am getting crashes about every 20 minutes with “Reset Reason” set to: “Software Reset CPU”.

Guessing the crashes are related to the shrinking Heap Block

image

I’m also guessing the issue is the amount of data I’m trying to return, but that really is just a SWAG.

I’m not seeing a lot of help in the logs.

[16:15:06][V][sensor:043]: 'batt 4 temperature mosfet': Received new state 19.900000
[16:15:06][D][sensor:094]: 'batt 4 temperature mosfet': Sending state 19.90000 °C with 0 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 current': Received new state -8.260000
[16:15:06][D][sensor:094]: 'batt 4 current': Sending state -8.26000 A with 2 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 voltage total': Received new state 52.029999
[16:15:06][D][sensor:094]: 'batt 4 voltage total': Sending state 52.03000 V with 2 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 power net': Received new state -429.767792
[16:15:06][D][sensor:094]: 'batt 4 power net': Sending state -0.42977 kW with 3 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 daily energy net': Received new state -0.149865
[16:15:06][D][sensor:094]: 'batt 4 daily energy net': Sending state -0.14986 kWh with 2 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 power in': Received new state 0.000000
[16:15:06][D][sensor:094]: 'batt 4 power in': Sending state 0.00000 kW with 3 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 daily energy in': Received new state 0.000000
[16:15:06][D][sensor:094]: 'batt 4 daily energy in': Sending state 0.00000 kWh with 2 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 power out': Received new state 429.767792
[16:15:06][D][sensor:094]: 'batt 4 power out': Sending state 0.42977 kW with 3 decimals of accuracy
[16:15:06][V][sensor:043]: 'batt 4 daily energy out': Received new state 0.149868
[16:15:06][D][sensor:094]: 'batt 4 daily energy out': Sending state 0.14987 kWh with 2 decimals of accuracy
WARNING ruixu-battery-monitor @ 192.168.86.75: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for ruixu-battery-monitor @ 192.168.86.75
WARNING Disconnected from API
INFO Successfully connected to ruixu-battery-monitor @ 192.168.86.75 in 0.004s
INFO Successful handshake with ruixu-battery-monitor @ 192.168.86.75 in 0.057s


[16:15:47][W][seplos_modbus:113]: CRC check failed! 0xDB52 != 0xE16A



[16:15:49][I][seplos_bms:030]: Telemetry frame (70 bytes) received
[16:15:49][V][seplos_bms:048]: Command group: 5
[16:15:49][V][seplos_bms:052]: Number of cells: 16
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 1': Received new state 3.252000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 1': Sending state 3.25300 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 2': Received new state 3.251000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 2': Sending state 3.25100 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 3': Received new state 3.252000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 3': Sending state 3.25200 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 4': Received new state 3.250000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 4': Sending state 3.25000 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 5': Received new state 3.249000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 5': Sending state 3.24900 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 6': Received new state 3.252000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 6': Sending state 3.25200 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 7': Received new state 3.254000
[16:15:49][D][sensor:094]: 'batt 5 voltage cell 7': Sending state 3.25400 V with 3 decimals of accuracy
[16:15:49][V][sensor:043]: 'batt 5 voltage cell 8': Received new state 3.251000

Can anyone point to good practices for managing memory on ESP32 S3?

Also, can anyone suggest tips on resolving this?