Closed simsandmann closed 1 year ago
The same here. I have a similar setup and got exactly the same error message when trying to add my two JKBMS (4s) with BT. Adding only one BMS works just fine.
One JKBMS via Bluetooth is not working for me, but I am also connected with serial connection as my system is productive. So I am connected to "two" BMS as well.
Could you try to execute this lines manually and check the results?
opkg update
opkg install python3-misc python3-pip
pip3 install bleak
Seems like nothing has changed:
root@einstein:/data/log# opkg update
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/all/Packages.gz.
Updated source 'all'.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/cortexa7hf-neon-vfpv4/Packages.gz.
Updated source 'cortexa7hf-neon-vfpv4'.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/einstein/Packages.gz.
Updated source 'einstein'.
root@einstein:/data/log# opkg install python3-misc python3-pip
No packages installed or removed.
root@einstein:/data/log# pip3 install bleak
Requirement already satisfied: bleak in /usr/lib/python3.8/site-packages (0.20.2)
Requirement already satisfied: async-timeout<5,>=3.0.0; python_version < "3.11" in /usr/lib/python3.8/site-packages (from bleak) (4.0.2)
Requirement already satisfied: dbus-fast<2.0.0,>=1.83.0; platform_system == "Linux" in /usr/lib/python3.8/site-packages (from bleak) (1.86.0)
Edit: But it worked. Restarted the Cerbo and now 2 Bluetooth connections are working. Edit2: At second restart of Venus OS no Bluetooth connection is established...
Could you also post the output of
/usr/libexec/bluetooth/bluetoothd -v
/usr/bin/bluetoothctl -v
bluetoothctl devices
Does it connect, if you restart the bluetooth driver?
/etc/init.d/bluetooth restart
If you revert back to the latest beta all works fine?
root@einstein:/data/log# /usr/libexec/bluetooth/bluetoothd -v
5.55
root@einstein:/data/log# /usr/bin/bluetoothctl -v
bluetoothctl: 5.55
root@einstein:/data/log# bluetoothctl devices
Device ED:D5:E6:BC:BF:4E MPPT 1
Device CA:BF:98:7A:39:16 MPPT 2
Device C8:47:8C:E9:03:8B JKBMS 1
Device C8:47:8C:E8:04:67 JKBMS 2
Device 88:BF:E4:CD:2E:8E 88-BF-E4-CD-2E-8E
/etc/init.d/bluetooth restart --> Still no connection
At the latest beta version the connection was already unstable. It connected and disconnected around 4 times a day. It worked approx. 6h and then it did not for the next 6 hours. And so on.
I also updated from Venus OS 2.92 to 3.0 trying to fix the issue with the latest version. It did not work.
You have disabled Bluetooth in the Venus OS settings?
Have you tried an external Bluetooth dongle?
Bluetooth is disabled.
I have no Bluetooth dongle.
Some time later the Bluetooth connection established. Maybe that helps:
Please put tripple backticks ``` in the line before and after your code/logs for correct formatting.
This should help, thanks. What is your BMS hardware/firmware version?
Both BMS are JK_B2A20S20P (JK-B2A20S20P)
JKBMS 1: HW: 10.XW SW: 10.10
JKBMS 2: HW: 11.XW SW: 11.25
/etc/init.d/bluetooth restart with a Serial connection and only one Bluetooth connection works instantly. (11.XW via Serial, 10.XW via BT). Having 2 Bluetooth JKBMS in Config --> No connection.
I can confirm the same issue with also two JK bms'es. Version is 2.92 and the troubleshooting mentioned in this topic/bug report is the same with mine setup. My Victron also reboots the GX side once in the X hours. My MQTT messages are missing for a couple of minutes and that is the moment the VenusOS reboots. The system also resets the names I've given them and when I check the names are standard. The connection is sometimes restored to both the units and sometimes not. I'm keeping the serial connection to one of the BMS'es live to keep the CCL and DCL accurate with settings.
Restarting the bluetooth connection as mentioned above works: /etc/init.d/bluetooth restart. Both BMS'es are displayed. When the VenusOS reboots it's probally resetted.
@sstolk90 for the names see https://github.com/Louisvdw/dbus-serialbattery/issues/100
@baranator could you take a look at the thread issue?
@mr-manuel seems like it happens here, on reconnect: https://github.com/Louisvdw/dbus-serialbattery/blob/86a6b956e15bee21d5a298283c9d121f0eb82a02/etc/dbus-serialbattery/bms/jkbms_ble.py#L154
Do you really think it should do that? If anything, it should call stop_scraping
first. But I would rather just exit and let a "normal" reconnect happen.
It could also be that with the scanning removed (#695) that the initial connect will be more reliable since there wouldn't be two processes doing exactly the same scan at exactly the same time.
@sstolk90 can you find out the reason for the reboot? There could be a hint in /var/log/messages
(or /var/log/messages.0
) on your GX device. For me it was OOM (out of memory) until I put a script in place to fix a memory leak.
Please execute this commands to apply the potential fixes:
wget -O /data/etc/dbus-serialbattery/bms/jkbms_ble.py https://raw.githubusercontent.com/mr-manuel/venus-os_dbus-serialbattery/dev/etc/dbus-serialbattery/bms/jkbms_ble.py
wget -O /data/etc/dbus-serialbattery/bms/jkbms_brn.py https://raw.githubusercontent.com/mr-manuel/venus-os_dbus-serialbattery/dev/etc/dbus-serialbattery/bms/jkbms_brn.py
bash /data/etc/dbus-serialbattery/reinstall-local.sh
reboot
Let me know, if this fixes your problem.
bash /data/etc/dbus-serialbattery/reinstall-local.sh
I've installed this and will monitor for issues!
Well, the bluetooth is not coming back after installing the above command's:
What does the driver log say?
Did you reboot after install? If not, please reboot.
The logs say it...
Jun 8 08:23:35 nanopi user.notice shutdown[19486]: shutting down for system reboot **snip reboot process*
In the meanwhile I found this two links regarding Jun 8 08:26:33 nanopi user.err kernel: [ 165.724899] Bluetooth: hci0: unexpected event for opcode 0xfc19
:
@seidler2547 do you also see this in your logs with the LltJbd_Ble
driver?
What does the driver log say?
~Did you reboot after install? If not, please reboot.~
The logs say it...
Jun 8 08:23:35 nanopi user.notice shutdown[19486]: shutting down for system reboot **snip reboot process*
After the reboot it detects 1 JK BMS over Bluetooth and the other one on serial. I think when I reboot the bluetooth process it will reconnect to the second one. Will test it now
After entering the command /etc/init.d/bluetooth restart it shows this. Correct in my case but not sure if it will reboot. I will rename one of the BLE names to something own and when it's rebooted I will notice the name change.
After renaming all three it reconnects both bluetooth and resets their name after a while. The unit has not rebooted since the Batterij Onder (eng: Battery Below) has kept his name:
Ok, this means, that the driver creashes and restarts. Can you contact me on Discord?
hci0: unexpected event for opcode 0xfc19
I think I've seen this too, occasionally. I don't think it's a problem.
@sstolk90 is the BT dongle far away from the batteries or is there a lot of interference, e.g. From WiFi?
Also, you did disable Bluetooth in the GUI, didn't you?
Right now from the logs it seems that the connection doesn't work because the communication between the GX and the BMS is interrupted. I don't immediately see how the driver could work around that, but it's hard to say.
I made some changes in my dev
branch. The log will display the signal strenght of a Bluetooth connections in the logs, this will help troubleshooting.
This is solved with https://github.com/mr-manuel/venus-os_dbus-serialbattery/releases/tag/v1.0.20230610beta which gets merged with the dev
branch of this repo later today. Then it can be installed using the install script by selecting nightly
and then dev
.
Describe the bug
Bluetooth connection to JKBMS is not working since the new latest version (1.0.20230531)
How to reproduce
Steps to reproduce the behavior:
Expected behavior
Venus OS is connecting to the JKBMS
Driver version
1.0.20230531
Venus OS device type
Cerbo GX
Venus OS version
3.0.0 (newest stable)
BMS type
JKBMS / Heltec BMS
Cell count
16
Connection type
Bluetooth
Config file
Relevant log output
Any other information that may be helpful
No response