"Hackish" solution to general loss of bluetooth, dropouts and also OTA failures. #364
EasilyBoredEngineer
started this conversation in
General
Replies: 2 comments 3 replies
-
Do you know the |
Beta Was this translation helpful? Give feedback.
3 replies
-
Did you try playing with the ble options?
I don't remember exactly why I changed this, but with that mine runs perfectly smooth and never looses connection. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
As we know bluetooth and wifi is shared on most esps. On my boards, this means that over the air (OTA) updates sometimes hang at about 42%.
Also, as others have noted, just in general the bluetooth randomly tends to drop out and stops the JK's updating home assistant (referenced in #235).
Although this is a bit hacky, here's my two solutions -
Let's first fix the OTA update failures. The solution is to turn off bluetooth automatically before you OTA. here's what you need to change...
First in the switch section of your YAML, you need to add an 'id' to the ble_client section - here I've called it 'bms0_bluetooth.'.
next you need to go to the OTA section and add something like this - this will tell the esp to turn off bluetooth if an OTA update is pending:-
Ok - that's the OTA updates sorted.
Now let's move on to the flakey bluetooth connections. My purpose here is to check to see if the bluetooth connection between the JK and the esp is down.
In the binary_sensor of your YAML add or edit the online_status section to add an id... something like this:-
then you need to add a new 'switch' to reset the esp. Go to the switch: section, and add something like this:-
then create a new 'trigger' to reset the esp if your bluetooth stops communicating with the BMS. I've chosen to use a cron trigger, checking every 2 minutes, but if anyone can think of a better trigger to use, please comment. Note I've also chosen to kill two birds with one stone by checking we're connected to the home assistant api as well (this fixes wifi issues).
With these mods I've got my setup to be entirely resilient to gremlins.
Beta Was this translation helpful? Give feedback.
All reactions