-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JK-BMS driver crashes if no Manufacturing Date is given #823
Comments
Thanks, I will fix this is the next days |
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 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
The text was updated successfully, but these errors were encountered: