ESP-WROOM-02 flashing and applications

From Take-Air Wiki
Revision as of 19:28, 18 October 2021 by Joost.Weijs (talk | contribs)
Jump to navigation Jump to search

The onboard ESP-WROOM-02 module can be programmed with any custom firmware to provide highly flexible 2.4GHz Wifi functionality. The module can for example be used to provide a data interface to the Jetson module over wifi, or to provide a Wifi beacon that transmits flight characteristics to comply with French drone laws, see e.g. https://github.com/khancyr/droneID_FR.

ESP firmware flashing

The module is connected over UART to the Jetson module. In normal operation this UART interface can be used to communicate between the Jetson and the ESP, but it is also used for flashing new firmware to the ESP. To do so, follow the instructions below.

Pre-requisite installs

Esptool is required for flashing, follow the instructions below to install it:

  1. If pip is not installed on your system, install it using:
    $ sudo apt install python-pip
  2. Some extra dependencies:
    $ sudo apt install libssl-dev
  3. Install setuptools-rust:
    $ pip install setuptools-rust
  4. Install the esp toolkit:
    $ pip install esptool

A script for automatic flashing is available, download it using:

$ git clone https://github.com/TakeAirRobotics/OpenOC2_ESPFlash.git; cd OpenOC2_ESPFlash/

Flashing the ESP

  1. Login to the Jetson module using ssh (or remote desktop, if it is set up)
  2. Locate the firmware binary to upload, or transfer it from another system using for example scp
    An example binary that toggles a GPIO pin (blink.bin) is included in the repository for testing purposes
  3. Flash the ESP, replace blink.bin with the name of your binary.
    $ sudo ./OOC2_ESPFlash.sh blink.bin
  4. Follow the onscreen instructions.