gonzalop / wombatt

A tool for monitoring batteries and inverters.
MIT License
12 stars 2 forks source link

EG4LLv2 - Error messages #14

Closed mcheavens closed 1 month ago

mcheavens commented 1 month ago

I will add some other comments as needed, but here goes what I am seeing right now. Ubuntu 22.04 LTS Headless server. I am a NOOB to go, but got go running with paths set etc. no problem. When trying to run make I got error messages. Ran make to cross compile and it worked just fine and ended up with all the binaries.

I get invalid data and/or crc errors depending upon what command I am running. Here is what I am running and the errors I see. Any help would be appreciated.

HTML output looks like maybe some of the issue are character set issue. I am a USA user.

(command from shell script file)


./monitor1.sh
Get the battery-info
Command: wombatt battery-info -l debug -p /dev/ttyUSB0 -i 1
time=2024-06-03T12:56:13.614-05:00 level=DEBUG msg="reading into struct" data=000000000000000000000000000000000000000000000000000000000000000000000000000000210000006415b200000019000027100000020e000000020000000015e00000271000000d930d7d struct-type=*bms.EG4ModbusBatteryInfo
time=2024-06-03T12:56:13.667-05:00 level=INFO msg="error getting extra info of ID#1: invalid crc: got 0, want 965d"

Finished getting battery-info

Read modbus...

Command: wombatt modbus-read -p /dev/ttyUSB0 --id 1 --start 0 --count 43
/dev/ttyUSB0 ID#1:
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 21  00 00 00 64 15 b2 00 00  |.......!...d....|
00000030  00 19 00 00 27 10 00 00  02 0e 00 00 00 02 00 00  |....'...........|
00000040  00 00 15 e0 00 00 27 10  00 00 0d 93 0d 7d 00 01  |......'......}..|
00000050  00 01 00 10 00 00                                 |......|

Finished getting modbus-read

Run monitor-batteries

Command: wombatt monitor-batteries -l debug -w :8000 -p /dev/ttyUSB0 --battery-id 1 --bms-type=EG4LLv2
Listening on [::]:8000
time=2024-06-03T12:56:13.802-05:00 level=INFO msg="fetching info from batteries" battery-id=[1]
time=2024-06-03T12:56:13.902-05:00 level=DEBUG msg="reading into struct" data=000000000000000000000000000000000000000000000000000000000000000000000000000000210000006415b200000019000027100000020e000000020000000015e00000271000000d920d7e struct-type=*bms.EG4ModbusBatteryInfo
time=2024-06-03T12:56:13.902-05:00 level=INFO msg="published info for batteries" battery-id=[1]
time=2024-06-03T12:56:23.908-05:00 level=INFO msg="fetching info from batteries" battery-id=[1]
time=2024-06-03T12:56:23.963-05:00 level=INFO msg="published info for batteries" battery-id=[]
time=2024-06-03T12:56:33.972-05:00 level=INFO msg="fetching info from batteries" battery-id=[1]
time=2024-06-03T12:56:33.982-05:00 level=INFO msg="published info for batteries" battery-id=[]
^C

HTML web output:

avg_temp: 0°C
battery_voltage: 0V
cap_remaining: 100%
cell_10_voltage: 0V
cell_11_voltage: 0V
cell_12_voltage: 0V
cell_13_voltage: 0V
cell_14_voltage: 0V
cell_15_voltage: 0V
cell_16_voltage: 0V
cell_1_voltage: 0V
cell_2_voltage: 0V
cell_3_voltage: 0V
cell_4_voltage: 0V
cell_5_voltage: 0V
cell_6_voltage: 0V
cell_7_voltage: 0V
cell_8_voltage: 0V
cell_9_voltage: 0V
cell_balance_status: cell 12 unbalanced, cell 11 unbalanced, cell 9 unbalanced, cell 7 unbalanced, cell 6 unbalanced, cell 5 unbalanced, cell 4 unbalanced, cell 3 unbalanced, cell 2 unbalanced
cell_num: 0
current: 0A
cycle_counts: 2
designed_capacity: 347.4Ah
error_code: 0x0200, 0x0008, current flow error, temperature error
full_capacity: 0mAh
last_updated: 2024-06-03T12:56:13.903460648-05:00
max_cell_voltage: 0V
max_charging_current: 5554A
max_temp: 33°C
mean_cell_voltage: 0V
median_cell_voltage: 0V
min_cell_voltage: 0V
pcb_temp: 0°C
protection: 0
soc: 25%
soh: 0%
status: inactive/stand by
temp1: 21°C
temp2: -32°C
temp3: 0°C
temp4: 0°C
temp5: 39
temp6: 16
warning: float stopped, charge under temp, discharge over temp, charge over temp, charge overcurrent
gonzalop commented 1 month ago

First, make sure the RS485 wires are not reversed.

You mention cross-compiling. What's the host OS and the target? Does 'make test' complete successfully?

The output is UTF8, so setting your LANG environment variable to "en_US.UTF-8" would make what you paste look as intended.

mcheavens commented 1 month ago

Host OS: Ubuntu 22.04 (Debian)

make test

Makefile:38: *** "No goimport in $PATH, please run 'make install-tools'. Stop.

However,

make -f Makefile.release release

works properly and compiles for all versions.

make install-tools does not solve: make install-tools test -x "" || go install golang.org/x/tools/cmd/goimports@latest go: downloading golang.org/x/tools v0.22.0 go: downloading golang.org/x/mod v0.18.0 test -x "" || go install github.com/axw/gocov/gocov@latest test -x "" || go install github.com/AlekSi/gocov-xml@latest test -x "" || go install gotest.tools/gotestsum@latest test -x "" || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 [root@AGL-T6-Ubuntu-01 /go/wombatt] # make test Makefile:38: *** "No goimport in $PATH, please run 'make install-tools'. Stop.

My language in the OS is set to en_US.UFT-8, I don't see a LANG variable when running wombatt:

locale

LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=

Swapped wires, zero communication.

gonzalop commented 1 month ago

Oh! Battery ID #1! That one doesn't have the same data as the others. ID#1 is the one supposed to communicate with the inverters and provides different data than the rest. See https://diysolarforum.com/threads/eg4-6500-modbus.54210/page-2#post-837069 and subsequent posts.

Try with a battery whose ID is not 1 and wombatt shoould work as is.

mcheavens commented 1 month ago

AH! Changed the battery ID to 2, reconfigured and all looks much better!

Thank you, Thank you!!!!!

Minor issue is the LANG issue, but I really don't care about that.

Here is the output now. (Oh, and I still see the CRC error on battery-info.)

avg_temp: 25°C battery_voltage: 56.18V cap_remaining: 100% cell_10_voltage: 3.491V cell_11_voltage: 3.514V cell_12_voltage: 3.515V cell_13_voltage: 3.514V cell_14_voltage: 3.515V cell_15_voltage: 3.511V cell_16_voltage: 3.506V cell_1_voltage: 3.512V cell_2_voltage: 3.513V cell_3_voltage: 3.513V cell_4_voltage: 3.515V cell_5_voltage: 3.514V cell_6_voltage: 3.513V cell_7_voltage: 3.512V cell_8_voltage: 3.515V cell_9_voltage: 3.514V cell_balance_status: 0 cell_num: 16 current: 0A cycle_counts: 2 designed_capacity: 100Ah error_code: 0 full_capacity: 100000mAh last_updated: 2024-06-05T20:32:20.788428084-05:00 max_cell_voltage: 3.515V max_charging_current: 100A max_temp: 25°C mean_cell_voltage: 3.511V median_cell_voltage: 3.513V min_cell_voltage: 3.491V pcb_temp: 26°C protection: low capacity soc: 100% soh: 100% status: inactive/stand by temp1: 25°C temp2: 24°C temp3: 24°C temp4: 24°C temp5: 0 temp6: 0 warning: 0

gonzalop commented 1 month ago

AH! Changed the battery ID to 2, reconfigured and all looks much better!

Great!

  • How would one check battery 1 if you had multiple in a chain? I only have one battery in each of my installs, they are used for high capacity UPS systems.

This is a good question. The easiest way is to not use the EG4 battery type in the inverter and set the parameters according to the manual under the 'USE' battery type., i.e., relay on voltage to charge the batteries.

If you keep the EG4 battery type in the inverters or for some reason need to keep a ID#1 battery, there is no way that I know of to get all the same information that the other batteries report. Per cell information is available in ID#1, and some values can be derived, like charging/discharging current, but other registers don't seem to be available. Also, since Modbus is supposed to only have 1 master and the inverter queries the battery 1 every 500 ms, that's the time we would have to query it using modbus in between requests/responses. It can be done but I'm not sure it's worth it.

Thank you, Thank you!!!!!

Minor issue is the LANG issue, but I really don't care about that.

The text encoding issue is fixed in https://github.com/gonzalop/wombatt/commit/503eadaa03cf868bc3ba1c9190315041f941d61e

Thanks!

Here is the output now. (Oh, and I still see the CRC error on battery-info.)

I'll check if I see any CRC error with battery info tomorrow first thing.

[...]

gonzalop commented 1 month ago

I don't see any CRC errors in battery-info:

$ ./wombatt battery-info -p rs485-bridge:502 -i 2 -T tcp
Battery #2
===========
battery voltage: 53.88V
current: 5.7A
cell 1 voltage: 3.367V
cell 2 voltage: 3.369V
cell 3 voltage: 3.367V
cell 4 voltage: 3.368V
cell 5 voltage: 3.368V
cell 6 voltage: 3.368V
cell 7 voltage: 3.367V
cell 8 voltage: 3.368V
cell 9 voltage: 3.367V
cell 10 voltage: 3.368V
cell 11 voltage: 3.368V
cell 12 voltage: 3.368V
cell 13 voltage: 3.368V
cell 14 voltage: 3.369V
cell 15 voltage: 3.367V
cell 16 voltage: 3.368V
pcb temp: 29°C
max temp: 30°C
avg temp: 28°C
cap remaining: 79%
max charging current: 100A
soh: 100%
soc: 79%
status: inactive/charging
warning: 0
protection: 0
error code: 0
cycle counts: 12
full capacity: 100000mAh
temp1: 28°C
temp2: 28°C
temp3: 28°C
temp4: 28°C
temp5: 0
temp6: 0
cell num: 16
designed capacity: 100Ah
cell balance status: 0
max cell voltage: 3.369V
min cell voltage: 3.367V
mean cell voltage: 3.367V
median cell voltage: 3.368V
model: LFP-51.2V100Ah-V1.0
firmware version: Z02T04
serial: 2022-10-26
mcheavens commented 1 month ago

I installed .8 which I see has localization changes.