BLE auto reconnect when previously paired device is range?
Posted: Fri Mar 05, 2021 4:28 am
Hi sorry newbee here looking to program an esp32 to just do 3 simple things. I'm still learning Arduino programing and can't seem to figure this out....
I need it to do:
1 - securely connect to a phone via passcode
2 - if secure connection successful:
pin goes high to turn ON LED
if not securely connected LED -> OFF
if phone disconnects from bluetooth -> LED OFF
3 - automatically reconnect to the phone if the previously paired phone comes back into range. Or if the phone BLE is off, and I turn the BLE back on on the phone I want esp32 to again automatically reconnect to the phone.
Would such a sketch possible on esp32 and BLE? and would it be default? I've searched all over the internet for days now for a similar example for esp32 on Arduino IDE and couldn't fine anything that does that. I was able to accomplish number 1 and 2, but never number 3 auto reconnecting...
If someone could point me in the right direction or show me an example that does something similar that would awesome.
I very much appreciate any help anyone
I need it to do:
1 - securely connect to a phone via passcode
2 - if secure connection successful:
pin goes high to turn ON LED
if not securely connected LED -> OFF
if phone disconnects from bluetooth -> LED OFF
3 - automatically reconnect to the phone if the previously paired phone comes back into range. Or if the phone BLE is off, and I turn the BLE back on on the phone I want esp32 to again automatically reconnect to the phone.
Would such a sketch possible on esp32 and BLE? and would it be default? I've searched all over the internet for days now for a similar example for esp32 on Arduino IDE and couldn't fine anything that does that. I was able to accomplish number 1 and 2, but never number 3 auto reconnecting...
If someone could point me in the right direction or show me an example that does something similar that would awesome.
I very much appreciate any help anyone