Skip to content

Development

Dennis Boldt edited this page May 23, 2020 · 9 revisions

Development

Create a new configuration

  • config.h
    • Add config variable to Config-Struct
  • config.ino
    • Add new variable to loadConfiguration
    • Add new variable to saveConfiguration
    • Add new variable to printConfiguration
  • configServer.h
    • Add new variable to HTML template
  • configServer.ino
    • Add new variable to the corresponding handler function, to save it
  • Use the new config variable in the code

Install esptool

git clone [email protected]:espressif/esptool.git
cd esptool/

Detect maximum flash size with esptool (Ubuntu)

./esptool.py --port /dev/ttyUSB0 flash_id | grep "flash size"

Detected flash size: 4MB

The ESP32 has 4MB flash memory!

Flash binary with esptool (Ubuntu)

  • Install esptool:
  • Download the newest release.
  • Connect a microUSB cable directly to the ESP32 (the USB-C port at the case is only for charging the battery)
  • Detect the correct port:
    ls /dev/ttyUSB*
  • Run the flash command:
    ./esptool.py \
      --chip esp32 \
      --port /dev/ttyUSB0 \
      --baud 921600 \
      --before default_reset \
      --after hard_reset write_flash \
      0x10000 ~/Download/OpenBikeSensorFirmware.ino.esp32.bin

Hint:

At a 0x10000 (64KB) offset in the flash is the app labelled “factory”. The bootloader will run this app by default.

See: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html

Clone this wiki locally