This is an example project demonstrating how to use the DATEX library on an ESP32 microcontroller. The project includes a simple application that initializes the DATEX library, and connects to a Wi-Fi network, and setup a TCP client interface to communicate with a DATEX server.
To get started with this project, you will need to have Rust installed on your system. You can install Rust using the official installer from the Rust website: https://www.rust-lang.org/tools/install
- Installing espup. This is a tool that simplifies installing and maintaining
the components required to develop Rust applications for the Xtensia and
RISC-V architectures.
cargo install espup
- Installing the necessary tool-chains
espup install --toolchain <your-desired-toolchain>`
- Setting up the environment variables for the toolchain. You can add the
following line to your shell configuration file (e.g.,
.bashrc,.zshrc):source "$HOME/export-esp.sh"
- Rename the file
.cargo/config.toml.exampleto.cargo/config.tomland update thetargetfield to match your installed toolchain.
- Install the wowki CLI tool:
curl -L https://wokwi.com/ci/install.sh | sh - Generate a new Wokwi project:
wokwi-cli init-> firmware: firmware.bin -> elf: target/xtensa-esp32s3-none-elf/release/datex-esp32-example - Generate the firmware.bin:
espflash save-image \ --chip esp32s3 \ --partition-table partitions.csv \ target/xtensa-esp32s3-none-elf/release/datex-esp32-example \ firmware.bin
- Set the WOKWI_CLI_TOKEN environment variable with your Wokwi API token
- Run the Wokwi project in CLI:
wokwi-cli run(paid license required?)
Build the project for your specific ESP32 target using the following command, e.g. for Esp32s3:
cargo build --features target_esp32s3 --target xtensa-esp32s3-none-elf --release- Connect your ESP32 device to your computer and identify the serial port it is connected to (e.g.,
/dev/tty.usbserial-210on macOS orCOM3on Windows). - Run
cargo flash-esp32,flash-esp32s3, orflash-esp32c3depending on your ESP32 device. This will build the project and flash it to your ESP32 device. Make sure to use the correct command for your specific ESP32 variant.
The config.dx file contains the DATEX endpoint configuration and Wi-Fi credentials. Update the WIFI_SSID, WIFI_PASSWORD, and WIFI_AUTH_METHOD fields with your Wi-Fi network information.
{
endpoint: @esp32,
interfaces: [
// your interfaces here
],
env: {
WIFI_SSID: "ssid",
WIFI_PASSWORD: "****",
WIFI_AUTH_METHOD: "Wpa",
}
}© unyt 2026 • unyt.org