Bluetooth HC-06 Android connection fail at 2nd connect (after app restarts)

hi,

today i connected a HC-06 Bluetooth-Module to my arduino. all works fine, i can connect by my android-app (after search, get ID and connect, send data, receive data, all fine).

when i cancel my android-app without close the bluetoth-connection (for example it crashes oder i go out of the house) it is not possible to connect again.
now i made a button into my app for cancel the connection, after i do this it is possible to reconect.

this app is for other customers and there it will be often they forgett to close the connection.

what can i do ?
is there a command to reset the connection ? (by using the connection-id? and how to do this ?)

thanks a lot
best regards
w

Android problem.

oh, what i have vorgotten to say.....

if i make a power-reset to the arduino with the HC-06 Bt module, it's possible to connect again

so i think it's not a problem of the android, ????

wbeppler:
oh, what i have vorgotten to say.....

if i make a power-reset to the arduino with the HC-06 Bt module, it's possible to connect again

so i think it's not a problem of the android, ????

custom app you wrote?

I wouldn't trust it. Troubleshoot with one of the apps in Google Play Store.

.

wbeppler:
if i make a power-reset to the arduino with the HC-06 Bt module, it's possible to connect again
so i think it's not a problem of the android, ????

HC-06 is a slave. Even if it was a master, this is still an Android problem.

oder i go out of the house) it is not possible to connect again.

If this happens to me when my HC-06 is connected to my phone, I get notification of disconnect, and I simply reconnect when I go back in range. If you cannot do that, that is a programming skills problem - Android. If I switch terminals without disconnecting first, I can momentarily shut bluetooth down in the phone's wipedown. This is not really a problem for anybody, but might point to a limitation in the Android O/S, and thus implies that further investigation on your part is futile.

I guess about the most you can expect to do at the Arduino end is have a time-out facility which switches off power to HC-06 either:

  1. after the end of incoming data from Android. This presupposes the data stream from Android is steady and predictable, which I would have thought unlikely, OR

  2. after the absence of a compulsory response from Android after transmission from Arduino.

Both options seem to be a ragged Arduino workround to what is really an Android problem.