You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now actually obtain the source code and build out firmware.
mkdir $HOME/git && cd $HOME/git
git clone https://github.com/sjm42/esp32temp.git
cd esp32temp
cargo build -r
Flash it on the chip!
cargo run -r
Occasionally, we run these spells to keep our tools up to date.
rustup update
espup update
cargo install-update -a
Support for ESP32 and ESP32-C3
By default, the source code and configs are made for supporting ESP32.
Support for ESP32-C3 is easy to do with 3 changes.
in .cargo/config.toml change the target xtensa-esp32-espidf to riscv32imc-esp-espidf i.e. comment out the first one and remove the comment mark from the other
in rust-toolchain.toml comment out the channel="esp" line and remove the comment chars on two lines below the "for ESP32-C3" comment lines.
optionally in Cargo.toml change default = ["esp32s"] to default = ["esp32c3"] in the [feature] section.
Support for other ESP32 boards?
It should be easy to support almost any ESP32 versions with WiFi.
Just check the pin assignments inside src/bin/esp32temp.rs starting after line 80 (at the time of writing).
There we have an assignment to Boxed array onew_pins that will hold the pins we are probing for sensors.
Those assignments are behind feature gates aka conditional compilation and we can easily add more of them
to support new hardware variants.
Just add more features into Cargo.toml and assign the usable gpio pins accordingly and there you go.
About
Temperature measurement with ESP32 and DS18b20 sensor(s)