Oh shit, I have some ESP32s from my COVID isolation AliExpress shopaholigasm.
"ESP32 ESP32-CAM WiFi"
"ESP8266 ESP32 ESP-32S"
"SX1276 ESP32 with LoRa 868MHz-915MHz"
Remember Chinese disposable brand sites tend to disappear without warning, so you always have to archive everything they have on their support sites, i.e., datasheets, code, examples, doc, diagrams, etc.
I've never worked with Rust, but I'm very familiar with ESP32+VSCode/ESP-IDF, and eager to use something more high-level but still stable enough for unattended network-connected appliances
is this a good time to learn and start writing for the ESP32 in Rust, or should I wait a little more?
It's probably fine. I started using Go (tinygo) for microcontroller projects a few years ago and haven't looked back. If people can make Go work, I'm sure Rust is fine.
Interesting. I did Wifi once but used an RP2040 with some sort of ESP32 flahshed with some firmware designed to let Android sketches use Wifi. (The actual wifi was done by another ESP32. BOM efficient? Nope. Easy? Yup. If $1 per part ever makes a difference to me, I guess I'll just use C.)
This is a very timely article, since I’ve been trying to figure out how to get Embassy to work on any of the various ESP32 boards I have this weekend.
Is there any good guide for getting Rust working on ESP32? (the old Xtensa dual core model, or the newer C3 or C6 models)
I’ve also been looking at maybe trying an RP2040 board I have, but the Getting Started[0] guide seems very incomplete. It doesn’t even seem to mention that you need a nightly build of Rust, but I’m pretty sure you do.
I also doubt that running “cargo run” is going to result in an example being loaded onto any development board, so that seems like a confusing thing to show in the guide.
For ESP chips in general, the Rust on ESP Book [0] is pretty solid. Little short. I've been playing with writing a Watchy firmware in Rust (Watchy uses the dual-Xtensa ESP32-PICO-D4), and this was a great starting point.
Rust makes use of some more advanced type features than Java has. You’ll want to focus on some of the differences between traits and interfaces. Additionally, in Java you’re probably used to a lot of runtime dynamism, this is possible in Rust, but not something you usually need to use. To understand this better, look at dyn object safety.
The biggest thing in Rust that you need to become familiar with from Java is the ownership system. First, Java is a default copy-by-reference language, whereas Rust is move by default. So learn the difference between, T, &T, and &mut T. Learning the ownership system will make you disappointed in Java’s thread-safety story. Rust makes thread safety and multiple references to values very obvious and you need to be explicit about how things should be shared. This will probably be your biggest hurtle, based on my experience.
Don't know the answer to your question, but depending on what you want out of it, I find esphome with inlined C++ more than enough for most cases (for anyone that knows how to code in general).
It's mostly declarative, like writing a kubernetes helm chart with some templating, which should be somewhat at home for web folks.
"ESP32 ESP32-CAM WiFi"
"ESP8266 ESP32 ESP-32S"
"SX1276 ESP32 with LoRa 868MHz-915MHz"
Remember Chinese disposable brand sites tend to disappear without warning, so you always have to archive everything they have on their support sites, i.e., datasheets, code, examples, doc, diagrams, etc.