Page 1 of 1

ESP32 BLe Password Pairing

Posted: Sun Jul 28, 2019 6:52 am
by schkillll
Can i preset pairing password to an ESP32 and trigger a motor upon pairing with any device using that password only?

Re: ESP32 BLe Password Pairing

Posted: Mon Jul 29, 2019 8:48 pm
by phantomBlurrr
Hello,
Are you trying to make it so that when you connect to the ESP for the first time, it requests for you to pair your device. Not only that, but it requires a password to pair? This is what you want, right? If so, check out this:

Sample code provided by Espressif:
https://github.com/espressif/esp-idf/tr ... ity_server

Tutorial to understand this code:
https://github.com/espressif/esp-idf/bl ... through.md

Use those resources to figure out how to set the pairing password. Then look at the service table example to find how to make the GATT database and use that to communicate with the phone application. Lastly, put the commands you want into the GATT database, to be called by a button in the phone application. One of those commands can be something like turn on a motor, it would probably use GPIO on the ESP to send signal???
Good luck!

Re: ESP32 BLe Password Pairing

Posted: Wed Aug 28, 2019 3:56 pm
by schkillll
Thanks, figured it out.