Difference between revisions of "ESP-WROOM-02 flashing and applications"
Jump to navigation
Jump to search
| Line 8: | Line 8: | ||
=== Flashing instructions === | === Flashing instructions === | ||
| − | # Connect to the Jetson module over | + | # Connect to the Jetson module over SSH (or using remote desktop if it is set up) |
# Allow the user to access to serial ports(replace <<USERNAME>> by your username): | # Allow the user to access to serial ports(replace <<USERNAME>> by your username): | ||
#: <code>sudo usermod -aG dialout <<USERNAME>></code> | #: <code>sudo usermod -aG dialout <<USERNAME>></code> | ||
Revision as of 23:30, 29 October 2021
The onboard ESP-WROOM-02 module can be programmed with any custom firmware to provide highly flexible 2.4GHz Wi-Fi functionality. The module can for example be used to provide a data interface to the Jetson module over Wi-Fi, or to provide a Wi-Fi beacon that transmits flight characteristics to comply with French drone laws, see e.g. https://github.com/khancyr/droneID_FR.
ESP firmware flashing
The ESP-WROOM-02 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.
Flashing instructions
- Connect to the Jetson module over SSH (or using remote desktop if it is set up)
- Allow the user to access to serial ports(replace <<USERNAME>> by your username):
sudo usermod -aG dialout <<USERNAME>>
- Reboot:
sudo reboot
- Connect again to the Jetson module.
- Make sure that the user has access to the gpios (by default) and to the serial ports. To do so, type
groupsin the terminal, it should return a list which includesgpioanddialout. - Stop and disable the service nvgetty already using the serial port:
sudo systemctl stop nvgettysudo systemctl disable nvgetty
- You may update the packages (if you don't, it might return an error on the next installation step on a fresh install):
sudo apt update
- Install pip for Python3:
sudo apt install python3-pip
- Install virtualenv (tool to create isolated Python environments):
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- The name of the current virtual environment will appear on the left of the prompt (e.g.
(env)) to let you know that it’s active.
- Install esptool (https://github.com/espressif/esptool) using pip:
pip install esptool
- Flash the ESP using the demo code (it can be replaced by the name of your binary).
./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 "Open.OC 2" should appear on Wi-Fi capable devices:
- To exit the Python virtual environment:
deactivate
Troubleshooting
- If the access point "Open.OC 2" does not show up but there is an access point named "ESP-02E96A" (or similar), it is likely that the default firmware is still running and that the module didn't get flashed.