ESP32 Provisioning
OpenNMC uses the onboard ESP32 for WiFi and Bluetooth.
The first-boot flow provisions the ESP32 if the module is not already fused and flashed.
Provisioning
- the board can detect whether the ESP32 has already been provisioned
- if it has not, first boot runs
/usr/sbin/esp-hosted-factory-flash.sh - the same script can be run manually with
--forcefor re-provisioning - the image ships
esp-hosted,esp-hosted-firmware,esptool,espefuse, andespflash - the provisioning code binds and unbinds the MMC host and WiFi power-sequence driver, then flashes from
/var/firmware/espressif/esp32-sdio
Provisioning Steps
The current factory-flash flow is:
- unbind the MMC host and WiFi power sequence
- force the ESP32 into ROM bootloader mode with
ESP_nBOOT,ESP_D0, andESP_nRST - burn the flash voltage efuse to
3.3V - flash:
bootloader.binpartition-table.binota_data_initial.binnetwork_adapter.bin- remove the boot straps and reset the ESP32 back into normal mode
- rebind the power-sequence and MMC drivers
The runtime check skips flashing when esp32_sdio is already loaded and wlan0 exists.
The firmware bundle is stored on the target at /var/firmware/espressif/esp32-sdio.
Maintenance Mode
If manual re-flashing is needed later, run the same factory-flash script with --force.