Closed beliffm closed 11 months ago
I also have the same issue (identical logs) on all four of my LltJbd
BMS with the latest in dev
branch (#763) from July 27. However, using the latest tagged release (#757) from July 23 works fine.
Thanks for pointing me in the right direction. I mistook the latest dev-version with the prerelese in the master branch. This is working for me too.
And there we go.....
It is looking at /dev/ttyUSB1 Whats connected to /dev/ttyUSB0
I have two identical BMSes connected to the GX, one via USB0 the other via USB1. Both logs were also identical.
Can confirm that the latest JBD changes broke something
2023-08-03 08:06:43.921188500 #2
2023-08-03 08:06:43.921190500 #3
2023-08-03 08:06:43.921191500 #0
2023-08-03 08:06:43.921192500 #1
2023-08-03 08:06:43.921193500 #2
2023-08-03 08:06:43.921195500 #3
2023-08-03 08:06:43.921196500 #0
2023-08-03 08:06:43.921197500 #1
2023-08-03 08:06:43.921199500 #2
2023-08-03 08:06:43.921200500 #3
2023-08-03 08:07:18.148439500 INFO:SerialBattery:
2023-08-03 08:07:18.149973500 INFO:SerialBattery:Starting dbus-serialbattery
2023-08-03 08:07:18.151511500 INFO:SerialBattery:dbus-serialbattery v1.0.20230723dev
2023-08-03 08:07:18.152720500 INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
2023-08-03 08:07:18.153915500 INFO:SerialBattery:Testing LltJbd
2023-08-03 08:07:19.393235500 INFO:SerialBattery:-- Testing BMS: 2 of 3 rounds
2023-08-03 08:07:19.393244500 INFO:SerialBattery:Testing LltJbd
2023-08-03 08:07:20.501858500 INFO:SerialBattery:-- Testing BMS: 3 of 3 rounds
2023-08-03 08:07:20.501864500 INFO:SerialBattery:Testing LltJbd
2023-08-03 08:07:21.790061500 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB3/
2023-08-03 08:07:21.790213500 #0
2023-08-03 08:07:21.790215500 #1
2023-08-03 08:07:21.790217500 #2
2023-08-03 08:07:21.790218500 #3
2023-08-03 08:07:21.790219500 #0
2023-08-03 08:07:21.790220500 #1
2023-08-03 08:07:21.790222500 #2
2023-08-03 08:07:21.790223500 #3
2023-08-03 08:07:21.790224500 #0
2023-08-03 08:07:21.790226500 #1
2023-08-03 08:07:21.790227500 #2
2023-08-03 08:07:21.790228500 #3
@idstein can you take a look?
I don’t have access to those JBD BMS versions. I need to implement more verbose logging.
@iLeeeZi @optio50 @proptied can you post which BMS model your are using from JBD and the firmware version?
I have a JBD-SP04S034 4S 200A, need to check the firmware later
My JBD BMS SP22S003B (16S) also does not work with Version 1.0x . It is not detected any longer. It works fine with Version 0.14.3 . Is is recognized as hardware version "SP25S003-L16S-100A-B-U-R" by the old driver.
What have been changed to the initialization of the driver that it no longer works? Why have it been changed anyway?
This is how 0.14.3 detectes my JBD:
@4000000064d6542e115e5b94 INFO:SerialBattery:Starting dbus-serialbattery
@4000000064d6542e1162ef74 INFO:SerialBattery:dbus-serialbattery v0.13
@4000000064d6542e1183e8dc INFO:SerialBattery:Testing LltJbd
@4000000064d6542e19959d2c INFO:SerialBattery:Connection established to LltJbd
@4000000064d6542e199b4a4c INFO:SerialBattery:Battery connected to dbus from /dev/ttyUSB0
@4000000064d6542e199ff1b4 INFO:SerialBattery:=== Settings ===
@4000000064d6542e19a51dec INFO:SerialBattery:> Connection voltage NoneV | current NoneA | SOC None%
@4000000064d6542e19ab28cc INFO:SerialBattery:> Cell count None | cells populated 0
@4000000064d6542e19b02624 INFO:SerialBattery:> CCL Charge NoneA | DCL Discharge NoneA
@4000000064d6542e19c3c97c INFO:SerialBattery:> MIN_CELL_VOLTAGE 2.9V | MAX_CELL_VOLTAGE 3.45V
@4000000064d6542e1d885744 INFO:SerialBattery:DeviceInstance = 1
@4000000064d6542e1d8d29a4 INFO:SerialBattery:com.victronenergy.battery.ttyUSB0
With 1.0.X it is not detected anymore:
@4000000064d650ce1034cfb4 INFO:SerialBattery:Testing HeltecModbus
@4000000064d650ce2f3f5c1c WARNING:SerialBattery:Error reading settings from BMS, retry (1/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650cf0c8256d4 WARNING:SerialBattery:Error reading settings from BMS, retry (2/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650cf25656ed4 WARNING:SerialBattery:Error reading settings from BMS, retry (3/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d002fdec2c WARNING:SerialBattery:Error reading settings from BMS, retry (4/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d01be958fc WARNING:SerialBattery:Error reading settings from BMS, retry (5/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d034bfbefc WARNING:SerialBattery:Error reading settings from BMS, retry (6/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d11268362c WARNING:SerialBattery:Error reading settings from BMS, retry (7/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d12b4e0d4c WARNING:SerialBattery:Error reading settings from BMS, retry (8/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d2088b281c WARNING:SerialBattery:Error reading settings from BMS, retry (9/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01�
@4000000064d650d222339f74 WARNING:SerialBattery:Error reading settings from BMS, retry (10/10): Wrong functioncode: 1 instead of 3. The response is: '\x01\x01
@4000000064d650d222382f6c INFO:SerialBattery:Testing HLPdataBMS4S
@4000000064d650d705de01ac ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d705e2570c INFO:SerialBattery:Testing Jkbms
@4000000064d650d7161e5c74 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d7167415c4 INFO:SerialBattery:Testing Lifepower
@4000000064d650d727327e14 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d7278b2564 INFO:SerialBattery:Testing LltJbd
@4000000064d650d73825e0e4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d7389db894 INFO:SerialBattery:Testing Renogy
@4000000064d650d80d30f20c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d80d84f1f4 INFO:SerialBattery:Testing Renogy
@4000000064d650d81e1243dc ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650d81e5fb7fc INFO:SerialBattery:Testing Seplos
@4000000064d650d91f5dbf3c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650da01a07f0c INFO:SerialBattery:Testing Daly
@4000000064d650da0ae20c84 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650da0ae6a834 INFO:SerialBattery:Testing Daly
@4000000064d650da1324044c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000064d650da1328bf3c INFO:SerialBattery:Testing Ecs
@4000000064d650da152fa32c ERROR:SerialBattery:>>> ERROR: No reply - returning
I have a JBD Version JBD-SP04S020A-L4S-100A-B-U nightly dev build 1.0.20230723dev It seems to be working without issue.
v1.0.20230724beta seems to have an issue with connecting to BMS via Serial. Working on a new BMS driver for EG4-LL (12v 400 AH Rev1)(using Revov as a base, but BMS communications is different then Revov / or what is bundled in LifePower.py ). Works fine in release [v1.0.20230531] on OS 3.00 or 2.94, however when the Dbus-serialbattery is updated to v1.0.20230724beta it is suddenly unable to communicate to the ttyUSB0 (or actually is seeming like it is unable to view that this tty device is even connected. Removing this version, and stepping down to DBus-SerialBattery v1.0.20230531 fixes this issue. Have not been unable to track down in code the case of this error yet.
@beliffm @iLeeeZi @wherzig can anyone with the problem contact me on Discord? This would help me to find relevant informations.
I got this logs from the system of @iLeeeZi. There seems to be a bug (?) in dbus-fast additionally. I tried downgrading and then the connection worked again. @idstein the strange thing is, that this does not seem to happen with the JKBMS_Ble driver.
2023-09-04 17:54:15.746142500 INFO:SerialBattery:
2023-09-04 17:54:15.746659500 INFO:SerialBattery:Starting dbus-serialbattery
2023-09-04 17:54:15.747858500 INFO:SerialBattery:dbus-serialbattery v1.0.20230902dev
2023-09-04 17:54:16.115121500 INFO:SerialBattery:Init of LltJbd_Ble at E0:9F:2A:xx:xx:xx
2023-09-04 17:54:16.115755500 INFO:SerialBattery:Test of LltJbd_Ble at E0:9F:2A:xx:xx:xx
2023-09-04 17:54:21.127748500 --- Logging error ---
2023-09-04 17:54:21.127753500 Traceback (most recent call last):
2023-09-04 17:54:21.127756500 File "/opt/victronenergy/dbus-serialbattery/bms/lltjbd_ble.py", line 55, in bt_main_loop
2023-09-04 17:54:21.127761500 self.device = await BleakScanner.find_device_by_address(
2023-09-04 17:54:21.127765500 File "/usr/lib/python3.8/site-packages/bleak/__init__.py", line 310, in find_device_by_address
2023-09-04 17:54:21.127771500 return await cls.find_device_by_filter(
2023-09-04 17:54:21.127774500 File "/usr/lib/python3.8/site-packages/bleak/__init__.py", line 369, in find_device_by_filter
2023-09-04 17:54:21.127881500 async with cls(detection_callback=apply_filter, **kwargs):
2023-09-04 17:54:21.127885500 File "/usr/lib/python3.8/site-packages/bleak/__init__.py", line 139, in __init__
2023-09-04 17:54:21.127890500 get_platform_scanner_backend_type() if backend is None else backend
2023-09-04 17:54:21.127894500 File "/usr/lib/python3.8/site-packages/bleak/backends/scanner.py", line 253, in get_platform_scanner_backend_type
2023-09-04 17:54:21.127988500 from bleak.backends.bluezdbus.scanner import BleakScannerBlueZDBus
2023-09-04 17:54:21.127993500 File "/usr/lib/python3.8/site-packages/bleak/backends/bluezdbus/scanner.py", line 6, in <module>
2023-09-04 17:54:21.127998500 from dbus_fast import Variant
2023-09-04 17:54:21.128001500 File "/usr/lib/python3.8/site-packages/dbus_fast/__init__.py", line 1, in <module>
2023-09-04 17:54:21.128070500 from . import aio, glib, introspection, message_bus, proxy_object, service
2023-09-04 17:54:21.128075500 File "/usr/lib/python3.8/site-packages/dbus_fast/aio/__init__.py", line 1, in <module>
2023-09-04 17:54:21.128080500 from .message_bus import MessageBus
2023-09-04 17:54:21.128083500 File "/usr/lib/python3.8/site-packages/dbus_fast/aio/message_bus.py", line 9, in <module>
2023-09-04 17:54:21.128110500 from .. import introspection as intr
2023-09-04 17:54:21.128113500 File "/usr/lib/python3.8/site-packages/dbus_fast/introspection.py", line 5, in <module>
2023-09-04 17:54:21.128118500 from .errors import InvalidIntrospectionError
2023-09-04 17:54:21.128121500 File "/usr/lib/python3.8/site-packages/dbus_fast/errors.py", line 57, in <module>
2023-09-04 17:54:21.128126500 from .message import Message
2023-09-04 17:54:21.128179500 File "src/dbus_fast/message.py", line 1, in init dbus_fast.message
2023-09-04 17:54:21.128184500 ValueError: dbus_fast._private.marshaller.Marshaller size changed, may indicate binary incompatibility. Expected 24 from C header, got 20 from PyObject
2023-09-04 17:54:21.128192500
2023-09-04 17:54:21.128193500 During handling of the above exception, another exception occurred:
2023-09-04 17:54:21.128197500
2023-09-04 17:54:21.128198500 Traceback (most recent call last):
2023-09-04 17:54:21.128223500 File "/usr/lib/python3.8/logging/__init__.py", line 1085, in emit
2023-09-04 17:54:21.128268500 msg = self.format(record)
2023-09-04 17:54:21.128270500 File "/usr/lib/python3.8/logging/__init__.py", line 929, in format
2023-09-04 17:54:21.128274500 return fmt.format(record)
2023-09-04 17:54:21.128277500 File "/usr/lib/python3.8/logging/__init__.py", line 668, in format
2023-09-04 17:54:21.128281500 record.message = record.getMessage()
2023-09-04 17:54:21.128369500 File "/usr/lib/python3.8/logging/__init__.py", line 373, in getMessage
2023-09-04 17:54:21.128399500 msg = msg % self.args
2023-09-04 17:54:21.128402500 TypeError: not all arguments converted during string formatting
2023-09-04 17:54:21.128406500 Call stack:
2023-09-04 17:54:21.128408500 File "/usr/lib/python3.8/threading.py", line 890, in _bootstrap
2023-09-04 17:54:21.128431500 self._bootstrap_inner()
2023-09-04 17:54:21.128433500 File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
2023-09-04 17:54:21.128460500 self.run()
2023-09-04 17:54:21.128462500 File "/usr/lib/python3.8/threading.py", line 870, in run
2023-09-04 17:54:21.128466500 self._target(*self._args, **self._kwargs)
2023-09-04 17:54:21.128469500 File "/opt/victronenergy/dbus-serialbattery/bms/lltjbd_ble.py", line 80, in background_loop
2023-09-04 17:54:21.128474500 asyncio.run(self.bt_main_loop())
2023-09-04 17:54:21.128477500 File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
2023-09-04 17:54:21.128502500 return loop.run_until_complete(main)
2023-09-04 17:54:21.128505500 File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
2023-09-04 17:54:21.128557500 self.run_forever()
2023-09-04 17:54:21.128559500 File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
2023-09-04 17:54:21.128563500 self._run_once()
2023-09-04 17:54:21.128565500 File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
2023-09-04 17:54:21.128570500 handle._run()
2023-09-04 17:54:21.128572500 File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
2023-09-04 17:54:21.128597500 self._context.run(self._callback, *self._args)
2023-09-04 17:54:21.128601500 File "/opt/victronenergy/dbus-serialbattery/bms/lltjbd_ble.py", line 59, in bt_main_loop
2023-09-04 17:54:21.128606500 logger.error(">>> ERROR: Bluetooth stack failed.", e)
2023-09-04 17:54:21.128610500 Message: '>>> ERROR: Bluetooth stack failed.'
2023-09-04 17:54:21.128613500 Arguments: (ValueError('dbus_fast._private.marshaller.Marshaller size changed, may indicate binary incompatibility. Expected 24 from C header, got 20 from PyObject'),)
2023-09-04 17:54:21.128697500 ERROR:SerialBattery:>>> ERROR: Unable to connect with BLE device
2023-09-04 17:54:21.130092500 ERROR:SerialBattery:No BMS found at E0:9F:2A:xx:xx:xx
2023-09-04 17:54:21.130567500 ERROR:SerialBattery:ERROR >>> No battery connection at LltJbd_Ble
2023-09-04 17:54:21.391216500
2023-09-04 17:54:21.391515500 INFO:Bluetooth details
2023-09-04 17:54:21.447466500 Device E0:9F:2A:xx:xx:xx not available
2023-09-04 17:54:26.512120500 Device E0:9F:2A:xx:xx:xx not available
Please try to install the nightly
from the dev
branch. I just pushed some changes.
got a build running off of the changes you just made. Seems to be running, will check back in a few days to see if the drive is able to remain stable running.
@tuxntoast were you able to check the logs? Can you give me a short update?
@beliffm @iLeeeZi @wherzig can anyone with the problem contact me on Discord? This would help me to find relevant informations.
Sorry, I can not help to get additional information at this time. I have changed back to 0.14.3 . This works very well.
In about two weeks: I will remove my old JBD-BMS and replace it with a new JK BMS (has additional features like a display and 1A active balancer). At the changing date, I can try the new version before the swap with my JBD BMS and give feedback.
Yes sorry. Your changes have been stable for me. Had no issues with the usb serial not being found. Sent from my iPhoneOn Sep 12, 2023, at 2:52 AM, Manuel @.***> wrote: @tuxntoast were you able to check the logs? Can you give me a short update?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Sorry you guys, i did not have the time to look further into the matter until just now. Still no dice with v1.0.20230905dev. After install the driver loops without finding either of my two BMSes. So i reverted to v1.0.20230531 and the BMSes were found again instantly. Ich will attach the log files to this message. Both BMSes are attached via DC-isolated serial adapters. There is another issue with my installation that i allready mentioned earlier. After some minutes the serial connection is lost independantly on both BMSes but they are reconnected at once. My guess is, that my version of the LLtJbd utilizes a somewhat different message scheme and that might lead to loss of synchronisation. But that is just a guess.
Again, appologies for reacting so late.
In this case we have to wait for this https://github.com/Louisvdw/dbus-serialbattery/issues/730#issuecomment-1712522694
@idstein @mr-manuel I found the cause of my problem. It is because of PR #760, and differences in jbd bms firmwares. There is two settings in jbd for battery capacity, total capacity and cycle capacity. For me total capacity is 272ah and cycle capacity 217,6ah so 80% of total capacity (I usually set cycle capacity to 272ah but for some reason the bms resets it sometimes back to 217,6ah).
It seems that some bms versions use cycle capacity to calculate the soc internally, but mine uses total capacity. After that PR the driver can show soc values over 100%, so in my case if bms has 100% soc then the driver shows it as 125%. In current state the driver fails to start if its calculated soc is over 100%.
Maybe the easiest way to detect which capacity the bms uses for soc, is to use the soc from bms when driver connects and after that test if it matches to soc calculated from cycle capacity, or soc calculated from total capacity
@iLeeeZi can you try to change
to
if not self.cycle_capacity or self.cycle_capacity < capacity_remain:
Changing line 555 did the trick for me. Both BMSs connected immediatedly after reboot.
@beliffm thats for your feedback. I merged the fix.
Describe the problem
I updated to the latest dev-Version and rebooted the GX. It never established the serial connection again. After returning to the latest Version of the master branch it worked instantly again.
I tried the dev-Version because i have intermittent drops of the serial connection with my two BMSes. They are both V2 LLT/JBD. This is a different issue though.
Driver version
1.0.20230723dev
Venus OS device type
GX Card (integrated in Victron device)
Venus OS version
V3.01
BMS type
Smart BMS (LLT, JBD, Overkill Solar)
Cell count
16
Connection type
Serial USB adapter to TTL
Config file
Relevant log output
Any other information that may be helpful
The BMSes are Version 2 LLT ones The have only one external temperature sensor and two internal ones. The sensor counting is different to the Version 3 BMSes, so the driver shows the FET temperature as battery temperature.