Closed MuellerM1996 closed 1 year ago
Thanks, I will fix this is the next days
Could you please test https://github.com/mr-manuel/venus-os_dbus-serialbattery/releases/tag/v1.0.20230927beta?
root@raspberrypi2:~# tail -F /data/log/dbus-serialbattery.ttyUSB5/current | tai64nlocal 2023-09-27 08:35:12.921423500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds 2023-09-27 08:35:12.921846500 INFO:SerialBattery:Testing Jkbms 2023-09-27 08:35:13.042058500 ERROR:SerialBattery:Unexpected err=UnicodeDecodeError('utf-8', b'\xff\xff\xff\xff', 0, 1, 'invalid start byte'), type(err)=<class 'UnicodeDecodeError'> 2023-09-27 08:35:13.543388500 INFO:SerialBattery:-- Testing BMS: 2 of 3 rounds 2023-09-27 08:35:13.543821500 INFO:SerialBattery:Testing Jkbms 2023-09-27 08:35:13.594388500 ERROR:SerialBattery:Unexpected err=UnicodeDecodeError('utf-8', b'\xff\xff\xff\xff', 0, 1, 'invalid start byte'), type(err)=<class 'UnicodeDecodeError'> 2023-09-27 08:35:14.095854500 INFO:SerialBattery:-- Testing BMS: 3 of 3 rounds 2023-09-27 08:35:14.096441500 INFO:SerialBattery:Testing Jkbms 2023-09-27 08:35:14.145442500 ERROR:SerialBattery:Unexpected err=UnicodeDecodeError('utf-8', b'\xff\xff\xff\xff', 0, 1, 'invalid start byte'), type(err)=<class 'UnicodeDecodeError'> 2023-09-27 08:35:14.646753500 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB5
Still the same error.
But if I change the except UnicodeEncodeError to a except UnicodeDecodeError it's working.
Damn. I rebuild it with the correct exception :-)
Describe the bug
My JK BMS has an empty Manufacturing Date (see screenshot). Since Driver version v1.0.20230531 this gets read from the BMS but the BMS just return 0xFF which can't be interpret.
Error from the log: 2023-09-26 17:27:23.208204500 INFO:SerialBattery:Testing Jkbms 2023-09-26 17:27:23.325547500 ERROR:SerialBattery:Unexpected err=UnicodeDecodeError('utf-8', b'\xff\xff\xff\xff', 0, 1, 'invalid start byte'), type(err)=<class 'UnicodeDecodeError'>
After some experimenting with old commits I found out that the missing Manufacturing Date lead to this error. I comment this out in the jkbms.py line 174 to 178 (on version v1.0.20230531) and everything works as expected.
How to reproduce
Only possible if you have a JK BMS without Manufacturing Date written to the End of Line data. If you connect this you will get the error descript in the log.
Expected behavior
In case the Manufacturing Date is not available, ignore it (leave it on None)
Driver version
v1.0.20230531
Venus OS device type
Raspberry Pi
Venus OS version
3.10
BMS type
JKBMS / Heltec BMS
Cell count
16
Connection type
Serial USB adapter to RS485
Config file
Relevant log output
Any other information that may be helpful
No response