Page 1 of 1

Change passkey via Android

Posted: Sun May 09, 2021 8:51 pm
by mycstrange@gmail.com
I haven't seen a clear way to do this so maybe it can't be done but I am trying to create a 'device flow' like this:

User connects via Android phone to ESP32 BLE for the first time and enters the default passkey to complete connection
The User can then choose to change what that passkey is
The passkey persists through power cycles (guessing via stored on EEPROM)


Thanks for any help!

Re: Change passkey via Android

Posted: Fri May 21, 2021 9:36 am
by ns1668
Seems fine to me.

There is a default storage area in the partition map already, take a look at https://docs.espressif.com/projects/esp ... flash.html

You can also add your own partitions if you wanted to. And yes this is non-volatile so it is persistent between power cycles.
You would need to send a message from your android device to the ESP32 which contains the new key, and then set the key on the ESP32.

I have not tried, but I assume that there is a way to send custom data via GATT profile in BLE - thats where I would start.

Simple design, just need to write the code.