Closed tdeckers closed 1 year ago
Hi. I've got no problems. See my version (at the end of this post). Try to use an other rs485-USB-Converter ... it seems like, that a standard python function is crashing, not the serial-battery-driver, as you can see in your log:
@4000000063661e4032832cdc File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 467, in in_waiting
@4000000063661e4032833894 s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
Which python Version do you have?
root@einstein:~# python -V
Python 3.8.13
Thanks @WaldemarFech. I'll give that a try. Which adapter are you using?
Most issues come from loose connections or wires that does not make good contact. So check those. The adapters based on FTDI or CH340 both work well. Some cheaper adapters could give issues (oven on those chips) so swopping it out for an alternative manytimes solves it as well.
Having the same problem. Using 3 JK BMS with 3 USB TTL Azdelivery adapters. Everything is exactly the same for all three packs/banks. But one of them is disconnecting some minutes after staring Venus OS. It is still visible via Bluetooth and everything but the connection works perfect. Very strange!
Which adapter are you using?
I had some of these flying around.
But one of them is disconnecting some minutes after staring Venus OS.
Try to change over cross the USB-Converter between one, that is working fine. if the disconnects travel to the new battery, then it's the hardware. when it's still at the same battery: change ttl/rs485 converter between the batteries.
i'm curious, so keep us updated :D
Which adapter are you using?
I had some of these flying around.
But one of them is disconnecting some minutes after staring Venus OS.
Try to change over cross the USB-Converter between one, that is working fine. if the disconnects travel to the new battery, then it's the hardware. when it's still at the same battery: change ttl/rs485 converter between the batteries.
i'm curious, so keep us updated :D
Thank You! That is a very good idea :) Will try tomorrow and keep you informed about the results!
If it is not the converter it would be most likely a connection that is not making good contact. Swopping the converter adapters means you will be redoing the wire connections on both which many times fix the issue 😀
If it is not the converter it would be most likely a connection that is not making good contact. Swopping the converter adapters means you will be redoing the wire connections on both which many times fix the issue 😀
yes, if there would be no problem anymore, then it was the bad connect. but if it still disconnects, then it should be possible possible to locate the faulty device :)
Before beeing able to check again on the cabeling I discovered something else. The dropouts only happen, when one of my JK BMS is selected as my Battery Monitor in Venus OS. As soon as I select Multiplus as the Battery Monitor Instance there will be no more dropouts. I tested this 3 times now (see Grafana graphs). Unfortunately Multiplus is less accurate for the calculation of SOC somehow it seems. Will check my cabeling nevertheless as soon as possible!
Suggestion:
Use tail like this:
tail -f /data/log/dbus-serialbattery.ttyUSB0/current | tai64nlocal
with | tai64nlocal
to get a readable timestamp to compare better with grafana etc.
I have also problems with that disconnection. With no no there seems to be no issues. Now i connected the multiplus to the grid to and the battery is used to compensate grid usage.
I use this adapter with the jkbms https://www.amazon.de/DSD-TECH-SH-U09C3-Isolierter-Adapter/dp/B07TS3GPQ1
2022-12-29 15:59:25.961458500 INFO:SerialBattery:Testing Jkbms 2022-12-29 15:59:26.107946500 INFO:SerialBattery:Connection established to Jkbms 2022-12-29 15:59:26.108714500 INFO:SerialBattery:Battery connected to dbus from /dev/ttyUSB0 2022-12-29 15:59:26.109208500 INFO:SerialBattery:=== Settings === 2022-12-29 15:59:26.109822500 INFO:SerialBattery:> Connection voltage 53.18V | current -0.0A | SOC 71% 2022-12-29 15:59:26.110292500 INFO:SerialBattery:> Cell count 16 | cells populated 0 2022-12-29 15:59:26.110857500 INFO:SerialBattery:> CCL Charge NoneA | DCL Discharge NoneA 2022-12-29 15:59:26.111380500 INFO:SerialBattery:> MIN_CELL_VOLTAGE 2.9V | MAX_CELL_VOLTAGE 3.45V 2022-12-29 15:59:26.175296500 INFO:SerialBattery:DeviceInstance = 1 2022-12-29 15:59:26.176087500 INFO:SerialBattery:com.victronenergy.battery.ttyUSB0 2022-12-29 15:59:30.288303500 Traceback (most recent call last): 2022-12-29 15:59:30.288317500 File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 163, in publish_battery 2022-12-29 15:59:30.288320500 success = self.battery.refresh_data() 2022-12-29 15:59:30.288323500 File "/opt/victronenergy/dbus-serialbattery/jkbms.py", line 53, in refresh_data 2022-12-29 15:59:30.288327500 result = self.read_status_data() 2022-12-29 15:59:30.288329500 File "/opt/victronenergy/dbus-serialbattery/jkbms.py", line 66, in read_status_data 2022-12-29 15:59:30.288544500 status_data = self.read_serial_data_jkbms(self.command_status) 2022-12-29 15:59:30.288550500 File "/opt/victronenergy/dbus-serialbattery/jkbms.py", line 150, in read_serial_data_jkbms 2022-12-29 15:59:30.288555500 data = read_serial_data(command, self.port, self.baud_rate, self.LENGTH_POS, self.LENGTH_CHECK,None, self.LENGTH_SIZE) 2022-12-29 15:59:30.288559500 File "/opt/victronenergy/dbus-serialbattery/utils.py", line 84, in read_serial_data 2022-12-29 15:59:30.288595500 return read_serialport_data(ser, command, length_pos, length_check, length_fixed, length_size) 2022-12-29 15:59:30.288599500 File "/opt/victronenergy/dbus-serialbattery/utils.py", line 125, in read_serialport_data 2022-12-29 15:59:30.288603500 toread = ser.inWaiting() 2022-12-29 15:59:30.288604500 File "/usr/lib/python3.8/site-packages/serial/serialutil.py", line 590, in inWaiting 2022-12-29 15:59:30.288661500 return self.in_waiting 2022-12-29 15:59:30.288663500 File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 467, in in_waiting 2022-12-29 15:59:30.288667500 s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str) 2022-12-29 15:59:30.288669500 OSError: [Errno 5] Input/output error 2022-12-29 15:59:30.495420500 /opt/victronenergy/serial-starter/run-service.sh: line 15: kill: (28768) - No such process 2022-12-29 15:59:57.714235500 INFO:SerialBattery:Starting dbus-serialbattery
I just tested further. With no load, when the multiplus is in charger Mode (switch in Pos II) there are no issues. Celle voltages are readable an volating.
Does the issue still persist?
Describe the bug JK-B2A20S20P initially connects fine after a restart of Venus OS. I can see it working briefly, but after a short time, it fails with following error in the logs:
To Reproduce Install dbus-serial as documented. After a short while JKBMS just disconnects and the Multiplus II goes in passthrough.
Expected behavior Expect the BMS monitor to continue operating.
Screenshots See log above.
VenusOS (please complete the following information):
Battery/BMS (please complete the following information):
Additional context Add any other context about the problem here.