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

JK-BMS stale connections #261

Open
kruisdraad opened this issue Oct 22, 2024 · 1 comment
Open

JK-BMS stale connections #261

kruisdraad opened this issue Oct 22, 2024 · 1 comment

Comments

@kruisdraad
Copy link

Hi,

With BATMON i have monitoring 3x JK-BMS (v15). This is working fine, however if you restart batmon, or some conditions restarts a session BATMON cannot connect to 1 or more batteries and never recovers from that. This is due the JK-BMS only allows 1 connections at the time and still sees BATMON session previously PID connected.

To solve this , stop BATMON, use bluetoothctl to issue a power off / power on. Then start BATMON again. Now everything is back to normal.

Therefor i suggest when batteries cannot connect allow a POWER-OFF/ON . This would be archived with bt_power_cycle (i think , documentation is not really clear) ... but it logs:

15:49:18 INFO [main] Power cycle bluetooth hardware
Unable to open mgmt_socket
Unable to open mgmt_socket

So it is not clear if a power reset actually occured :/

@burtonrosenberger
Copy link

Out of the box with stock config set to 1 for sample time, IIRC, the batmon locks onto the Jk's for life even on a restart. Change the sample time to something higher, I have mine at 60, and adjust the publish period to be at least a second longer. This will also allow your phone app to still connect.

I have restarted batmon several times since and it has never retained a connection to my 4 jk's after this. I also turned off concurrent readings IIRC.

Your solution sounds better if you want a higher sample rate and don't care about tying up the BT connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants