Skip to content

Duet3D/WiFiSocketServerRTOS

Repository files navigation

WiFiSocketServerRTOS

Firmware for Espressif Wi-Fi modules on Duet boards. Based on DuetWiFiSocketServer, but ported to the newer ESP8266 RTOS SDK and ESP-IDF.

Build

Building the project generates DuetWiFiServer.bin or DuetWiFiModule_*.bin used for M997 S1. ESP8266, ESP32, ESP32-S3 and ESP32-C3 are supported.

Makefile (recommended)

The Makefile-based build handles all targets and SDK setup automatically. Prerequisites:

  1. Install virtualenv for 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
  1. 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
  1. 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
  1. Build:
user@pc:/path/to/WiFiSocketServerRTOS$ make all

Available 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

ESP8266 (manual)

Terminal (Linux/macOS)

  1. 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.

  2. Clone ESP8266 RTOS SDK dwss_support branch. 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
  1. Navigate to the ESP8266 RTOS SDK directory and execute the install script.
user@pc:/path/to/ESP8266_RTOS_SDK$ ./install.sh
  1. Export environment variables for the current terminal session.
user@pc:/path/to/ESP8266_RTOS_SDK$ . ./export.sh
  1. Navigate to this directory and execute the make command. Exit and save the configuration when prompted. Once the build finishes, DuetWiFiServer.bin will be in the build directory.
user@pc:/path/to/WiFiSocketServerRTOS$ make -f Makefile.esp8266

Terminal (Windows)

  1. Download the pre-packaged MSYS environment and toolchain. Extract both to a directory on your system (recommend C:\ for the pre-packaged MSYS environment, and C:\msys32\opt for the toolchain).

  2. Clone ESP8266 RTOS SDK dwss_support branch. 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
  1. Open a MINGW32 terminal (located at C:\msys32\mingw32.exe if the pre-packaged MSYS environment was extracted to C:\ as recommended).

  2. Using the MINGW32 terminal,

    • Set IDF_PATH to where the ESP8266 RTOS SDK was extracted and add the toolchain binary directory (/opt/xtensa-lx106-elf/bin if the toolchain was extracted to C:\msys32\opt as recommended) to PATH.
    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
    
  3. Navigate to this directory and execute the make command. Exit and save the configuration when prompted. Once the build finishes, DuetWiFiServer.bin will be in the build directory.

user@pc MINGW32 /path/to/WiFiSocketServerRTOS
$ make -f Makefile.esp8266

Eclipse

Follow 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.

ESP32 / ESP32-S3 / ESP32-C3 (manual)

Terminal (Windows/macOS/Linux)

  1. Setup ESP-IDF according to your platform: Linux/macOS, Windows. Use the Duet3D esp-idf, dwss_support branch:

    git clone --branch dwss_support --recursive https://github.com/Duet3D/esp-idf.git
    

    On Windows, choose "Use an existing ESP-IDF repository" in the installation wizard, and point it to the resulting clone directory.

  2. Navigate to the WiFiSocketServerRTOS directory and execute the following command. Once the build finishes, DuetWiFiServer.bin will be in the build directory.

    user@pc:/path/to/WiFiSocketServerRTOS$ idf.py set-target esp32 build

    Note: Replace esp32 with the actual target chip

IDE (Windows/macOS/Linux)

Eclipse and VSCode are supported through plugins. Read more about the plugin setup and build process on the docs page.

Links

Forum Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors