What is this?
- Getting start project for ESP32-C3 Rust hosted at TDA.
- This project is mainly referenced from Tai Hideaki san's rust-esp32-osc-led project.
- For the instruction plase see TDA's workshop notion page
Projects
- examples/button.rs
- Button input example
- examples/button_led.rs
- Serial LED example
- examples/connect_wifi.rs
- Wifi connect example
- examples/osc_send.rs
- OSC send example
- examples/main.rs
- OSC receive and led control
Before running wifi related projects, export wifi credentials and port no.
export OSC_WIFI_SSID=LAB3
export OSC_WIFI_PASS=aabbccddeeff
export OSC_WIFI_RECV_PORT_STR=5000
export OSC_WIFI_RECV_PONG_STR=5001
# osc send port
export OSC_WIFI_SEND_PORT_STR=5100
# osc destination (PC) port
export OSC_WIFI_DEST_PORT_STR=5101
export OSC_WIFI_DEST_IP=192.168.2.100
Commands
source ~/export-esp.sh # if needed
cargo run # build & flash & monitor
cargo build --example button
cargo run --example connect_wifi
espmonitor /dev/ttyACM0
Crate
- rosc is used to encode/decode OSC packet
- smart-leds trait and its implementation ws2812-esp32-rmt-driver are used to control LEDs
Samples
- Wifi connect sequence for esp_idf_svc 0.46
- Tai Hideaki san's rust-esp32-osc-led
OSC test with OSCD
- Commandline OSC tester. You can also use other tools like TouchDesigner.
- With another terminal, run
oscd
to send OSC packet (IP should be your device's IP and PORT should beOSC_WIFI_RECV_PORT
)
cargo install oscd
oscd
Following OSC commands are available
/ping # reply /pong 1 to your_ip:OSC_WIFI_PONG_PORT from your device
/rgb r g b # set color to LED (int 0-255 are available for r, g, b)