[Ru]st [E]lectronic [D]atalogger - my explorations into an embedded, async, real-world project
This is heavily inspired by ruwm by ivmarkov.
If you have questions, find me on Discord in the #embedded
channel or in #esp-rs
on Matrix
With any IoT 'stack', there are some rudimentary basics; this repo is an attempt at building these out using the embedded_svc library and its family of crates from Espressif, such as esp-idf-svc, esp-idf-sys, and esp-idf-hal.
Done? | Feature | Notes |
---|---|---|
[X] | RTOS: High priority executor | |
[X] | Wifi | |
[X] | Httpd server with TLS | |
[X] | Httpd server Middleware | Added to provide JSON responses for matching Content-Type headers |
[X] | SNTP | *Fallback to RTC is pending |
[X] | Ext. RTC | RV8803 module used. |
[Testing] | Display: I2C | **Requires further testing. |
[X] | Display: SPI | ili9342 fully tested. |
[Testing] | SD/MMC Card: SPI | **Requires further testing. |
[Testing] | ADC: Battery voltage | |
[X] | MQTT | |
[X] | OTA | Ref: https://github.com/bsodmike/rued-mqtt-client |
- Install rustup, preferrably in linux. Using an x86 CPU will help a great deal. Attempts on an Apple M1 Max failed terribly for me.
- Build your ESP toolchain by following: https://github.com/esp-rs/rust-build or even better use
espup
. - Run
cargo +esp build --release
- Use the following:
// flash
scp 10.0.3.70:~/esp/rued/partitions.csv . \
&& scp 10.0.3.70:~/esp/rued/target/xtensa-esp32-espidf/release/rued-esp32 . \
&& espflash flash --baud 920000 --monitor rued-esp32 --partition-table partitions.csv
// monitor for stack-traces
scp 10.0.3.70:~/esp/rued/target/xtensa-esp32-espidf/release/rued-esp32 . && espflash monitor --baud 115200 --elf rued-esp32
// You will need to restart the chip
Add the following to settings for rust-analyzer
{
"rust-analyzer.server.extraEnv": {"LIBCLANG_PATH": "/home/mdesilva/.espressif/tools/xtensa-esp32-elf-clang/esp-15.0.0-20221014-x86_64-unknown-linux-gnu/esp-clang/lib/"},
}
espup install --esp-idf-version 5.0
export LIBCLANG_PATH=$HOME/.espressif/tools/xtensa-esp32-elf-clang/esp-15.0.0-20221014-x86_64-unknown-linux-gnu/esp-clang/lib/
# cd into your app root
cargo clean
rm -rf .embuild
cargo build --release
# check for `~/.espressif/esp-idf/release-v5.0`
This project implements SemVer. Please pay attension to Major version changes as these largely include backwards incompatible changes introduced to the public API.