Skip to content

Setup ESP32 WiFi credentials over BLE from Android. ESP32 source code using NimBLE

License

Notifications You must be signed in to change notification settings

beegee-tokyo/ESP32WiFiBLE-NimBLE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32 WiFi credential setup over BLE using NimBLE-Arduino

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

Lower memory usage!

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

Memory usage (compilation output)

Arduino BLE library

RAM:   [==        ]  17.7% (used 58156 bytes from 327680 bytes)    
Flash: [========  ]  76.0% (used 1345630 bytes from 1769472 bytes)    

NimBLE-Arduino library

RAM:   [=         ]  14.5% (used 47476 bytes from 327680 bytes)    
Flash: [=======   ]  69.5% (used 911378 bytes from 1310720 bytes)    

Memory usage after setup() function

Arduino BLE library

Internal Total heap 259104, internal Free Heap 91660

NimBLE-Arduino library

Internal Total heap 290288, internal Free Heap 182344


This is double the free heap for your application!


Development platform

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

Used hardware

SW practices used

  • Use of BLE for sending and receiving data

Library dependencies

About

Setup ESP32 WiFi credentials over BLE from Android. ESP32 source code using NimBLE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages