Difference between revisions of "ESP-WROOM-02 flashing and applications"
Joost.Weijs (talk | contribs) |
|||
| Line 19: | Line 19: | ||
A script for automatic flashing is available, download it using: | A script for automatic flashing is available, download it using: | ||
$ git clone https://github.com/TakeAirRobotics/OpenOC2_ESPFlash.git; cd OpenOC2_ESPFlash/ | $ git clone https://github.com/TakeAirRobotics/OpenOC2_ESPFlash.git; cd OpenOC2_ESPFlash/ | ||
| + | |||
| + | Other option: | ||
| + | # Install pip for Python3: | ||
| + | #: <code>sudo apt install python3-pip</code> | ||
| + | # Install virtualenv: | ||
| + | #: <code>sudo pip3 install virtualenv</code> | ||
| + | # Download the script for automatic flashing is available, download it using: | ||
| + | #: <code>cd ~; git clone https://github.com/TakeAirRobotics/OpenOC2_ESPFlash.git</code> | ||
| + | # Create a virtual environment using python3 in the project folder: | ||
| + | : <code> cd OpenOC2_ESPFlash</code> | ||
| + | : <code>virtualenv -p python3 env</code> | ||
| + | # Enable the virtual environment: | ||
| + | : <code>source env/bin/activate</code> | ||
| + | # Install esptool (https://github.com/espressif/esptool) using pip: | ||
| + | #: <code>pip install esptool</code> | ||
=== Demo: Flashing the ESP === | === Demo: Flashing the ESP === | ||
Revision as of 11:14, 27 October 2021
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:
- If pip is not installed on your system, install it using:
$ sudo apt install python-pip
- Some extra dependencies:
$ sudo apt install libssl-dev
- Install setuptools-rust:
$ pip install setuptools-rust
- 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/
Other option:
- Install pip for Python3:
sudo apt install python3-pip
- Install virtualenv:
sudo pip3 install virtualenv
- Download the script for automatic flashing is available, download it using:
cd ~; git clone https://github.com/TakeAirRobotics/OpenOC2_ESPFlash.git
- Create a virtual environment using python3 in the project folder:
cd OpenOC2_ESPFlashvirtualenv -p python3 env
- Enable the virtual environment:
source env/bin/activate
- Install esptool (https://github.com/espressif/esptool) using pip:
pip install esptool
Demo: Flashing the ESP
- Login to the Jetson module using ssh (or remote desktop, if it is set up)
- Locate the firmware binary to upload, or transfer it from another system using for example
scp- An example binary that toggles a GPIO pin (OpenOC2-ESPDemo.bin) is included in the repository for testing purposes. When working correctly it will broadcast a SSID named "Open.OC2".
- Flash the ESP, replace
blink.binwith the name of your binary.$ sudo ./OOC2_ESPFlash.sh OpenOC2-ESPDemo.bin
- Follow the onscreen instructions. You will be asked to close and open jumper J9 which can be found on the Jetson side of the board, near the ESP module.
- When completed, the access point should appear on WiFi capable devices: