-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
JKBMS BLE - Loss of connection after an indefinite period of time #1092
Comments
After a reboot without successful reconnection, the log shows the following. 2024-07-03 21:54:49.437041500 Additional information - Jkbms: |
After several reboots a I was able to restore a connection. Log: 2024-07-03 22:22:30.084866500 [CHG] Device C8:47:8C:EC:BA:6F RSSI: -77 |
I have the same issue. I turned off the bluetooth in the Venus GX device (serial battery turns it on itself) so it worked better. What kind of system do I have? With NodeRed switched off, it runs quite stable, regulates and limits the voltages perfectly to a maximum of 3.45V, then drops to 3.35V. So far so good. But what is still a problem are the many cell imbalance warnings, even though there is no load and a real maximum difference of 5mV. |
Unfortunately my knowledge of Bluetooth connections is very limited and I'm not able to solve and troubleshoot this problem. Any help is very welcome! |
I'm having a similar problem. First thing I tried to do is run the /etc/init.d/bluetooth restart script to restart bluetoothd, but this doesn't seem to work. |
I just started having this problem. I used to lose connection every couple weeks, and a restart of the Cerbo would solve it. This morning, it has happened three times already. A restart solves it for a bit. I am using Large OS. Updating now to 3.41 to see if that helps. Next step is to try a bluetooth dongle instead of built-in bluetooth. |
I also started having connection disrupts. I believe it was with updating to 3.41. I try to go back to 3.40. Could you find any solutions? I need to power cycle the cerbo gx every day. Sometimes if I can still reach it, it says no battery manager found. It was running more or less stable before. |
I dont really know how to trouble shoot as i can barely reach the device. |
I've got the same Problem, but I belive the BMS is the problem. What makes me think of that? I'll check if there is a firmware update for the BMS. This is the endless loop tring to reconnect:
|
I troubleshooted the Bluetooth problems now way over 100 hours and found no real solution to all this problems. Therefore I decided to not put any other effort into the Bluetooth part. Another reason is, that the users apparently do not appreciate the work I do and they cannot immagine how much time consuming this all is. For that 1-2 donations, if at all, a month on over 9.000 dbus-serialbattery installations it is not worth it. If everyone would donate 1 €/year then the motivation would be another, but that is not the case. Feel free to open a PR in my repository to help me with this :-) |
So, I have this script running as a cron job every 5 minutes. The bluetooth connection has been pretty dang stable since adding this script. I wonder if this check can somehow be written into the driver. I don't really have time to dig through the code and submit a PR. However, I'd be happy to submit a PR with this script and a short addition to the docs describing in what scenarios to use the script. #/usr/bin/bash
date -d @$(($(date +%s) - 7*3600)) '+[%Y-%m-%d %H:%M:%S]'
/etc/init.d/bluetooth status
if [ $? -eq 3 ]; then
/data/etc/dbus-serialbattery/restart-driver.sh
echo "dbus-serial battery restarted"
fi |
We already had once a workaround like this. Since this is not really a real solution I will not add it, since restarting the driver too many times can cause even more issues and you need to reboot the device. |
This looks more like a kernel / bluetooth driver issue. I've just dumped the onboard bluetooth controller for a USB one and it seems to be far more stable. The internet has plenty of similar scenarios where the connection just randomly drops. This might be a "hurry up and wait" for improvement on the support for it on a kernel level. I've found with my raspberry pi 4, connecting via bluetooth to be impossible - its flakey as hell. I could only connect via network cable and do the config there. @mr-manuel I feel your pain. I worked on a project for years and received very little reward for it. For what its worth, I appreciate your efforts on this project. Thankyou. |
Has anyone tried changing the Bluetooth Poll rate? |
I tried polling at every 1.2 seconds, but it made no tangible difference - at least not using the onboard RPI Bluetooth. |
How did you change the polling interval? I set 10s as the Poll_Interval in the config.ini but I can still see updates roughly every second in the remote console. Did I miss something or is that parameter broken? |
I did the same as you. Even without a setting there (should default to 1 second), I see updates better than a second. After looking at the code, there is a "use_callback" function ->
I've not spent a lot of time in the code yet, but I'd suggest that POLLING only works where/when the BMS doesn't provide updates... This is called in dbus-serialbattery.py
So I think, it's pointless to try setting a polling time. I still don't think the issue is anything to do with the code. |
I got regular reconnection that i never had before (BMS beeping at each BTooth reconnection), today i tried updating VenusOS from 3.3 to 3.42 .. it failed .. rebooted ... tried again .. failed at 4% install each time. I suspected dbus-serialbattery, disabled it, reboot... upgraded to VenusOS 3.42 without problem. |
I downgraded to v1.1.20240121 ~7 hours ago and both BMS's still show a connection, without reboot. |
Any update? |
For me v1.1 has a more stable connection to the BMS. I also didn't hear the reconnect beep from the BMS when near the battery (which is seldom). Didn't look any further into it, but maybe the bluetooth reset is causing issues / called too often. |
Here is the whole function a little more down.
It is called as part of refresh_data too
The underlying issues seems to be a segmentation fault that occurs. I saw it last week before I went off to work. Only got back last night so haven't had time to troubleshoot it more. It's fair to say that when the driver falls over, this function doesn't always (or perhaps never) successfully restart the driver properly. will try to look into it this week. |
I've rolled back to v1.2.20240408 and pretty stable for the day. Will keep running for the few days and report back. I had to roll back on the Pi and the Cerbo as both fell over in the end on a later version. Hopefully can get to a point where I can understand the difference between the latest version and this working version to see what is causing the dropouts. |
I used 1.3.2.2024 for months without any disconnection on JKBMS/Bluetooth. The last 1.4 failed after minutes only and would not be stable at all... I've rolled back to 1.3.2 and even if i restarted twice .. it work since a week now without any BT issue, something wrong has been done between those versions 1.3.2-1.4. Resetting bluetooth for whatever small reason, is an shortcut i would not take.... the underlying cause need to be found and solved. Specially when this is a regression vs previous version. |
Will continue in mr-manuel/venus-os_dbus-serialbattery#86 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi, |
I rolled back to the same version, and have still had drop outs. Every two or three days, it completely disconnects, and occasionally I get Error 67 BMS connection lost. I'm going to switch to a wired connection. |
Describe the bug
I’m facing sporadic disconnect issues after a while (sometimes one hour, sometimes a day or a bit more). Venus OS doesn’t recognize the disconnect as values don’t get updated. After a while the messages in the log changes.
I have spent hours searching through reported issue reports, but have not found any identical, unfixed or reported bugs.
How to reproduce
Issue is reproducible, but periodes vary. Sometimes the connection works for more than 24 hours, in other cases only for minutes or hours.
Expected behavior
Stable connection
Driver version
1.2.20240401
Venus OS device type
Raspberry Pi 4
Venus OS version
v3.33
BMS type
JKBMS / Heltec BMS
Cell count
18
Battery count
1
Connection type
Bluetooth
Config file
Relevant log output
Any other information that may be helpful
This behavior was already apparent immediately after initial operation. It is reproducible, but periodes vary. Sometimes the connection works for more than 24 hours, in other cases only for minutes or hours.
The text was updated successfully, but these errors were encountered: