Skip to content
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

LLT/JBD - No battery connection driver version greater v1.0.20230723dev #769

Closed
beliffm opened this issue Jul 30, 2023 · 26 comments
Closed
Labels
question Further information is requested support Support request

Comments

@beliffm
Copy link

beliffm commented Jul 30, 2023

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

[DEFAULT]

; If you want to add custom values/settings, then check the values/settings you want to change in "config.default.ini"
; and insert them below to persist future driver updates.

; Example (remove the semicolon ";" to uncomment and activate the value/setting):
MAX_BATTERY_CHARGE_CURRENT = 120.0
MAX_BATTERY_DISCHARGE_CURRENT = 150.0
BMS_TYPE = LltJbd

Relevant log output

@4000000064c62d040d64564c #1
@4000000064c62d040db6fe74 #2
@4000000064c62d040db719cc #3
@4000000064c62d040db7219c #4
@4000000064c62d040db72584 #5
@4000000064c62d040db7296c #6
@4000000064c62d040db72d54 #7
@4000000064c62d040db7313c #8
@4000000064c62d040db73524 #9
@4000000064c62d040db7390c #10
@4000000064c62d040db73cf4 #11
@4000000064c62d040db740dc #12
@4000000064c62d040db744c4 #13
@4000000064c62d040db748ac #14
@4000000064c62d040db74c94 #15
@4000000064c62d040db7507c #0
@4000000064c62d040db75464 #1
@4000000064c62d040db7584c #2
@4000000064c62d040dba61a4 #3
@4000000064c62d040dba658c #4
@4000000064c62d040dba6974 #5
@4000000064c62d040dba6d5c #6
@4000000064c62d040dba7144 #7
@4000000064c62d040dba752c #8
@4000000064c62d040dba7914 #9
@4000000064c62d040dba7cfc #10
@4000000064c62d040dba80e4 #11
@4000000064c62d040dba84cc #12
@4000000064c62d040dba88b4 #13
@4000000064c62d040dba8c9c #14
@4000000064c62d040dba9084 #15
@4000000064c62d27210934ec INFO:SerialBattery:
@4000000064c62d272117bf94 INFO:SerialBattery:Starting dbus-serialbattery
@4000000064c62d27212e9f0c INFO:SerialBattery:dbus-serialbattery v1.0.20230723dev
@4000000064c62d27213ad40c INFO:SerialBattery:-- Testing BMS: 1 of 3 rounds
@4000000064c62d2721453064 INFO:SerialBattery:Testing LltJbd
@4000000064c62d28301cac5c INFO:SerialBattery:-- Testing BMS: 2 of 3 rounds
@4000000064c62d283024842c INFO:SerialBattery:Testing LltJbd
@4000000064c62d2a015c4634 INFO:SerialBattery:-- Testing BMS: 3 of 3 rounds
@4000000064c62d2a0164c9e4 INFO:SerialBattery:Testing LltJbd
@4000000064c62d2b0fe67134 ERROR:SerialBattery:ERROR >>> No battery connection at /dev/ttyUSB1
@4000000064c62d2b0fe9f3a4 #0
@4000000064c62d2b0fe9ff5c #1
@4000000064c62d2b0fea0344 #2
@4000000064c62d2b0fea072c #3
@4000000064c62d2b0fea0b14 #4
@4000000064c62d2b0fea0efc #5
@4000000064c62d2b0fea12e4 #6
@4000000064c62d2b0fea16cc #7
@4000000064c62d2b0fea1ab4 #8
@4000000064c62d2b0fea1ab4 #9

This is repeating endlessly

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.

@beliffm beliffm added the support Support request label Jul 30, 2023
@beliffm beliffm changed the title No connection zo batteries with v1.0.20230724beta No connection to batteries with v1.0.20230724beta Jul 30, 2023
@proptied
Copy link

proptied commented Jul 30, 2023

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.

@beliffm
Copy link
Author

beliffm commented Jul 30, 2023

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.

@beliffm beliffm changed the title No connection to batteries with v1.0.20230724beta No connection to batteries with v1.0.20230723dev Jul 30, 2023
@beliffm
Copy link
Author

beliffm commented Jul 30, 2023

And there we go.....

@beliffm beliffm closed this as completed Jul 30, 2023
@mr-manuel mr-manuel reopened this Jul 31, 2023
@optio50
Copy link

optio50 commented Jul 31, 2023

It is looking at /dev/ttyUSB1
Whats connected to /dev/ttyUSB0

@beliffm
Copy link
Author

beliffm commented Aug 1, 2023

I have two identical BMSes connected to the GX, one via USB0 the other via USB1. Both logs were also identical.

@iLeeeZi
Copy link

iLeeeZi commented Aug 3, 2023

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

@mr-manuel mr-manuel changed the title No connection to batteries with v1.0.20230723dev LLT/JBD - No battery connection driver version greater v1.0.20230723dev Aug 3, 2023
@mr-manuel
Copy link
Collaborator

@idstein can you take a look?

@idstein
Copy link
Contributor

idstein commented Aug 3, 2023

I don’t have access to those JBD BMS versions. I need to implement more verbose logging.

@idstein
Copy link
Contributor

idstein commented Aug 7, 2023

@iLeeeZi @optio50 @proptied can you post which BMS model your are using from JBD and the firmware version?

@iLeeeZi
Copy link

iLeeeZi commented Aug 8, 2023

I have a JBD-SP04S034 4S 200A, need to check the firmware later

@wherzig
Copy link

wherzig commented Aug 11, 2023

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  

@optio50
Copy link

optio50 commented Aug 14, 2023

I have a JBD Version JBD-SP04S020A-L4S-100A-B-U
nightly dev build 1.0.20230723dev
It seems to be working without issue.

@tuxntoast
Copy link

tuxntoast commented Aug 14, 2023

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.

@mr-manuel mr-manuel added the help wanted Extra attention is needed label Sep 4, 2023
@mr-manuel mr-manuel assigned mr-manuel and idstein and unassigned mr-manuel Sep 4, 2023
@mr-manuel
Copy link
Collaborator

@beliffm @iLeeeZi @wherzig can anyone with the problem contact me on Discord? This would help me to find relevant informations.

@mr-manuel
Copy link
Collaborator

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

mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this issue Sep 4, 2023
@mr-manuel
Copy link
Collaborator

Please try to install the nightly from the dev branch. I just pushed some changes.

mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this issue Sep 5, 2023
@mr-manuel mr-manuel assigned mr-manuel and unassigned idstein Sep 5, 2023
@tuxntoast
Copy link

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.

@mr-manuel
Copy link
Collaborator

@tuxntoast were you able to check the logs? Can you give me a short update?

@wherzig
Copy link

wherzig commented Sep 12, 2023

@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.

@tuxntoast
Copy link

tuxntoast commented Sep 12, 2023 via email

@beliffm
Copy link
Author

beliffm commented Sep 12, 2023

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.

masterUSB1.log
devUSB2.log
masterUSB2.log
devUSB1.log

@mr-manuel mr-manuel reopened this Sep 12, 2023
@mr-manuel mr-manuel assigned idstein and unassigned mr-manuel Sep 12, 2023
@mr-manuel
Copy link
Collaborator

In this case we have to wait for this #730 (comment)

@iLeeeZi
Copy link

iLeeeZi commented Sep 15, 2023

@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

@mr-manuel
Copy link
Collaborator

@iLeeeZi can you try to change

if not self.cycle_capacity:

to

        if not self.cycle_capacity or self.cycle_capacity < capacity_remain:

mr-manuel added a commit to mr-manuel/venus-os_dbus-serialbattery that referenced this issue Sep 21, 2023
@mr-manuel mr-manuel added question Further information is requested and removed help wanted Extra attention is needed labels Sep 22, 2023
@beliffm
Copy link
Author

beliffm commented Sep 25, 2023

Changing line 555 did the trick for me. Both BMSs connected immediatedly after reboot.

@mr-manuel mr-manuel mentioned this issue Sep 25, 2023
mr-manuel added a commit that referenced this issue Sep 25, 2023
@mr-manuel
Copy link
Collaborator

@beliffm thats for your feedback. I merged the fix.

Louisvdw pushed a commit that referenced this issue Nov 25, 2023
* Update reinstall-local.sh: Fixed charge current parameter

Update reinstall-local.sh: Corrected charge current parameter for  initial config.ini

* Exclude devices from driver startup
This prevents blocking the serial port

* implement callback function for update

* fix comments to reflect new logic

* update changelog

* set soc=100% when charge mode changes to float, apply exponential smoothing on current readout

* remove scan for devices

the scan for devices and check if the BMS to test is present doesn't add value
if the device is not within range (or the MAC is wrong), then the subsequent start_scraping call will either fail or fail to produce usable data

* JKBMS_BLE driver fixes

* added Bluetooth signal strenght, increased debug

* Optimized reinstallation procedure
- Changed: Optimized restart sequence for the bluetooth installation
- Changed: Run serial part first and then bluetooth part. This allows the serial driver to get operative faster
- Removed: $DRIVERNAME variable for clearer paths
- Removed: Bluetooth system driver restart, since the devices get disconnected by the service before starting the dbus-serialbatterydriver

* Improved Jkbms_Ble error handling

* optimized disable procedure

* small fixes

* save custom name and make it restart persistant
#100

* changed unique identifier from string to function
function can be overridden by BMS battery class

* fix typo

* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

---------

Co-authored-by: Holger Schultheiß <hoschult@web.de>
Co-authored-by: Stefan Seidel <lkml@stefanseidel.info>
Co-authored-by: Bernd Stahlbock <6627385+transistorgit@users.noreply.github.com>
Co-authored-by: seidler2547 <github@stefanseidel.info>
Co-authored-by: ogurevich <50322596+ogurevich@users.noreply.github.com>
Co-authored-by: wollew <wollew@users.noreply.github.com>
Co-authored-by: Oleg Gurevich <oleg@gurevich.de>
Co-authored-by: peterohman <psub@fieber.se>
Co-authored-by: Strawder, Paul <paul@coach-ai.com>
Co-authored-by: Paul Strawder <paulidstein@gmail.com>
Co-authored-by: Samuel Brucksch <SamuelBrucksch@users.noreply.github.com>
Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: ArendsM <136503378+ArendsM@users.noreply.github.com>
Co-authored-by: Meik Arends <github@arends.info>
Louisvdw pushed a commit that referenced this issue Feb 28, 2024
* fix Sinowealth not loading
#702

* fix unique identifier function

* enable BMS over config, if disabled by default
Now you can also add more then one BMS for BMS_TYPE

* show battery port in log

* ANT BMS fixes
Fixed that other devices are recognized as ANT BMS

* Sinowealth BMS fixes
Fixed that other devices are recognized as Sinowealth BMS

* improved publish_battery error handling
switched from error count to seconds

* Improve Battery Voltage Handling in Linear Absorption Mode

* Refactor change time() to int(time()) for consistency in max_voltage_start_time and tDiff calculation
* Refactor battery voltage calculations for efficiency and clarity
* Remove penalty_buffer
* Reset max_voltage_start_time wenn we going to bulk(dynamic) mode

* updated changelog

* fix reply processing

* Reduce the big inrush current, if the CVL jumps
from Bulk/Absorbtion to Float
fix #659

* Check returned data lenght for Seplos BMS

Be stricter about the return data we accept, might fix the problem of grid meters accidently being recognized as a Seplos

* Validate current, voltage, capacity and SoC for all BMS
This prevents that a device, which is no BMS, is detected as BMS

* removed double check

* bump version

* fix validation if None

* updated changelog

* proposal to #659 formatted :)

* bugfix proposal to #659

* refactor setting float charge_mode

* fix type error, removed bluetooth cronjob

* updated changelog

* fix rs485 write communication errors by inserting sleeps, add debug print for charge mode and fix crash on write soc failures

* fix write problem on set_soc. also changed the switch charge/discharge function, just in case

* debug msg

* Bluetooth optimizations

* Fixes by @peterohman
#505 (comment)

* fix #712

* fix meaningless time to go values

* fix meaningless time to go values

* Duration of transition to float depends on number of cells

* Float transition - Voltage drop per second

* Update hlpdatabms4s.py

* Validate setting of FLOAT_CELL_VOLTAGE and avoid misconfiguration

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* cleanup

* consider utils.LINEAR_RECALCULATION_EVERY to refresh CVL

* small refactor, introduced set_cvl_linear function to set CVL only once every LINEAR_RECALCULATION_EVERY seconds

* fix typo

* updated changelog

* remove debug msg

* remove debug msg

* undo debug change

* Daly BMS make auto reset soc configurable

* added debug and error information for CVL

* fix proposal for #733 (#735)

* Added: Tollerance to enter float voltage once the timer is triggered

* Add bulk voltage
Load to bulk voltage every x days to reset the SoC to 100% for some BMS

* JKBMS disable high voltage warning on bulk
reenable after bulk was completed

* fixed error

* disable high voltage warning for all BMS
when charging to bulk voltage

* fix error and change default value
measurementToleranceVariation from 0.025 to 0.5 else in OffGrid mode max voltage is always kept

* Added temperature names to dbus/mqtt

* Use current avg of last 300 cycles for TTG & TTS

* Calculate only positive Time-to-SoC points

* added current average of last 5 minutes

* make CCL and DCL more clear

* fix small error

* bugfix: LLTJBD BMS SOC different in Xiaoxiang app and dbus-serialbattery

* black formatting

* JDB BMS - Control FETs for charge, discharge and disable / enable balancer (#761)

* feature: Allow to control charge / discharge FET
* feature: Allow to enable / disable balancer

* bugfix: Cycle Capacity is in 10 mAh

Fixes SoC with factor 100 * 100% percentage

* JBD BMS show balancer state in GUI page IO (#763)

* Bump version

* Fix typos

* Smaller fixes
- fixes #792 (comment)

* Removed comments from utils.py
This should make more clear that there are no values to change

* Updated changelog

* possible fix for LLT/JBS connection problems
#769
#777

* bugfix: LLT/JBD BMS general packet data size check

* improved reinstall and disable script

* LLT/JBD BMS - Improved error handling and automatical driver restart
in case of error. Should fix:
- #730
- #769
- #777

* Fixed Building wheel for dbus-fast won't finish on weak systems
Fixes #785

* Support for Daly CAN Bus (#169)

* support for Daly CAN Bus
* fix constructor args
* revert port, needs fix
* add can filters
* comment logger

Some changes are still needed to work with the latest version. They will follow in a next PR.

---------

Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: Manuel <mr-manuel@outlook.it>

* JKBMS BLE - Introduction of automatic SOC reset (HW Version 11) (#736)

* Introduction of automatic SOC reset for JK BMS (HW Version 11)
* Fixed value mapping
* Rework of the code to make it simpler to use without additional configuration.
Moved execution of SOC reset. It's now executed while changing from "Float" to "Float Transition".
* Implementation of suggested changes
Persist initial BMS OVP and OVPR settings
Make use of max_cell_voltage to calculate trigger value for OVP alert

* Added: Daly CAN and JKBMS CAN

* added CAN bms to installation script
optimized CAN drivers

* smaller fixes

* Trigger JK BLE SOC reset when using Step Mode

* Moved trigger_soc_reset()

* fixes LLT/JBD SOC > 100%
#769

* changed VOLTAGE_DROP behaviour

* Fix JKBMS not starting if BMS manuf. date is empty

* corrected bulk, absorption and soc reset terms

* fix typo

* add JKBMS_BLE debugging data

* fix small error

* Some changes for lost bluetooth connection / hci_uart stack restart

* added logging to config

* add sleep before starting driver
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before

* changed post install info

* fix error

* Daly BMS fixed embedded null byte
#837

* added info for SoC reset to default config file

* fix for #716
#716

* fix for #716 and JKBMS model recognition
#716

* optimized logging

* fix JKBMS recognition

* added debugging

* fixes #716
#716

* Bind device instance to unique_identifier
#718

* added data types to battery class
disabled unused variables

* save current charge state
#840

* correct file permissions

* updated changelog

* added periodic saveChargeDetails

* fix some small errors

* fix issue with ruuvi tags
When there are hundreds of unused ruuvi tags in the settings list that where added because thei where nearby the driver does not start correctly. These stale entries are disabled on the driver startup.
The issue was already filed to Victron developers

* CVL with i-controller instead of penaltysum

* cvl_controller: switch to choose PenaltySum or ICOntroller + documentation

* docu enhancement

* Add setting and install logic for usb bluetooth module

* round temperatures

* changed battery disconnect behaviour

* Fixes #891
#891

* updated changelog

* Add bluetooth device note to config.default.ini

* Fix typo in bluetooth note in config.default.ini

* fixed error in new cvl_controller

* fixed float division by zero and code optimization

* Restart MAX_VOLTAGE_TIME_SEC if cell diff > CELL_VOLTAGE_DIFF_KEEP_MAX_VOLTAGE_TIME_RESTART

* Calculation of the SOC based on coloumb-counting (#868)

* Calculation of the SOC in the driver based on coloumb-counting

* soc_calc: add current correction before integration

* soc_calc: correction map for current

* Soc_calc: CorrectionMap, switch to turn on/off correction, selectable initial value

* soc_calc: Bugfix

* soc_calc: Bugfix

* store soc in dbus for restart

* store soc in dbus for restart (formatted)

* store soc in dbus for restart (bugfix)

* save soc_calc only after change > 1.0

* store soc in dbus for restart (bugfix)

* logger does not work this way. do not know why

* writing and reading to dbus works

* Removed options: SOC_CALC_CURRENT_CORRECTION, SOC_CALC_RESET_VALUE_ON_RESTART, SOC_CALC_INIT_VALUE
sort soc_calc alphabetically

* fixed comments

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Updated changelog, small fixes

* Changed: PUBLISH_CONFIG_VALUES from 0/1 to True/False

* Changed: Code optimizations
- Changed some variables to be more clear
- Added comments for easier code understanding

* Calculated SOC: Added two decimals, added BMS SOC for MQTT & Node-RED

* Fix #898
#898

* Changed: Fix issue loading settings from dbus

* Added nightly install option
makes it easier for users to pretest fixes

* Changed: more detailed error output when an exception happens

* Possible fix for #912
#912

* Fixes #919
#919

* Changed: Exit script with error, if port excluded
else the serialstarter stops at the dbus-serialbattery

* Fixed some smaller errors

* Updated pre-release workflow

* Fix JK BMS connection restart when bluetooth fails.

This fix installs a new thread to monitor the state of the original
scraping thread.
If scraping thread dies, it verifies that it did not because the
scraping was intentionally stopped by calling stop_scrapping.
When restarting the scrapper, it first calls the bluetooth
reset lambda function that was passed in the class contructor, such that
bluetooth is ready to make a proper connection.

* Fixes #916
#916

* Added Venus OS version to logfile

* Fix #840
#840

* Small code formatting fixes

* Optimized reinstall script. Restart GUI only on changes.

* Display debugging data in GUI when DEBUG enabled

* Install script now shows repositories and version numbers

* Update daly_can.py

Fixing #950 for DalyBMS

* Update jkbms_can.py

Fixing #950 for Jk BMS

* Fix black lint check

* Fixes #970
#970

* Fixed some errors in restoring values from dbus settings

* Moved sleep on start for all BMS

* Update config description

* Reworked a part of the default config

* fix typo in stopping services when reinstalling

* Fix Time-to-SoC and Time-to-Go calculation

* Add changelog info

* Round sum and diff voltage

* Temperature limitation variables where changed

* SoC limitation variables where changed

* Added error messages

* Remove unneeded code

* Reset SoC to 0% if empty

* Add GUIv2 for dbus-serialbattery

* Check free space before installing

* Added new GUIv2 version

* Removed Python 2 compatibility

* Changelog update

* Code cleanup
- Removed: get_temperatures()
- Removed: update_last_seen()

* Bluetooth code optimizations

* Fixed some JKBMS BLE not starting
#819

* Check if packages are already installed before install

* Fixed some SOC calculation errors

* Fixed None SOC on driver start

* Do not show and allow button change when callback is missing for:
- ForceChargingOff
- ForceDischargingOff
- TurnBalancingOff

* Check if a device instance is already used by creating a PID file

* Log and execute SOC reset to 100% or 0% only once

* Update GitHub workflow and issue templates

* Fixed LLT/JBD BMS with only on temperature sensor #791
#971

* Fix warning on reinstall

* Fix missing IO control for JBDBMS #992
#992

* Prepare for removing dev branch

---------

Co-authored-by: ogurevich <50322596+ogurevich@users.noreply.github.com>
Co-authored-by: Bernd Stahlbock <6627385+transistorgit@users.noreply.github.com>
Co-authored-by: wollew <wollew@users.noreply.github.com>
Co-authored-by: Oleg Gurevich <oleg@gurevich.de>
Co-authored-by: peterohman <psub@fieber.se>
Co-authored-by: Strawder, Paul <paul@coach-ai.com>
Co-authored-by: Paul Strawder <paulidstein@gmail.com>
Co-authored-by: Samuel Brucksch <SamuelBrucksch@users.noreply.github.com>
Co-authored-by: Samuel Brucksch <samuel@iternio.com>
Co-authored-by: ArendsM <136503378+ArendsM@users.noreply.github.com>
Co-authored-by: Meik Arends <github@arends.info>
Co-authored-by: Marvo2011 <Marvin.Edeler@gmail.com>
Co-authored-by: cflenker <christian.flenker@gmx.de>
Co-authored-by: cflenker <125555670+cflenker@users.noreply.github.com>
Co-authored-by: Cupertino Miranda <cupertinomiranda@gmail.com>
Co-authored-by: Martin Polehla <p0l0us@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested support Support request
Projects
None yet
Development

No branches or pull requests

8 participants