Rust Bare Metal implementation of ESP-Buddy based on https://github.com/espressif/esp-mdf/tree/master/examples/development_kit/buddy
Copy the code from examples to main.rs
and run ./scripts/run-wokwi.sh
.
Once the build is complete, click the link in terminal to open Wokwi simulator.
Flash the device using web flasher by command ./scripts/flash.sh
Run the base application:
cargo run --release
This is mapped by .cargo/config.toml
to command:
cargo espflash flash --release --monitor
Run animation example with:
cargo run --release --example animation
- animation - moving letters
cargo run --release --example animation
-
blinky - blink LED - not working - blocked by:
-
buttons - display state of buttons
cargo run --release --example buttons
- clock - use Wi-Fi to acquire timestamp from NTP server and display time
export SSID="replace_by_ssid"
export PASSWORD="replace_by_password"
cargo run --release --example clock
- gpio - display state of GPIOs
cargo run --release --example gpio
- rainbow - iterate over HUE and display value - not working - blocked by:
- snow - snowflakes falling
cargo run --release --example snow
- temperature - display temperature and humidity
cargo run --release --example temperature
- wifi - connect to Wi-Fi
export SSID="replace_by_ssid"
export PASSWORD="replace_by_password"
cargo run --release --example wifi
When using a custom Wokwi project, please change the WOKWI_PROJECT_ID
in
run-wokwi.sh
. If no project id is specified, a DevKit for esp32 will be
used.
-
Terminal approach:
scripts/run-wokwi.sh [debug | release]
If no argument is passed,
release
will be used as default -
UI approach:
The default test task is already set to build the project, and it can be used in VS Code and Gitpod:
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Test Task
command - With
Ctrl-Shift-,
orCmd-Shift-,
Note
This Shortcut is not available in Gitpod by default.
- From the Command Palette (
Ctrl-Shift-P
orCmd-Shift-P
) run theTasks: Run Task
command and selectBuild & Run Wokwi
. - From UI: Press
Build & Run Wokwi
on the left side of the Status Bar.
- From the Command Palette (
Wokwi offers debugging with GDB.
-
Terminal approach:
$HOME/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb target/xtensa-esp32-espidf/debug/esp_buddy_rs -ex "target remote localhost:9333"
-
UI approach:
- Run the Wokwi Simulation in
debug
profile - Go to
Run and Debug
section of the IDE (Ctrl-Shift-D or Cmd-Shift-D
) - Start Debugging by pressing the Play Button or pressing
F5
- Choose the proper user:
esp
when using VS Code or GitHub Codespacesgitpod
when using Gitpod
- Run the Wokwi Simulation in