Difference between revisions of "ESP-WROOM-02 flashing and applications"
Jump to navigation
Jump to search
| Line 6: | Line 6: | ||
To do so, follow the instructions below. | To do so, follow the instructions below. | ||
| − | === | + | === Flashing instructions === |
Esptool is required for flashing, follow the instructions below to install it: | Esptool is required for flashing, follow the instructions below to install it: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | # Connect to the Jetson module over ssh (or using remote desktop if it is set up) | |
| − | + | # Make sure the user has access to the serial ports (replace <username> by your username): | |
| − | + | #: <code>sudo usermod -aG dialout <username></code> | |
| − | + | # Reboot: | |
| − | # | + | #: <code>sudo reboot</code> |
| − | # You may update the packages (it might return an error on the next installation step on a fresh install): | + | # Connect again to the Jetson module. |
| + | # Stop and disable the service already using the serial port: | ||
| + | #: <code>sudo systemctl stop nvgetty</code> | ||
| + | #: <code>sudo systemctl disable nvgetty</code> | ||
| + | # You may update the packages (if you don't, it might return an error on the next installation step on a fresh install): | ||
#: <code>sudo apt update</code> | #: <code>sudo apt update</code> | ||
# Install pip for Python3: | # Install pip for Python3: | ||
#: <code>sudo apt install python3-pip</code> | #: <code>sudo apt install python3-pip</code> | ||
| − | # Install virtualenv: | + | # Install virtualenv (tool to create isolated Python environments): |
#: <code>sudo pip3 install virtualenv</code> | #: <code>sudo pip3 install virtualenv</code> | ||
# Download the script for automatic flashing is available, download it using: | # Download the script for automatic flashing is available, download it using: | ||
| Line 38: | Line 33: | ||
# Install esptool (https://github.com/espressif/esptool) using pip: | # Install esptool (https://github.com/espressif/esptool) using pip: | ||
#: <code>pip install esptool</code> | #: <code>pip install esptool</code> | ||
| − | + | # Flash the ESP using the demo code (it can be replaced by the name of your binary). | |
| − | + | #: <code>./OOC2_ESPFlash.sh OpenOC2-ESPDemo.bin</code> | |
| − | |||
| − | |||
| − | |||
| − | #: <code> | ||
# 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. | # 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: | + | # When completed, the access point "Open.OC 2" should appear on WiFi capable devices: |
[[File:ESP WIFI.png|250px]] | [[File:ESP WIFI.png|250px]] | ||
| + | |||
| + | === 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. | ||
Revision as of 14:35, 28 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.
Flashing instructions
Esptool is required for flashing, follow the instructions below to install it:
- Connect to the Jetson module over ssh (or using remote desktop if it is set up)
- Make sure the user has access to the serial ports (replace <username> by your username):
sudo usermod -aG dialout <username>
- Reboot:
sudo reboot
- Connect again to the Jetson module.
- Stop and disable the service 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
- 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 WiFi capable devices:
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.