Bluetooth freeze after app get in background/lose focus

Hi to everybody,
I have made an app for my bike ,it display the speed using a sensor reed on the wheel.
The smartphone communicates with the microprocessor via bluetooth (HC05 schield).When I stard the app everithings is ok, but when the display get off or I change app, when I reselect the mit app to get focus, the bluetooth doesnt communicate ,but it is connected ( seeing the state led on the hc05 schield)
If I reconnect to bluetooth it goes.The problem is not to lose focus, but it is a problem because it will drain battery
I thank everybody that can help to solve this problem
Best regards

I have resolved the problem, bluetooth didn't freeze, when the app goes in background the message arriving from arduino is truncated .
My program use only the message with the right lenght message and so , due to truncation, no data was used to refresh display info. Seeing this, I supposed was due to bluetooth freezing.
Now I reject message with wrong lenght in message

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.