https://github.com/keredson/rust-esp32-hello-ota
A hello world for the ESP32 with OTA (HTTP) firmware updates.
https://github.com/keredson/rust-esp32-hello-ota
Last synced: about 1 month ago
JSON representation
A hello world for the ESP32 with OTA (HTTP) firmware updates.
- Host: GitHub
- URL: https://github.com/keredson/rust-esp32-hello-ota
- Owner: keredson
- Created: 2023-09-29T02:39:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-16T18:45:44.000Z (about 2 years ago)
- Last Synced: 2025-10-29T06:39:52.594Z (8 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-esp32-hello-ota
A hello world for the ESP32 with OTA (HTTP) firmware updates.
ESP32 Dev Env Setup
-----
Notes on approx. how I got it working under Ubuntu 23.04.
```
sudo apt install -y git curl gcc clang ninja-build cmake libudev-dev \
unzip xz-utils python3 python3-pip python3-venv \
libusb-1.0-0 libssl-dev pkg-config
sudo snap install rustup --classic
rustup install stable
cargo install cargo-espflash
cargo install espup
cargo add esp32s2 # for esp32 s2 mini
echo 'export PATH="$PATH:~/.cargo/bin"' >> ~/.bashrc
source ~/.bashrc
espup install
. $HOME/export-esp.sh
```
Project Init
------------
```
cargo new
```
Create `Cargo.toml`:
```toml
[package]
name = "my_project"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
```
Use
---
Set `SSID` and `PASS` in `main.rs`.
Build and deploy over serial once:
```
cargo espflash flash -p /dev/ttyUSB0
espflash monitor
```
Note the IP in the serial logs. Ex:
```
IP info: IpInfo { ip: 10.0.0.49, subnet: Subnet { gateway: 10.0.0.1, mask: Mask(24) }, dns: Some(75.75.75.75), secondary_dns: Some(75.75.76.76) }
```
For future builds, run: `deploy.sh `
*Deploy will not exit, but it will be obvious when done. Just ctrl-c. Ex:*
```
* We are completely uploaded and fine
< HTTP/1.1 200 OK
```
To revert to the last build, run: `curl -X POST http://10.0.0.49/revert`