Louisvdw / dbus-serialbattery

Battery Monitor driver for serial battery in VenusOS GX systems
MIT License
492 stars 157 forks source link

driver no longer works #1043

Closed ray90408 closed 2 months ago

ray90408 commented 2 months ago

Describe the problem

I changed the config.ini while the system was running and rebooted. The battery (JKBMS has disappeared from the Venus GUI. A reinstallation was unsuccessful. How can you really delete everything about the serial battery driver without having to reinstall the Raspberry? The uninstall routine is not enough. I have tried this several times.

Who can help a beginner?

Driver version

v1.2.20240401

Venus OS device type

Raspberry Pi

Venus OS version

v3.31

BMS type

JKBMS / Heltec BMS

Cell count

16

Battery count

1

Connection type

Serial USB adapter to RS485

Config file

[DEFAULT]
;https://github.com/Louisvdw/dbus-serialbattery/blob/master/etc/dbus-serialbattery/config.default.ini

MAX_BATTERY_CHARGE_CURRENT = 70.0
MAX_BATTERY_DISCHARGE_CURRENT = 90.0

MIN_CELL_VOLTAGE   = 3.000
;MAX_CELL_VOLTAGE   = 3.450
MAX_CELL_VOLTAGE   = 3.460

FLOAT_CELL_VOLTAGE = 3.375

SOC_RESET_VOLTAGE = 3.5

CELL_VOLTAGES_WHILE_CHARGING   = 3.50, 3.45, 3.40, 3.35
MAX_CHARGE_CURRENT_CV_FRACTION =    0, 0.05,  0.5,    1

;CELL_VOLTAGES_WHILE_DISCHARGING   = 3.00, 3.30, 3.15, 3.20
;MAX_DISCHARGE_CURRENT_CV_FRACTION =    0,  0.1,  0.5,    1

CCCM_SOC_ENABLE = False
DCCM_SOC_ENABLE = False

BMS_TYPE = Jkbms

;false = Float aus für Kalibration_SOC BMS-Einstellungen: OVPR 3,44V  OVP 3,451V    MAX_CELL_VOLTAGE   = 3.459
CVCM_ENABLE = false

Relevant log output

root@raspberrypi4:~# tail -F -n 100 /data/log/dbus-serialbattery.ttyUSB0/current | tai64nlocal
2024-04-22 19:29:19.477943500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:29:19.477947500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:29:42.715722500 Traceback (most recent call last):
2024-04-22 19:29:42.715727500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:29:42.715731500     from dbushelper import DbusHelper
2024-04-22 19:29:42.715734500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:29:42.715738500     from utils import logger, publish_config_variables
2024-04-22 19:29:42.715741500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:29:42.715879500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:29:42.715883500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:29:42.715887500     self._read(fp, filename)
2024-04-22 19:29:42.715889500   File "/usr/lib/python3.8/configparser.py", line 1017, in _read
2024-04-22 19:29:42.715892500     for lineno, line in enumerate(fp, start=1):
2024-04-22 19:29:42.715895500   File "/usr/lib/python3.8/codecs.py", line 322, in decode
2024-04-22 19:29:42.715924500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:29:42.715928500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:30:05.948451500 Traceback (most recent call last):
2024-04-22 19:30:05.948456500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:30:05.948460500     from dbushelper import DbusHelper
2024-04-22 19:30:05.948463500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:30:05.948467500     from utils import logger, publish_config_variables
2024-04-22 19:30:05.948470500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:30:05.948556500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:30:05.948560500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:30:05.948563500     self._read(fp, filename)
2024-04-22 19:30:05.948566500   File "/usr/lib/python3.8/configparser.py", line 1017, in _read
2024-04-22 19:30:05.948569500     for lineno, line in enumerate(fp, start=1):
2024-04-22 19:30:05.948572500   File "/usr/lib/python3.8/codecs.py", line 322, in decode
2024-04-22 19:30:05.948600500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:30:05.948604500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:30:29.163387500 Traceback (most recent call last):
2024-04-22 19:30:29.163392500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:30:29.163396500     from dbushelper import DbusHelper
2024-04-22 19:30:29.163399500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:30:29.163403500     from utils import logger, publish_config_variables
2024-04-22 19:30:29.163406500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:30:29.163494500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:30:29.163498500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:30:29.163501500     self._read(fp, filename)
2024-04-22 19:30:29.163504500   File "/usr/lib/python3.8/configparser.py", line 1017, in _read
2024-04-22 19:30:29.163507500     for lineno, line in enumerate(fp, start=1):
2024-04-22 19:30:29.163510500   File "/usr/lib/python3.8/codecs.py", line 322, in decode
2024-04-22 19:30:29.163538500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:30:29.163542500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:30:52.406708500 Traceback (most recent call last):
2024-04-22 19:30:52.406714500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:30:52.406718500     from dbushelper import DbusHelper
2024-04-22 19:30:52.406721500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:30:52.406725500     from utils import logger, publish_config_variables
2024-04-22 19:30:52.406728500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:30:52.406812500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:30:52.406817500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:30:52.406820500     self._read(fp, filename)
2024-04-22 19:30:52.406823500   File "/usr/lib/python3.8/configparser.py", line 1017, in _read
2024-04-22 19:30:52.406826500     for lineno, line in enumerate(fp, start=1):
2024-04-22 19:30:52.406829500   File "/usr/lib/python3.8/codecs.py", line 322, in decode
2024-04-22 19:30:52.406912500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:30:52.406916500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:31:15.608617500 Traceback (most recent call last):
2024-04-22 19:31:15.608622500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:31:15.608627500     from dbushelper import DbusHelper
2024-04-22 19:31:15.608630500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:31:15.608633500     from utils import logger, publish_config_variables
2024-04-22 19:31:15.608636500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:31:15.608734500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:31:15.608738500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:31:15.608742500     self._read(fp, filename)
2024-04-22 19:31:15.608744500   File "/usr/lib/python3.8/configparser.py", line 1017, in _read
2024-04-22 19:31:15.608748500     for lineno, line in enumerate(fp, start=1):
2024-04-22 19:31:15.608750500   File "/usr/lib/python3.8/codecs.py", line 322, in decode
2024-04-22 19:31:15.608779500     (result, consumed) = self._buffer_decode(data, self.errors, final)
2024-04-22 19:31:15.608783500 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 643: invalid start byte
2024-04-22 19:31:38.818680500 Traceback (most recent call last):
2024-04-22 19:31:38.818684500   File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 20, in <module>
2024-04-22 19:31:38.818688500     from dbushelper import DbusHelper
2024-04-22 19:31:38.818691500   File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 8, in <module>
2024-04-22 19:31:38.818695500     from utils import logger, publish_config_variables
2024-04-22 19:31:38.818698500   File "/opt/victronenergy/dbus-serialbattery/utils.py", line 24, in <module>
2024-04-22 19:31:38.818785500     config.read([default_config_file_path, custom_config_file_path])
2024-04-22 19:31:38.818789500   File "/usr/lib/python3.8/configparser.py", line 697, in read
2024-04-22 19:31:38.818792500     self._read(fp, filename)
2024-04-22 19:31:38.8187

root@raspberrypi4:~# tail -F -n 100 /data/log/dbus-serialbattery.ttyUSB1/current                                  | tai64nlocal
2024-04-22 16:35:10.120406500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 -serialbattery.py", line 20, in <module>
2024-04-22 16:35:10.120411500     from dbushelper import DbusHelper
2024-04-22 16:35:10.120413500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 helper.py", line 8, in <module>
2024-04-22 16:35:10.120417500     from utils import logger, publish_config_varia                                 bles
2024-04-22 16:35:10.120420500   File "/opt/victronenergy/dbus-serialbattery/util                                 s.py", line 24, in <module>
2024-04-22 16:35:10.120497500     config.read([default_config_file_path, custom_                                 config_file_path])
2024-04-22 16:35:10.120501500   File "/usr/lib/python3.8/configparser.py", line                                  697, in read
2024-04-22 16:35:10.120505500     self._read(fp, filename)
2024-04-22 16:35:10.120507500   File "/usr/lib/python3.8/configparser.py", line                                  1017, in _read
2024-04-22 16:35:10.120510500     for lineno, line in enumerate(fp, start=1):
2024-04-22 16:35:10.120513500   File "/usr/lib/python3.8/codecs.py", line 322, i                                 n decode
2024-04-22 16:35:10.120540500     (result, consumed) = self._buffer_decode(data,                                  self.errors, final)
2024-04-22 16:35:10.120544500 UnicodeDecodeError: 'utf-8' codec can't decode byt                                 e 0xfc in position 717: invalid start byte
2024-04-22 16:35:33.307713500 Traceback (most recent call last):
2024-04-22 16:35:33.307718500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 -serialbattery.py", line 20, in <module>
2024-04-22 16:35:33.307723500     from dbushelper import DbusHelper
2024-04-22 16:35:33.307725500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 helper.py", line 8, in <module>
2024-04-22 16:35:33.307729500     from utils import logger, publish_config_varia                                 bles
2024-04-22 16:35:33.307732500   File "/opt/victronenergy/dbus-serialbattery/util                                 s.py", line 24, in <module>
2024-04-22 16:35:33.307867500     config.read([default_config_file_path, custom_                                 config_file_path])
2024-04-22 16:35:33.307871500   File "/usr/lib/python3.8/configparser.py", line                                  697, in read
2024-04-22 16:35:33.307875500     self._read(fp, filename)
2024-04-22 16:35:33.307877500   File "/usr/lib/python3.8/configparser.py", line                                  1017, in _read
2024-04-22 16:35:33.307881500     for lineno, line in enumerate(fp, start=1):
2024-04-22 16:35:33.307883500   File "/usr/lib/python3.8/codecs.py", line 322, i                                 n decode
2024-04-22 16:35:33.307913500     (result, consumed) = self._buffer_decode(data,                                  self.errors, final)
2024-04-22 16:35:33.307916500 UnicodeDecodeError: 'utf-8' codec can't decode byt                                 e 0xfc in position 717: invalid start byte
2024-04-22 16:35:56.474010500 Traceback (most recent call last):
2024-04-22 16:35:56.474014500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 -serialbattery.py", line 20, in <module>
2024-04-22 16:35:56.474019500     from dbushelper import DbusHelper
2024-04-22 16:35:56.474021500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 helper.py", line 8, in <module>
2024-04-22 16:35:56.474025500     from utils import logger, publish_config_varia                                 bles
2024-04-22 16:35:56.474028500   File "/opt/victronenergy/dbus-serialbattery/util                                 s.py", line 24, in <module>
2024-04-22 16:35:56.474110500     config.read([default_config_file_path, custom_                                 config_file_path])
2024-04-22 16:35:56.474114500   File "/usr/lib/python3.8/configparser.py", line                                  697, in read
2024-04-22 16:35:56.474117500     self._read(fp, filename)
2024-04-22 16:35:56.474120500   File "/usr/lib/python3.8/configparser.py", line                                  1017, in _read
2024-04-22 16:35:56.474123500     for lineno, line in enumerate(fp, start=1):
2024-04-22 16:35:56.474126500   File "/usr/lib/python3.8/codecs.py", line 322, i                                 n decode
2024-04-22 16:35:56.474155500     (result, consumed) = self._buffer_decode(data,                                  self.errors, final)
2024-04-22 16:35:56.474159500 UnicodeDecodeError: 'utf-8' codec can't decode byt                                 e 0xfc in position 717: invalid start byte
2024-04-22 16:36:19.655734500 Traceback (most recent call last):
2024-04-22 16:36:19.655739500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 -serialbattery.py", line 20, in <module>
2024-04-22 16:36:19.655743500     from dbushelper import DbusHelper
2024-04-22 16:36:19.655746500   File "/opt/victronenergy/dbus-serialbattery/dbus                                 helper.py", line 8, in <module>
2024-04-22 16:36:19.655749500     from utils import logger, publish_config_varia                                 bles
2024-04-22 16:36:19.655752500   File "/opt/victronenergy/dbus-serialbattery/util                                 s.py", line 24, in <module>
2024-04-22 16:36:19.655837500     config.read([default_config_file_path, custom_                                 config_file_path])
2024-04-22 16:36:19.655841500   File "/usr/lib/python3.8/configparser.py", line                                  697, in read
2024-04-22 16:36:19.655844500     self._read(fp, filename)
2024-04-22 16:36:19.655847500   File "/usr/lib/python3.8/configparser.py", line                                  1017, in _read
2024-04-22 16:36:19.655850500     for lineno, line in enumerate(fp, start=1):
2024-04-22 16:36:19.655853500   File "/usr/lib/python3.8/codecs.py", line 322, i                                 n decode
2024-04-22 16:36:19.655881500     (result, consumed) = self._buffer_decode(data,                                  self.errors, final)
2024-04-22 16:36:19.655884500 UnicodeDecodeError: 'utf-8' codec can't decode byt                                 e 0xfc in position 717: invalid start byte
2024-04-22 16:39:03.353481500 *** CCGX booted (0) ***
2024-04-22 16:40:51.760808500 *** CCGX booted (0) ***
2024-04-22 17:04:53.378607500 *** CCGX booted (0) ***
2024-04-22 17:14:19.383121500 *** CCGX booted (0) ***
2024-04-22 17:15:19.118780500 INFO:SerialBattery:
2024-04-22 17:15:19.119005500 INFO:SerialBattery:Starting dbus-serialbattery
2024-04-22 17:15:19.119938500 INFO:SerialBattery:Venus OS v3.31
2024-04-22 17:15:19.120210500 INFO:SerialBattery:dbus-serialbattery v1.2.2024040                                 

root@raspberrypi4:~# tail -F -n 100 /data/log/serial-starter/current | grep dbus-serialbattery | tai64nlocal

Any other information that may be helpful

No response

mr-manuel commented 2 months ago

You corrupted your config.ini file by editing it. Probably you did that by downloading and uploading it with sftp. Delete the config.ini and reinstall the driver.

ray90408 commented 2 months ago

Thank you very much for the quick help. The driver is running again.