esp-rs/book

Add a detailed tutorial creating a non-trivial application

Opened this issue · 4 comments

Walking people through implementing a real-world project using Rust would likely help jumpstart many people's progress. One suggestion was a camera web server, or we could do a Wi-Fi lightbulb project or something similar.

  • std
  • no_std

I'm working on something similar that is not on github yet, and which I informally call the "mega-demo".

My idea for the mega-demo is to just be a WiFi Routing/Repeater, as that does not require any additional hardware, so any board would work:

  • Basically, the WiFi will work simultaneously in WiFi AccessPoint mode, as well as in WiFi STA mode and would serve as a wireless extender of sorts, but on layer 3 instead of layer 2, due to restrictions in the WiFi ESP-IDF implementation. More or less a Rust-ified copy of https://github.com/martin-ger/esp32_nat_router
  • Might extend it with optional Ethernet support as well, now that all Ethernet drivers are also supported by esp-idf-svc

Now, the concrete use case of the demo is not that important, as I want to demo the other details. The stuff that basically transforms a "proof of concept" into an actual, working firmware that can be upgraded and integrated with smart home software:

  • It should have a WiFi ssid/password provisioning mechanism. The initial one should be based on the WIP captive portal, we might extend later with other provisioning capabilities
  • It should have over-the-air update mechanism, based on the WIP OTA Rust wrappers as well as the WIP GitHub-based OTA server implementation
  • Needless to say, it would need the (new) HTTP server Rust wrappers, the Wifi wrappers, the Eth wrappers and the NVS storage wrappers
  • The provisioning and management UI is planned to be based on Bulma and Yew and will be part of the firmware itself. If Yew turns out to be too heavy of a dependency I might switch to plain JavaScript. All of this to happen in the edge-frame project
  • The communication of the UI with the server should be based on these WIP APIs
  • Undecided yet: It might have an MQTT and/or mDNS+COAP story for sending statistics and controlling the router (to some extent) via smart home software like Home Assistant or OpenHAB

Once we have this, it should be easy to tailor this project into whatever specific hardware the user wants to support with it. I have the feeling, the hardware-specific stuff would be the minority of the code, the rest could just be re-used from this project. :)

But as you can imagine, lots of work, and lots of moving parts. Can easily take a few months.

Help greatly appreciated!

Hey there!

I'd be an eager consumer of such a tutorial. Especially I'd like to learn how to use Rust with OTA on my ESP32, preferably in a way that I can build+deploy using a button in VS-Code.

Hey there!

I'd be an eager consumer of such a tutorial. Especially I'd like to learn how to use Rust with OTA on my ESP32, preferably in a way that I can build+deploy using a button in VS-Code.

One year later, we still don't have a detailed tutorial for a non-trivial application, but at least we do have the foundations of the application that should be the basis of the tutorial.

Given how much the design of the above application has deviated from the original "mega demo" plan from above, I think it needs its own book though - which can be referred from here of course.

Hey there, I thought I'd share my success with esp-rs + OTA here, maybe somebody else stumbling over this ticket might appreciate the relatively simple sample (~340 loc at the moment) including documentation how to use the OTA implementation:
https://gitlab.com/thomas351/esp32-rust-playground