Page 1 of 1

BLE auto reconnect when previously paired device is range?

Posted: Fri Mar 05, 2021 4:28 am
by MyESP32
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

Re: BLE auto reconnect when previously paired device is range?

Posted: Fri Jul 02, 2021 11:36 pm
by ShahenS
I'm looking for the exact thing.
Were you able to come up with anything?