2.1 KiB
2.1 KiB
title, date, draft, description, tags
| title | date | draft | description | tags | ||
|---|---|---|---|---|---|---|
| Firmware Upload | 2025-01-27 | false | a description |
|
From Source
Preconditions
- Rust: Current version of
rustup. - ESP32 Toolchain:
espupinstalled and configured. - espflash: Installed via
cargo install espflash. - Node.js:
npminstalled (for the web interface).
Flashing via USB
- Connect the MainBoard to your computer via USB.
- Ensure the board is powered and not in deep sleep.
- Build the web interface (only required once or if you changed something in
src_webpack):cd Software/MainBoard/rust/src_webpack npm install npx webpack cd .. - Flash the firmware:
Note: If the flashing fails, you might need to put the ESP32-C6 into bootloader mode by holding the BOOT button while resetting or connecting USB.
espflash flash --monitor --partition-table partitions.csv
Simplified Flashing with Scripts
You can use the provided bash scripts to automate the build and flash process:
./flash.sh: Cleans temporary files, builds the web interface, compiles the firmware, and flashes it to the board../all.sh: Similar toflash.sh, but also saves a localimage.binof the firmware.
OTA (Over-the-Air) Update
You can also update the firmware wirelessly if the system is already running and connected to your network.
- Generate the OTA binary:
cargo build --release - The binary will be at
target/riscv32imac-unknown-none-elf/release/plant-ctrl2. - Open the PlantCtrl web interface in your browser.
- Navigate to the OTA section.
- Upload the
plant-ctrl2file. - The system will reboot into the new firmware once the upload and verification are complete.
Troubleshooting
- Bootloader Partition: If the bootloader is currently booting from
ota_2, flashing to the factory partition via USB might not automatically switch the active partition. You can useespflash erase-parts otadatato reset the OTA state. - Serial Terminal: Use
espflash monitorto view the serial logs for debugging.