Android Question Bluetooth Connection Time

rodmcm

Active Member
Licensed User
I am using the Bluetooth tutorial to connect to and communicate with an ESpP2 which has been setup using the latest and very simple arduino library. I find that my cellphone takes a considerable time to discover the ESP32, a much much greater period than say the discovery through Windows 10 bluetooth. Sometimes it will not connect at all. Is there anything I should be looking for in the setup of the ESP or in the bluetooth tutorial (I have removed the prefix mode.) Or is there another option?
 

rodmcm

Active Member
Licensed User
Classic. Also, for my naive learning is it possible to just connect to the serial interface after the standard bluetooth system within a mobile phone has paired with the ESP. Any references where I can lean more on this would be appreciated. I hate just using someone's code without understanding what it actually does
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I find that my cellphone takes a considerable time to discover the ESP32, a much much greater period than say the discovery through Windows 10 bluetooth. Sometimes it will not connect at all. Is there anything I should be looking for in the setup of the ESP or in the bluetooth tutorial (I have removed the prefix mode.) Or is there another option?
Don't confuse the two steps. First you discover the nearby devices and then you connect to one of the devices. If I remember correctly the current Bluetooth example doesn't stop searching after the first discovered device so it will take 12 seconds for the discovery process to end.

You can either skip the discovery process at all and connect to an already paired device (Serial.GetPairedDevices) or stop the discovery after you find the relevant device.
 
Upvote 0
Top