Closed calledit closed 4 months ago
Since you are not using the code of my repository, it's a bit hard to help you. Have you pushed your code at least to your repository, so I can check it?
I don't think, that this commit introduced this bug. If you are using a Bluetooth connection you have to overwrite the connection_name()
:
Nah it is in such a early stage that I jave not even made a fork yet.
Okay did not know that. Good to know, that fixed that issue.
When that is fixed this error occurs instead:
@400000006695784403b7e1a4 Traceback (most recent call last):
@400000006695784403b7f914 File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 287, in <module>
@400000006695784403b80c9c main()
@400000006695784403b8146c File "/opt/victronenergy/dbus-serialbattery/dbus-serialbattery.py", line 236, in main
@400000006695784403b827f4 if not helper.setup_vedbus():
@400000006695784403b82fc4 File "/opt/victronenergy/dbus-serialbattery/dbushelper.py", line 794, in setup_vedbus
@400000006695784403b8434c self._dbusservice.register()
@400000006695784403b94cec File "/opt/victronenergy/dbus-serialbattery/ext/velib_python/vedbus.py", line 91, in register
@400000006695784403b96074 self._dbusname = dbus.service.BusName(self.name, self._dbusconn, do_not_queue=True)
@400000006695784403b973fc File "/usr/lib/python3.8/site-packages/dbus/service.py", line 112, in __new__
@400000006695784403b98784 validate_bus_name(name, allow_well_known=True, allow_unique=False)
@400000006695784403b99724 ValueError: Invalid bus name 'com.victronenergy.battery.': must not end with '.'
I solved it temporarily with a hack by adding the address argument on this line:
dbus-serialbattery.py line 236
So it becomes:
helper = DbusHelper(battery, "address")
Is there a similar thing (overloading some function) I should do to fix that problem the proper way?
Aha I see the error happens cause the port is not filled in here https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/ed2f95dcfba59585e460f5f8ebe9d3775b9abb03/etc/dbus-serialbattery/dbus-serialbattery.py#L187.
And the two other bluetooth BMS implementations has workarounds to get around that by ignoring the supplied port name and making up another one on this line https://github.com/mr-manuel/venus-os_dbus-serialbattery/blob/ed2f95dcfba59585e460f5f8ebe9d3775b9abb03/etc/dbus-serialbattery/bms/jkbms_ble.py#L22
Maybe not the cleanest solution. Maybe a nicer fix should be implemented in the future.
I'm always open for recommendations!
Describe the bug
Some type of bug ( introduced in this commit https://github.com/mr-manuel/venus-os_dbus-serialbattery/commit/af773cc2084c7bf9d95ce4202bb6ec666c9292ab?diff=split&w=0 )
How to reproduce
Add a battery with a address to the config.ini
Expected behavior
Not crash
Driver version of the currently installed driver
1
Driver version of the last known working driver
1
Venus OS device type
Raspberry Pi 2
Venus OS version
1
BMS type
JKBMS Inverter
Cell count
8
Battery count
1
Connection type
Bluetooth
Config file
Relevant log output
Any other information that may be helpful
No response