Flashing Firmware
Prerequisites
Section titled “Prerequisites”- ESP-IDF v5.x installed
- ESP32-CAM-MB carrier board (recommended) or USB-to-serial adapter
- LoRa module disconnected from GPIO 1/3 during flashing
Build for hardware
Section titled “Build for hardware”# Use the hardware sdkconfig defaultscp sdkconfig.defaults sdkconfig.defaultsidf.py set-target esp32idf.py buildThe hardware config enables WiFi, BLE, PSRAM, and the OTA partition table.
Flash via ESP32-CAM-MB
Section titled “Flash via ESP32-CAM-MB”If using the carrier board with CH340G USB-to-serial:
idf.py -p /dev/ttyUSB0 flash monitorThe MB board handles the boot mode (GPIO0 pulled low) and reset automatically.
Flash via external USB-to-serial adapter
Section titled “Flash via external USB-to-serial adapter”If using a bare ESP32-CAM without the MB board:
-
Connect the adapter:
- Adapter TX → ESP32-CAM RX (GPIO3)
- Adapter RX → ESP32-CAM TX (GPIO1)
- Adapter GND → ESP32-CAM GND
- 5V → ESP32-CAM 5V
-
Enter flash mode:
- Connect GPIO0 to GND
- Press the RST button (or cycle power)
- GPIO0 can be released after boot
-
Flash:
Terminal window idf.py -p /dev/ttyUSB0 flash -
Run (normal mode):
- Disconnect GPIO0 from GND
- Press RST again
Connecting the LoRa module
Section titled “Connecting the LoRa module”After flashing, connect the RYLR module to the ESP32-CAM:
| ESP32-CAM Pin | RYLR Pin | Function |
|---|---|---|
| GPIO1 (TX) | RXD | ESP32 transmits to module |
| GPIO3 (RX) | TXD | Module transmits to ESP32 |
| 3.3V | VDD | Power (RYLR runs at 3.3V) |
| GND | GND | Ground |
Startup sequence
Section titled “Startup sequence”After power-on (normal mode, K1 not held):
- Initialize NVS
- Load LoRa config from NVS (or use defaults)
- Check if WiFi is provisioned
- If not provisioned → start BLE provisioning (use ESP SoftAP Provisioning app)
- Connect to WiFi
- Start remote syslog logging
- Initialize RYLR LoRa module via AT commands
- Start camera-to-LoRa pipeline task
Serial monitor
Section titled “Serial monitor”If the LoRa module is not yet connected, you can still use the serial console:
idf.py -p /dev/ttyUSB0 monitorPress Ctrl+] to exit the monitor.