Help: bluetooth connection problem

Hi,

Im trying to connect my app to a bluetooth HC05 using the mac address, if the HC05 is on before opening the app there is no problem with the connection. however if the app is on before turning on the HC05, the app will not read it. is there a way to let the app to just keep searching for the mac address to reconnect automatically. I dont want to create a button to search for bluetooth devices to connect. I just want to always connect to FC:A8:9A:00:07:B1.
Is there a way to just keep searching after any disconnections happens to directly reconnect without restarting the app?

please find my code below:

1 Like

how do i use the set clock 1? i cant find it anywhere in my blocks.

borrar_bluetooth22.aia (2.3 KB)

1 Like

connecting the hc05 is working fine but when power goes off and on, the hc05 will not reconnect automatically unless i close the app and open it again. it seems im doing something wrong.

so this connects when we set text to "call bluetooth clien1 . conn..... "xxxxxxx", and why we have to do this can't we connect directly ,, can u help me auto connect to my esp32, i will remove list picker

   


![code|372x499](upload://sfEWmUsd3NNljKr1wUUOCzxY6Pz.png)

The connect method returns true in case the connection was successful and false if it was not

Just use an if statement together with the Connect method and the mac address of the device

If Connect..
Then success
Else nio success

Taifun

As @Taifun has already said, if you want to connect directly your ESP32 without picking its address from a list you can use Serial_BT_Terminal (free on Playstore) to discover the IP address of your ESP32, then you can implement the following (just an example):

Hope it helps.