Setup your ESP32 WiFi credentials over BLE from an Android phone or tablet. Sometimes you do not want to have your WiFi credentials in the source code, specially if it is open source and maybe accessible as a repository on Github or Bitbucket.
There are already solution like WiFiManager-ESP32 that give you the possibility to setup the WiFi credentials over a captive portal.
But I wanted to test the possibility to setup the ESP32's WiFi over Bluetooth Low Energy.
This repository covers the source code for the ESP32. The source code for the Android application are in the ESP32_WiFi_BLE_Android repository. The ready to use Android application is available on GooglePlay and APKfiles or download from here for manual installation.
Detailed informations about this project are on my website
The main problem with this application was always the memory usage. When initializing WiFi and BLE together, the ESP32 always runs low on both flash and heap memory. Thanks to h2zero's NimBLE library this version of the code is now better usable. Here a comparison of the identical code, one time using ESP32 BLE library and second time using NimBLE-Arduino library
RAM: [== ] 17.7% (used 58156 bytes from 327680 bytes)
Flash: [======== ] 76.0% (used 1345630 bytes from 1769472 bytes)
RAM: [= ] 14.5% (used 47476 bytes from 327680 bytes)
Flash: [======= ] 69.5% (used 911378 bytes from 1310720 bytes)
Internal Total heap 259104, internal Free Heap 91660
Internal Total heap 290288, internal Free Heap 182344
PlatformIO, but as the whole code is in a single file it can be easily copied into a .ino file and used with the Arduino IDE
- Elecrow ESP32 WIFI BLE BOARD WROOM
- Any Android phone or tablet that is capable of BLE.
- Use of BLE for sending and receiving data
- PlatformIO ID64 - ArduinoJson by Benoit Blanchon
- NimBLE-Arduino