Firmware for Espressif Wi-Fi modules on Duet boards. Based on DuetWiFiSocketServer, but ported to the newer ESP8266 RTOS SDK and ESP-IDF.
Building the project generates DuetWiFiServer.bin or DuetWiFiModule_*.bin used for M997 S1. ESP8266, ESP32, ESP32-S3 and ESP32-C3 are supported.
The Makefile-based build handles all targets and SDK setup automatically. Prerequisites:
- Install
virtualenvfor Python. On distributions that enforce PEP 668 (Arch Linux, Fedora, etc.), this must be installed via the system package manager:
# Arch Linux
sudo pacman -S python-virtualenv
# Debian/Ubuntu
sudo apt install python3-virtualenv
# Fedora
sudo dnf install python3-virtualenv- Clone the SDKs as sibling directories:
user@pc:/path/to$ git clone --branch dwss_support --recursive https://github.com/Duet3D/ESP8266_RTOS_SDK.git
user@pc:/path/to$ git clone --branch dwss_support --recursive https://github.com/Duet3D/esp-idf.git- Run the install scripts in each SDK to set up toolchains and Python environments:
user@pc:/path/to/ESP8266_RTOS_SDK$ ./install.sh
user@pc:/path/to/esp-idf$ ./install.sh- Build:
user@pc:/path/to/WiFiSocketServerRTOS$ make allAvailable targets:
| Target | Output |
|---|---|
make ESP8266 |
ESP8266/DuetWiFiServer.bin |
make ESP32 |
ESP32/DuetWiFiModule_32.bin |
make ESP32S3 |
ESP32S3/DuetWiFiModule_32S3.bin |
make ESP32C3 |
ESP32C3/DuetWiFiModule_32C3.bin |
make all |
Build all of the above |
make clean |
Clean all build outputs |
make clean-all |
Clean all build outputs and SDK build artifacts |
Run make help for the full list of targets and options. Use V=1 for verbose output.
SDK paths default to ../ESP8266_RTOS_SDK and ../esp-idf and can be overridden:
user@pc:/path/to/WiFiSocketServerRTOS$ make ESP32 ESP_IDF=/path/to/esp-idf-
Install the pre-requisites for your platform: Linux, macOS. Note that you might need additional/different packages depending on your system. For example, on systems which transitioned to Python 3, you might need
python3-pip python-is-python3 python3-serial(or the equivalent for your package manager) instead. -
Clone ESP8266 RTOS SDK
dwss_supportbranch. Make sure the path to the SDK has no spaces.
user@pc:/path/to$ git clone --branch dwss_support --recursive https://github.com/Duet3D/ESP8266_RTOS_SDK.git- Navigate to the ESP8266 RTOS SDK directory and execute the install script.
user@pc:/path/to/ESP8266_RTOS_SDK$ ./install.sh- Export environment variables for the current terminal session.
user@pc:/path/to/ESP8266_RTOS_SDK$ . ./export.sh- Navigate to this directory and execute the
makecommand. Exit and save the configuration when prompted. Once the build finishes,DuetWiFiServer.binwill be in thebuilddirectory.
user@pc:/path/to/WiFiSocketServerRTOS$ make -f Makefile.esp8266-
Download the pre-packaged MSYS environment and toolchain. Extract both to a directory on your system (recommend
C:\for the pre-packaged MSYS environment, andC:\msys32\optfor the toolchain). -
Clone ESP8266 RTOS SDK
dwss_supportbranch. Make sure the path to the SDK has no spaces.
user@pc /path/to
$ git clone --branch dwss_support --recursive https://github.com/Duet3D/ESP8266_RTOS_SDK.git-
Open a MINGW32 terminal (located at
C:\msys32\mingw32.exeif the pre-packaged MSYS environment was extracted toC:\as recommended). -
Using the MINGW32 terminal,
- Set
IDF_PATHto where the ESP8266 RTOS SDK was extracted and add the toolchain binary directory (/opt/xtensa-lx106-elf/binif the toolchain was extracted toC:\msys32\optas recommended) toPATH.
user@pc MINGW32 ~ $ export IDF_PATH="/path/to/ESP8266_RTOS_SDK" user@pc MINGW32 ~ $ export PATH="/opt/xtensa-lx106-elf/bin":$PATH
- Install the Python pre-requisites.
user@pc MINGW32 ~ python -m pip install --user -r $IDF_PATH/requirements.txt - Set
-
Navigate to this directory and execute the
makecommand. Exit and save the configuration when prompted. Once the build finishes,DuetWiFiServer.binwill be in thebuilddirectory.
user@pc MINGW32 /path/to/WiFiSocketServerRTOS
$ make -f Makefile.esp8266Follow the instructions for setting up the build environment with Eclipse on Linux/macOS or Windows. Make sure to use ESP8266 RTOS SDK dwss_support branch.
Afterwards, import this project in the Import New Project step.
-
Setup ESP-IDF according to your platform: Linux/macOS, Windows. Use the Duet3D esp-idf,
dwss_supportbranch:git clone --branch dwss_support --recursive https://github.com/Duet3D/esp-idf.gitOn Windows, choose "
Use an existing ESP-IDF repository" in the installation wizard, and point it to the resulting clone directory. -
Navigate to the WiFiSocketServerRTOS directory and execute the following command. Once the build finishes,
DuetWiFiServer.binwill be in thebuilddirectory.user@pc:/path/to/WiFiSocketServerRTOS$ idf.py set-target esp32 build
Note: Replace
esp32with the actual target chip
Eclipse and VSCode are supported through plugins. Read more about the plugin setup and build process on the docs page.