gonzalop / wombatt

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

Decoding issue when connecting tcp and lifepower4 batteries #3

Closed techytrev closed 7 months ago

techytrev commented 7 months ago

qHi,

First off, thank you for creating this project! This is exactly what I've been looking for.

Issue: I have a "PUSR USR-TCP232-304 Serial RS485 to TCP/IP" which I'm pointing wombatt too, to gather information about my EG4 LifePower 4 batteries. The network connection appears to be working, however wombatt is erroring right away with.

error getting info of ID#2: error decoding ascii string '4' error getting info of ID#3: error decoding ascii string '' error getting info of ID#4: error decoding ascii string '4'

I've been trying to troubleshoot but unable to determine why wombatt isn't liking the data it's receiving. I'm running the latest build from a pull today.

Here's the command I'm executing, along with a quick telnet test to confirm, the remote address/port are indeed working. Perhaps my parameters are wrong, but I tried various combo, nothing works so far.

root@sandbox-ubuntu01:/home/git/wombatt/build/linux/amd64# ./wombatt --log-level="debug" battery-info --device-type="tcp" --address="192.168.2.98:6666" --baud-rate=9600 --battery-type="lifepower4" --protocol="auto" --battery-ids=2,3,4 2023/11/28 18:29:54.886670 Opening 192.168.2.98:6666... 2023/11/28 18:29:54.911248 Opening 192.168.2.98:6666... 2023/11/28 18:29:54.936473 Opening 192.168.2.98:6666... 2023/11/28 18:29:54.961757 Opening 192.168.2.98:6666... 2023/11/28 18:29:54.963178 error getting info of ID#2: error decoding ascii string '4' error getting info of ID#3: error decoding ascii string '' error getting info of ID#4: error decoding ascii string '4' root@sandbox-ubuntu01:/home/git/wombatt/build/linux/amd64# telnet 192.168.2.98 6666 Trying 192.168.2.98... Connected to 192.168.2.98. Escape character is '^]'. 5t111111Tu$@4񔕔55111111u$D$AՐ4t1u5T1111Tq$@Ր4tU111111Tp$@Ԑ4tu5T111111t$AԐ4t񔕑u5TQ1Q1Qp$AՐ4tuu5TQq$@Ր4tu5tUt$F֐44񐵔u5T񰔐Pv$F֐44UTq$DА7Q3Q1EQQ5EU51QQQ1QQQQ1QQѹ-Q%UAU!UEQQEQ1AU5AU5AU5AUU!UUUU!UUUQ1EE%EEE$AЖ4tu5111111Tv$@ѐ44u5t111111Tp$@4tє511111t$D$AՐ4t1u5T1111Tu$@Ր4tU111111Tq$@Ԑ4t񑱑u5T111111q$A4tu5TQ1Q1Qt$AՐ4tuu5TQt$@Ր4tu5tUv$F֐4t񐵔u5T񰔐ѕPp$F֐4tUTu$DА4U񱔰Q6p^] telnet> quit Connection closed.

My USR-TCP232-304 config: image image image

Adding more tests, just in case it helps. root@sandbox-ubuntu01:/home/git/wombatt-0.0.3/wombatt-0.0.3/build/linux/amd64# ./wombatt modbus-read --device-type="tcp" --address="192.168.2.98:6666" --baud-rate=9600 --protocol="auto" --id 2 --start 0 --count 38 2023/11/28 21:28:55.255398 Opening 192.168.2.98:6666... 192.168.2.98:6666 ID#2: 00000000 85 24 80 44 b7 94 d0 90 96 34 90 b4 f4 50 51 90 |.$.D.....4...PQ.| 00000010 f1 94 b1 91 b5 91 55 91 94 94 94 94 94 94 94 94 |......U.........| 00000020 94 94 94 94 b4 96 15 95 b4 94 b5 90 95 11 94 91 |................| 00000030 31 96 94 f1 91 94 b1 91 94 31 90 31 91 51 94 31 |1........1.1.Q.1| 00000040 90 31 91 31 91 31 91 31 90 31 91 31 91 31 90 31 |.1.1.1.1.1.1.1.1| 00000050 96 31 91 31 90 31 91 31 96 94 b1 91 b1 91 f1 91 |.1.1.1.1........| 00000060 b1 51 d5 75 a7 84 81 c0 06 84 85 24 80 41 97 94 |.Q.u.......$.A..| 00000070 91 90 96 34 90 b4 f4 51 d1 96 b1 94 b1 91 15 94 |...4...Q........| 00000080 75 94 94 94 94 94 94 94 94 94 94 94 94 94 b4 96 |u...............| 00000090 35 94 94 95 b5 90 95 51 94 95 31 96 94 31 94 94 |5......Q..1..1..| 000000a0 b1 b1 94 31 90 51 94 31 90 31 96 31 90 31 90 31 |...1.Q.1.1.1.1.1| 000000b0 91 51 94 11 94 31 90 31 90 51 94 31 91 11 94 31 |.Q...1.1.Q.1...1| 000000c0 90 31 96 94 b1 91 31 94 b1 91 f1 51 95 74 a7 84 |.1....1....Q.t..| 000000d0 81 c0 06 84 85 24 80 40 97 94 d1 90 96 34 90 b4 |.....$.@.....4..| 000000e0 f4 55 b1 96 b1 91 b1 94 35 95 75 94 94 94 94 94 |.U......5.u.....| 000000f0 94 94 94 94 94 94 94 94 b4 96 35 94 74 90 b5 90 |..........5.t...| 00000100 91 31 91 95 31 95 94 31 94 94 31 b4 94 31 90 31 |.1..1..1..1..1.1| 00000110 96 31 91 31 95 31 96 31 96 31 90 31 90 31 96 31 |.1.1.1.1.1.1.1.1| 00000120 91 31 90 31 95 31 91 31 90 31 91 31 91 94 31 94 |.1.1.1.1.1.1..1.| 00000130 31 94 31 94 31 54 55 74 a7 84 80 c0 06 84 85 24 |1.1.1TUt.......$| 00000140 80 40 97 94 90 90 d6 14 90 b4 b4 55 f1 90 c1 94 |.@.........U....| 00000150 f1 91 15 94 35 94 94 94 94 94 94 94 94 94 94 94 |....5...........| 00000160 94 94 b4 96 35 94 94 95 85 90 94 11 94 90 31 84 |....5.........1.| 00000170 94 f1 81 94 f1 81 94 31 94 51 94 31 90 31 91 21 |.......1.Q.1.1.!| 00000180 91 31 81 31 90 31 90 31 96 31 91 31 96 31 90 31 |.1.1.1.1.1.1.1.1| 00000190 91 31 94 31 90 31 96 94 d1 91 f1 91 b1 91 f1 01 |.1.1.1..........| 000001a0 55 75 a7 84 84 c0 06 84 85 24 a0 44 a7 84 85 c0 |Uu.......$.D....| 000001b0 06 84 85 24 80 41 97 94 d5 90 96 34 90 b4 f4 50 |...$.A.....4...P| 000001c0 b1 94 b1 91 31 91 35 94 75 94 94 94 94 94 94 94 |....1.5.u.......| 000001d0 94 94 94 94 94 94 b4 96 35 94 54 94 b5 90 95 51 |........5.T....Q| 000001e0 95 90 31 90 94 31 94 95 b1 b1 94 31 90 51 94 31 |..1..1.....1.Q.1| 000001f0 91 51 95 51 94 31 90 31 90 31 90 31 90 31 91 31 |.Q.Q.1.1.1.1.1.1| 00000200 91 31 91 31 91 31 90 31 91 51 94 94 31 94 31 94 |.1.1.1.1.Q..1.1.| 00000210 b1 91 31 54 15 70 a7 84 85 c0 06 84 85 24 80 40 |..1T.p.......$.@| 00000220 97 94 d5 90 96 34 90 b4 f4 50 91 91 b1 91 b1 91 |.....4...P......| 00000230 b5 96 55 91 94 94 94 94 94 94 94 94 94 94 94 94 |..U.............| 00000240 b4 96 15 95 b4 95 b5 90 95 51 94 94 31 90 94 31 |.........Q..1..1| 00000250 94 94 b1 b1 94 31 91 31 90 51 94 31 90 31 90 31 |.....1.1.Q.1.1.1| 00000260 91 31 90 31 91 31 90 31 90 31 91 31 90 51 94 31 |.1.1.1.1.1.1.Q.1| 00000270 90 31 90 31 91 94 f1 91 31 94 31 94 31 54 b5 71 |.1.1....1.1.1T.q| 00000280 a7 84 84 c0 06 84 85 24 80 40 97 94 d4 90 d6 34 |.......$.@.....4| 00000290 90 b4 b4 11 f1 91 b1 94 b1 91 15 90 35 94 94 94 |............5...| 000002a0 94 94 94 94 94 94 94 94 94 94 b4 96 35 94 54 95 |............5.T.| 000002b0 b5 90 96 51 94 94 31 91 94 31 94 95 f1 b1 94 31 |...Q..1..1.....1| 000002c0 91 11 94 31 91 11 95 51 94 31 90 51 95 31 90 31 |...1...Q.1.Q.1.1| 000002d0 91 51 94 51 94 51 95 31 90 31 90 31 91 51 94 94 |.Q.Q.Q.1.1.1.Q..| 000002e0 31 94 31 94 31 94 b1 51 95 74 a7 84 84 c0 06 84 |1.1.1..Q.t......| 000002f0 85 24 80 41 97 94 d4 90 96 34 90 b4 94 54 91 95 |.$.A.....4...T..| 00000300 b1 94 b1 91 35 94 75 94 94 94 94 94 94 94 94 94 |....5.u.........| 00000310 94 94 94 94 b4 96 35 94 54 90 b5 90 94 51 96 90 |......5.T....Q..| 00000320 31 95 94 b1 91 94 b1 b1 94 51 94 51 94 51 95 51 |1........Q.Q.Q.Q| 00000330 94 51 94 51 96 51 94 51 94 51 95 51 94 51 95 51 |.Q.Q.Q.Q.Q.Q.Q.Q| 00000340 94 51 94 51 94 31 95 51 94 94 b1 91 b1 91 b1 91 |.Q.Q.1.Q........| 00000350 b1 51 f5 70 a7 84 85 c0 06 84 85 24 80 41 97 94 |.Q.p.......$.A..| 00000360 d5 90 d6 34 90 b4 f4 51 71 94 b1 94 b1 94 f5 91 |...4...Qq.......| 00000370 75 94 94 94 94 94 94 94 94 94 94 94 94 94 b4 96 |u...............| 00000380 35 94 54 91 b5 90 95 51 95 90 31 91 94 b1 94 94 |5.T....Q..1.....| 00000390 b1 b4 94 51 94 31 91 51 94 31 91 51 95 31 91 51 |...Q.1.Q.1.Q.1.Q| 000003a0 95 31 90 51 94 51 95 31 91 31 91 51 94 31 91 51 |.1.Q.Q.1.1.Q.1.Q| 000003b0 95 31 90 94 f1 94 b1 94 b1 94 b1 54 f5 74 a7 84 |.1.........T.t..| 000003c0 85 c0 06 84 85 24 80 40 97 94 d5 90 96 34 90 b4 |.....$.@.....4..| 000003d0 f4 50 b0 91 f1 90 91 95 55 94 75 94 94 94 94 94 |.P......U.u.....| 000003e0 94 94 94 94 94 94 94 94 b4 96 35 90 74 95 b5 90 |..........5.t...| 000003f0 95 51 94 95 31 91 94 91 95 94 91 b5 94 51 94 31 |.Q..1........Q.1| 00000400 90 31 90 31 91 31 91 31 90 31 90 51 94 51 94 51 |.1.1.1.1.1.Q.Q.Q| 00000410 94 51 94 31 91 31 91 51 94 51 94 31 90 94 91 95 |.Q.1.1.Q.Q.1....| 00000420 91 95 91 95 91 55 b5 75 a7 84 86 c0 06 84 95 24 |.....U.u.......$| 00000430 80 46 97 94 d6 90 96 34 90 b4 f4 55 30 90 b1 90 |.F.....4...U0...| 00000440 f1 90 35 91 75 94 94 94 94 94 94 94 94 94 94 94 |..5.u...........| 00000450 94 94 b4 96 35 94 54 96 b5 90 90 51 94 90 31 94 |....5.T....Q..1.| 00000460 94 d1 95 95 f1 b0 94 31 96 31 94 31 91 31 95 31 |.......1.1.1.1.1| 00000470 96 31 90 31 91 31 96 31 91 31 95 51 94 31 96 31 |.1.1.1.1.1.Q.1.1| 00000480 94 51 94 31 94 51 94 94 91 95 91 95 f1 90 f1 50 |.Q.1.Q.........P| 00000490 b5 71 a7 84 86 c0 06 84 85 24 80 46 97 94 d6 90 |.q.......$.F....| 000004a0 96 34 90 b4 b4 54 71 94 91 95 b1 94 35 94 55 91 |.4...Tq.....5.U.| 000004b0 94 94 94 94 94 94 94 94 94 94 94 94 b4 96 15 95 |................| 000004c0 b4 94 b5 90 94 31 90 95 31 95 94 b1 94 94 b1 b4 |.....1..1.......| 000004d0 94 31 94 31 96 31 94 31 94 31 90 31 94 31 96 31 |.1.1.1.1.1.1.1.1| 000004e0 95 31 95 31 96 31 94 31 96 31 96 31 95 31 94 31 |.1.1.1.1.1.1.1.1| 000004f0 94 94 f1 94 f1 94 b1 94 b1 54 35 71 a7 84 80 c0 |.........T5q....| 00000500 06 84 85 24 80 44 97 94 d0 d0 d6 34 90 b4 b4 50 |...$.D.....4...P| 00000510 71 95 f1 94 b1 91 f5 91 55 91 94 94 94 94 94 94 |q.......U.......| 00000520 94 94 94 94 94 94 b4 b6 15 95 b4 94 b5 90 95 51 |...............Q| 00000530 94 91 31 96 94 b1 91 94 b1 b1 94 31 90 31 91 51 |..1........1.1.Q| 00000540 94 31 96 31 91 11 94 31 11 31 90 31 90 31 91 31 |.1.1...1.1.1.1.1| 00000550 91 31 96 31 90 31 91 31 90 31 90 94 b1 91 f1 91 |.1.1.1.1.1......| 00000560 b1 91 b1 51 35 71 a7 84 81 c0 06 84 85 24 80 41 |...Q5q.......$.A| 00000570 97 94 91 90 96 34 90 b4 b4 51 b1 95 b1 94 b1 91 |.....4...Q......| 00000580 35 94 75 94 94 94 94 94 94 94 94 94 94 94 94 94 |5.u.............| 00000590 b4 96 35 94 94 95 b5 90 95 51 95 91 31 95 94 31 |..5......Q..1..1| 000005a0 94 94 b1 b1 94 31 90 31 91 31 91 31 96 31 90 31 |.....1.1.1.1.1.1| 000005b0 90 31 91 11 95 31 91 31 91 31 91 51 94 51 94 31 |.1...1.1.1.Q.Q.1| 000005c0 91 31 90 31 95 94 f1 91 31 94 b1 91 b1 51 75 75 |.1.1....1....Quu| 000005d0 a7 84 81 c0 06 84 85 24 80 40 97 94 d1 90 d6 34 |.......$.@.....4| 000005e0 90 b4 f4 55 d1 90 b1 91 b1 94 35 95 75 94 94 94 |...U......5.u...| 000005f0 94 94 94 94 94 94 94 94 94 94 b4 96 35 94 74 90 |............5.t.| 00000600 b5 90 90 51 94 94 31 95 94 31 94 94 31 b4 94 31 |...Q..1..1..1..1| 00000610 91 31 91 31 90 31 96 31 90 31 95 31 91 31 95 31 |.1.1.1.1.1.1.1.1| 00000620 91 31 91 31 91 31 96 31 91 51 94 31 96 31 90 94 |.1.1.1.1.Q.1.1..| 00000630 31 94 31 94 31 94 31 54 75 76 a7 84 80 c0 ff ff |1.1.1.1Tuv......| 00000640 ff fe a7 84 84 c0 06 84 85 24 a0 44 a7 84 85 c0 |.........$.D....| 00000650 06 84 85 24 80 41 97 94 d5 90 96 34 90 b4 f4 50 |...$.A.....4...P| 00000660 b1 94 b1 91 31 91 35 94 75 94 94 94 94 94 94 94 |....1.5.u.......| 00000670 94 94 94 94 94 94 b4 96 35 94 54 94 b5 90 95 51 |........5.T....Q| 00000680 94 94 31 91 00 00 |..1...|

techytrev commented 7 months ago

FY I - I tried using the 0.0.3 build as well, getting the same issue.

Thanks in advance for your help.

gonzalop commented 7 months ago

Someone else made that device or a similar one (his screenshot shows 'RS232' and 'RS485' in the left menu) and his configuration was like this:

TSP232-304-config

The device with the above configuration looks like this:

619v5umsDxL _AC_SL1100_

It is odd that when connecting with telnet you immediately receive data back. When the client connects to the TCP port of the device, there should be no data written back to the client until the client sends a command.

I also think that you should set '--protocol=lifepower4', and I should improve the 'auto' behavior to choose that when the battery type is set to lifepower4.

techytrev commented 7 months ago

Someone else made that device or a similar one (his screenshot shows 'RS232' and 'RS485' in the left menu) and his configuration was like this:

TSP232-304-config

The device with the above configuration looks like this:

619v5umsDxL AC_SL1100

It is odd that when connecting with telnet you immediately receive data back. When the client connects to the TCP port of the device, there should be no data written back to the client until the client sends a command.

I also think that you should set '--protocol=lifepower4', and I should improve the 'auto' behavior to choose that when the battery type is set to lifepower4.

Thank you for this info. I actually saw the DIY Solar Forum post where the individual specifically mentioned this device, this is why I got it. I do see that his unit is using an older firmware (v3015) and mine is newer (v4018) . Perhaps this is the difference in the GUI menu. We seem to have the same RS485 settings enabled. The device does state, RS485, so I take it at face value, this is the protocol it's using. https://www.amazon.ca/dp/B09DCT1YDR

The Telnet obervation is a good one. I did have other devices in chain with my LifePower4 batteries at the time, perhaps this was related. I've since reduced all testing to a single battery, with no other devices interconnected (see my next comment for more details).

techytrev commented 7 months ago

Thanks for getting back. Below, you'll see my testing (still not working), however I wanted to give background on what I'm trying to do and whether Wombatt will be able to support it (now or future).

########## Current Setup ########## What I'm trying to do.

Currently, I have 12x LifePower4 batteries (address 2 to 13), all updated to firmware 3.26 (7/14/2023). This is important as this is the firmware which added new baud rate support, for the EG4 Hub (needed for closed loop with Sol-Ark). EG4 updated the LifePower4 batteries to communicate at baud 9600bps on Pin 1&2 (default), and at baud 19200bps on Pin 7&8(new). EG4 hub communicates with LifePower4 batteries on pin 7&8, setting itself as Master at address 0. My LifePower4 batteries currently are addressed from 2-13. This all works, no problem.

Now, I also, simultanously monitor the LifePower4 batteries, with Solar Assistant using Pin 1&2, at baud 9600bps. This also works. The Hub and SA, do not conflict, as they're using different pinout & baud rates. This has been working for months, so far, no issues.

I plan on getting some more LifePower4 batteries and want to replace SA with this Wombatt application, for LifePower4 monitoring. As it offers the full set of sensors/stats of the LifePower4, not just a subset. I hope this is possible, but, regardless of my master plan, I'm still not sure why a single battery is not working, over the TCP serial option.

Ok, now on with my testing so far.

########## Current Setup ##########

##################### TESTING ################################

I've gone ahead and tried it with the --protocol=lifepower4, but still getting same issue.

I've reduced my testing to a singular battery, to rule out any outside factors.

-Using your pre-built docker image, to rule out any outside binary/conflicts with my sandbox testing. -Testing on a single Lifepower4 (firmware 3.26), not connected to other devices/batteries/hubs. -Using pin 1&2 (baud 9600). -I tried 3 different battery addresses 0, 1 and 2. I set the battery address each time, and also updated the wombatt config, to match the battery id. ie address 0 | battery id 0, address 1 | battery id 1 etc.

Results below. It would seem, that perhaps the wombatt application is expecting only to communicate with a device on address 0 (is this customizable?) to get battery info. As when I try another address like 1 & 2, it times out after the initial request. Put it back to 0, and I get back the repeating of "error decoding ascii string ; ; "

With Single Battery Address Pinout Set 0000

version: "3" services: wombatt1: image: gonzalomono/wombatt:latest privileged: true restart: unless-stopped command:

2023/12/03 14:22:45.890320 Opening 192.168.2.98:6666... 2023/12/03 14:22:45.913096 Opening 192.168.2.98:6666... 2023/12/03 14:22:45.916359 error getting info of ID#0: error decoding ascii string '�' 2023/12/03 14:22:46.421588 Opening 192.168.2.98:6666... 2023/12/03 14:22:46.452049 Opening 192.168.2.98:6666... 2023/12/03 14:22:46.453109 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 14:22:46.995723 Opening 192.168.2.98:6666... 2023/12/03 14:22:47.027020 Opening 192.168.2.98:6666... 2023/12/03 14:22:47.028275 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 14:22:47.734954 Opening 192.168.2.98:6666... 2023/12/03 14:22:47.759968 Opening 192.168.2.98:6666... 2023/12/03 14:22:47.761161 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 14:22:48.813332 Opening 192.168.2.98:6666... 2023/12/03 14:22:48.834646 Opening 192.168.2.98:6666... 2023/12/03 14:22:48.835667 error getting info of ID#0: error decoding ascii string '4�' 2023/12/03 14:22:50.727782 Opening 192.168.2.98:6666... 2023/12/03 14:22:50.749417 Opening 192.168.2.98:6666... 2023/12/03 14:22:50.750365 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 14:22:54.243981 Opening 192.168.2.98:6666... 2023/12/03 14:22:54.279951 Opening 192.168.2.98:6666... 2023/12/03 14:22:54.280923 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 14:23:00.992890 Opening 192.168.2.98:6666... 2023/12/03 14:23:01.015597 Opening 192.168.2.98:6666... 2023/12/03 14:23:01.016862 error getting info of ID#0: error decoding ascii string '�'

With Single Battery Address Pinout Set 1000

version: "3" services: wombatt1: image: gonzalomono/wombatt:latest privileged: true restart: unless-stopped command:

2023/12/03 14:21:28.078086 Opening 192.168.2.98:6666... 2023/12/03 14:21:28.104398 Opening 192.168.2.98:6666... 2023/12/03 14:21:28.105375 error getting info of ID#1: error decoding ascii string 'T�' 2023/12/03 14:21:28.612015 Opening 192.168.2.98:6666... 2023/12/03 14:21:29.118077 Opening 192.168.2.98:6666... 2023/12/03 14:21:29.120701 error getting info of ID#1: timed out 2023/12/03 14:21:29.668874 Opening 192.168.2.98:6666... 2023/12/03 14:21:30.175109 Opening 192.168.2.98:6666... 2023/12/03 14:21:30.176486 error getting info of ID#1: timed out 2023/12/03 14:21:30.861132 Opening 192.168.2.98:6666... 2023/12/03 14:21:31.369765 Opening 192.168.2.98:6666... 2023/12/03 14:21:31.378536 error getting info of ID#1: timed out 2023/12/03 14:21:32.439098 Opening 192.168.2.98:6666... 2023/12/03 14:21:32.940888 Opening 192.168.2.98:6666... 2023/12/03 14:21:32.946609 error getting info of ID#1: timed out 2023/12/03 14:21:34.824733 Opening 192.168.2.98:6666... 2023/12/03 14:21:35.331063 Opening 192.168.2.98:6666... 2023/12/03 14:21:35.332514 error getting info of ID#1: timed out 2023/12/03 14:21:38.835170 Opening 192.168.2.98:6666... 2023/12/03 14:21:39.337078 Opening 192.168.2.98:6666... 2023/12/03 14:21:39.338450 error getting info of ID#1: timed out

With Single Battery Address Pinout Set 0100

version: "3" services: wombatt1: image: gonzalomono/wombatt:latest privileged: true restart: unless-stopped command:

2023/12/03 14:20:15.802262 Opening 192.168.2.98:6666... 2023/12/03 14:20:15.803255 error getting info of ID#2: error decoding ascii string 'T�' 2023/12/03 14:20:16.426951 Opening 192.168.2.98:6666... 2023/12/03 14:20:16.936331 Opening 192.168.2.98:6666... 2023/12/03 14:20:16.938809 error getting info of ID#2: timed out 2023/12/03 14:20:17.413959 Opening 192.168.2.98:6666... 2023/12/03 14:20:17.919376 Opening 192.168.2.98:6666... 2023/12/03 14:20:17.920729 error getting info of ID#2: timed out 2023/12/03 14:20:18.606770 Opening 192.168.2.98:6666... 2023/12/03 14:20:19.111785 Opening 192.168.2.98:6666... 2023/12/03 14:20:19.113211 error getting info of ID#2: timed out 2023/12/03 14:20:20.173813 Opening 192.168.2.98:6666... 2023/12/03 14:20:20.675602 Opening 192.168.2.98:6666... 2023/12/03 14:20:20.680866 error getting info of ID#2: timed out 2023/12/03 14:20:22.536631 Opening 192.168.2.98:6666... 2023/12/03 14:20:23.038216 Opening 192.168.2.98:6666... 2023/12/03 14:20:23.039494 error getting info of ID#2: timed out 2023/12/03 14:20:26.493229 Opening 192.168.2.98:6666... 2023/12/03 14:20:27.001145 Opening 192.168.2.98:6666... 2023/12/03 14:20:27.002561 error getting info of ID#2: timed out 2023/12/03 14:20:33.661856 Opening 192.168.2.98:6666... 2023/12/03 14:20:34.164581 Opening 192.168.2.98:6666... 2023/12/03 14:20:34.166080 error getting info of ID#2: timed out

##################### TESTING ################################

gonzalop commented 7 months ago

wombatt will query the battery IDs provided in the command line. A time out means that either the port wasn't open or there was not a long enough response or a response at all.

I've uploaded a new image that can be retrieved with 'docker pull gonzalomono/wombatt:debug' with the commits from the 'debug' branch I just created. Could try it out and report back? Also, perhaps increase the default read time from 500ms to 2s ("-t 2s").

TIA

techytrev commented 7 months ago

Thanks @gonzalop. I deployed the new image with your debug branch and the 2s timeout. Here's the output of the log *attached and inline. I let it go for a minute or so. Pulling from a single battery with 0 address. Please let me know if you'd like me to do anything else or require more info.

Config: wombatt2: image: gonzalomono/wombatt:debug privileged: true restart: unless-stopped command:

2023/12/03 23:07:32.612301 Opening 192.168.2.98:6666... 2023/12/03 23:07:32.615175 Connected to 192.168.2.98:6666... 2023/12/03 23:07:32.615249 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:32.637571 got header hex: 9076949554b0719784d6903694 ascii: �v��T�q��֐6� 2023/12/03 23:07:32.637620 Opening 192.168.2.98:6666... 2023/12/03 23:07:32.657961 Connected to 192.168.2.98:6666... 2023/12/03 23:07:32.658004 error getting info of ID#0: error decoding ascii string '��' 2023/12/03 23:07:33.405771 Opening 192.168.2.98:6666... 2023/12/03 23:07:33.412833 Connected to 192.168.2.98:6666... 2023/12/03 23:07:33.412857 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:33.441799 got header hex: 9036849554b051979486907694 ascii: �6��T�Q����v� 2023/12/03 23:07:33.441952 Opening 192.168.2.98:6666... 2023/12/03 23:07:33.445098 Connected to 192.168.2.98:6666... 2023/12/03 23:07:33.445134 error getting info of ID#0: error decoding ascii string '��' 2023/12/03 23:07:33.926034 Opening 192.168.2.98:6666... 2023/12/03 23:07:33.930939 Connected to 192.168.2.98:6666... 2023/12/03 23:07:33.930967 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:34.152592 got header hex: b784d69036948554b070b784d6 ascii: ��֐6��T�p��� 2023/12/03 23:07:34.152662 Opening 192.168.2.98:6666... 2023/12/03 23:07:34.153680 Connected to 192.168.2.98:6666... 2023/12/03 23:07:34.153690 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 23:07:34.917430 Opening 192.168.2.98:6666... 2023/12/03 23:07:34.918229 Connected to 192.168.2.98:6666... 2023/12/03 23:07:34.918256 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:34.938093 got header hex: 9794d1d0069495149041a794d0 ascii: �������A��� 2023/12/03 23:07:34.938164 Opening 192.168.2.98:6666... 2023/12/03 23:07:34.939203 Connected to 192.168.2.98:6666... 2023/12/03 23:07:34.939218 error getting info of ID#0: error decoding ascii string '�' 2023/12/03 23:07:35.994170 Opening 192.168.2.98:6666... 2023/12/03 23:07:35.995019 Connected to 192.168.2.98:6666... 2023/12/03 23:07:35.995047 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:36.015077 got header hex: 979494c07694952490749794d5 ascii: ����v��$�t��� 2023/12/03 23:07:36.015135 Opening 192.168.2.98:6666... 2023/12/03 23:07:36.016242 Connected to 192.168.2.98:6666... 2023/12/03 23:07:36.016249 error getting info of ID#0: error decoding ascii string '$�' 2023/12/03 23:07:37.863427 Opening 192.168.2.98:6666... 2023/12/03 23:07:37.869642 Connected to 192.168.2.98:6666... 2023/12/03 23:07:37.869673 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:37.896960 got header hex: b794d49036948554b070979495 ascii: ��Ԑ6��T�p��� 2023/12/03 23:07:37.897019 Opening 192.168.2.98:6666... 2023/12/03 23:07:37.898027 Connected to 192.168.2.98:6666... 2023/12/03 23:07:37.898033 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 23:07:41.348557 Opening 192.168.2.98:6666... 2023/12/03 23:07:41.350689 Connected to 192.168.2.98:6666... 2023/12/03 23:07:41.350712 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:41.371583 got header hex: 979494c0769495349074979495 ascii: ����v��4�t��� 2023/12/03 23:07:41.371715 Opening 192.168.2.98:6666... 2023/12/03 23:07:41.372706 Connected to 192.168.2.98:6666... 2023/12/03 23:07:41.372730 error getting info of ID#0: error decoding ascii string '4�' 2023/12/03 23:07:48.001814 Opening 192.168.2.98:6666... 2023/12/03 23:07:48.007714 Connected to 192.168.2.98:6666... 2023/12/03 23:07:48.007741 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:07:48.029908 got header hex: 979495d076949554b0719794d6 ascii: ����v��T�q��� 2023/12/03 23:07:48.030057 Opening 192.168.2.98:6666... 2023/12/03 23:07:48.031060 Connected to 192.168.2.98:6666... 2023/12/03 23:07:48.031082 error getting info of ID#0: error decoding ascii string 'T�' 2023/12/03 23:08:01.117533 Opening 192.168.2.98:6666... 2023/12/03 23:08:01.118617 Connected to 192.168.2.98:6666... 2023/12/03 23:08:01.118684 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:08:01.140770 got header hex: 9794d5d006949514a074979495 ascii: �������t��� 2023/12/03 23:08:01.140924 Opening 192.168.2.98:6666... 2023/12/03 23:08:01.144046 Connected to 192.168.2.98:6666... 2023/12/03 23:08:01.144083 error getting info of ID#0: error decoding ascii string '�' 2023/12/03 23:08:26.997430 Opening 192.168.2.98:6666... 2023/12/03 23:08:27.000018 Connected to 192.168.2.98:6666... 2023/12/03 23:08:27.000042 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:08:27.022107 got header hex: b784d59076949534b071979496 ascii: ��Րv��4�q��� 2023/12/03 23:08:27.022233 Opening 192.168.2.98:6666... 2023/12/03 23:08:27.025379 Connected to 192.168.2.98:6666... 2023/12/03 23:08:27.025403 error getting info of ID#0: error decoding ascii string '4�' 2023/12/03 23:09:18.462005 Opening 192.168.2.98:6666... 2023/12/03 23:09:18.462803 Connected to 192.168.2.98:6666... 2023/12/03 23:09:18.462828 writing request 42 hex: 7e323030303441343230303030464441330d ascii: ~20004A420000FDA3 2023/12/03 23:09:18.484775 got header hex: 9036948554b0719794d5d01684 ascii: �6��T�q����� 2023/12/03 23:09:18.484930 Opening 192.168.2.98:6666... 2023/12/03 23:09:18.488078 Connected to 192.168.2.98:6666... 2023/12/03 23:09:18.488104 error getting info of ID#0: error decoding ascii string '��'

_solar-wombatt2-1_logs.txt

gonzalop commented 7 months ago

I'm at a loss here. The response data is supposed to start with a '~' but that's not what we're seeing. The only thing I can think of is changing the baud rate to 19200 (-B 19200). Can you send pictures of how the connections looks like for the ethernet and RS485 wires?

Otherwise, I've asked the person who helped testing the lifepower4 batteries to take a look and see if he can help. Let's give him some time to get my message and see if he's available.

The way I would debug this if I had a lifepower4 would be to attach a computer to both the the RS485 of one or all the batteries and the inverter or device that you use that behaves correctly. I would use the 'forward' command that just sends data back and forth from 2 devices and prints the hex-encoded data

techytrev commented 7 months ago

@gonzalop - Thank you for your support on the issue. I found the issue, it was a bad crimp/pinout problem. Your higher baud rate test, returned results, which meant I had the wrong pinout! (FAIL). Upon review, I mistakenly crimped to 7&8, not 1&2. I re-crimped to 1&2, and used baud 9600, now it's working properly. Thanks again for all your help. I can't wait to use Wombatt moving forward.

`Battery #0

alarm flag: 0x10 cell 1 voltage: 3.28V cell 2 voltage: 3.281V cell 3 voltage: 3.281V cell 4 voltage: 3.28V cell 5 voltage: 3.281V cell 6 voltage: 3.281V cell 7 voltage: 3.28V cell 8 voltage: 3.281V cell 9 voltage: 3.281V cell 10 voltage: 3.282V cell 11 voltage: 3.281V cell 12 voltage: 3.28V cell 13 voltage: 3.28V cell 14 voltage: 3.281V cell 15 voltage: 3.28V cell 16 voltage: 3.28V cell temp 1: 297.1°K cell temp 2: 297.1°K cell temp 3: 297.1°K cell temp 4: 297.1°K environment temp: 296.1°K mosfet temp: 296.1°K pack current: -2.5A pack voltage: 52.49V remaining capacity:: 47.91Ah full capacity:: 99.2Ah cycle counts: 247 user defined: 15 soh: 48% soc: 99% max cell voltage: 3.282V min cell voltage: 3.28V diff cell voltage: 0.002V max cell temp: 297.1°K min cell temp: 297.1°K cumulative charging capacity: 19942.87A cumulative discharge capacity: 19798.31A cumulative charging power: 1073.52kWh cumulative discharge power: 1042.769kWh cumulative charging time: 2035h cumulative discharge time: 2390h cumulative charging times: 32216h cumulative discharge times: 43266h alarm flag: 0x10 cell 1 alarm status: 0 cell 2 alarm status: 0 cell 3 alarm status: 0 cell 4 alarm status: 0 cell 5 alarm status: 0 cell 6 alarm status: 0 cell 7 alarm status: 0 cell 8 alarm status: 0 cell 9 alarm status: 0 cell 10 alarm status: 0 cell 11 alarm status: 0 cell 12 alarm status: 0 cell 13 alarm status: 0 cell 14 alarm status: 0 cell 15 alarm status: 0 cell 16 alarm status: 0 cell temp 1: 0 cell temp 2: 0 cell temp 3: 0 cell temp 4: 0 environment temp alarm status: 0 mosfet temp alarm status: 0 pack current alarm status: 0 pack voltage alarm status: 0 user defined: 9 balance event code: 0 voltage event code: 0 temperature event code: 0 current event code: 0 current event code: 0 fet status code: charge MOS, discharge MOS system status code: discharging balance status code: 0`

gonzalop commented 7 months ago

That's great news! I made the same mistake when crimping and that's how I found out that either pins 1-2 or 7-8 return the same data for the EG4LLv2 :).

Thanks a lot and let me know if there's any missing feature that you would like wombatt to provice.