Building A Weather Display In Rust

We’ve seen a lot of weather displays over the years, and plenty of the more modern ones have been using some form of electronic paper. So what makes this particular build from [Harry Stern] different? The fact that the firmware running on the ESP32 microcontroller at its heart was developed in Rust.

The weather station itself is capable of operating for several months on its rechargeable NiMH battery bank. The Rust section of the project is in two parts, the first of which runs on a server which downloads the weather data and aggregates it into an image. The second part runs on the ESP32 using esp-idf which configures peripherals, turns on and connects to Wi-Fi, retrieves the image from the server, displays the image and then puts the display to sleep. By doing the heavy lifting on the server, the display should be able to run for longer than it would if everything was happening on the ESP32.

The project code is available from this GitHub page which should allow even Rust beginners to follow along, and the case file is also available for those with a 3D printer. [Harry] has a few upgrades planned for future releases as well, including a snap-fit case, a custom PCB, and improved voltage regulator for better battery life, and enhanced error handling for the weather API. And Rust isn’t the only interesting part of this project, either. As prices for e-paper displays continue to fall, more and more of them are found in projects like weather stations and even complete laptops which use these displays exclusively.

21 thoughts on “Building A Weather Display In Rust

    1. I think it’s because it’s exciting to see it be applied. More developers want to see a bigger job market for it, so talking about it further proves to the market it’s ready for production and should be used for all possible (good) applications. Embedded rust is still a baby to some of the market so I’m personally excited to see what people do with it.

  1. I don’t understand why this ridiculous programming language is so overrated. How does writing in Rust help us now? Why are people dying to use this language that looks so bad and has ridiculous syntax when there are already mature languages?

    1. I guess it’s popular because of :
      “Rust is blazingly fast and memory-efficient: with no runtime or garbage collector, it can power performance-critical services, run on embedded devices, and easily integrate with other languages.
      Rust’s rich type system and ownership model guarantee memory-safety and thread-safety — enabling you to eliminate many classes of bugs at compile-time.” [https://www.rust-lang.org]

      The syntax appears to be just as ridiculous as any other languages.

    2. I wouldn’t have been so hyperbolic, but that’s more-or-less what I thought about rust before trying it. I was a C/++ (mostly C) firmware engineer for ~8 years before I tried rust. I’ve now been using it full time at work for a little over a year, and you’d have to threaten my life to get me to give up rust.

      I love C, it was the first language I did anything useful in, I worked with it full time for nearly a decade, and it will never fully go away, and I don’t think it should go away completely. On the other hand, rust is a better language, the ecosystem is healthier, and the tooling is so much better that it’s not even a competition. None of that should be surprising, if tooling hadn’t gotten better since the dawn of C it would be a sad commentary about the software industry. The only thing rust currently lacks that is important for (some) embedded projects is a certified tool chain, though people are working on that.

      I recommend you give it a try, for a couple solid weeks. Even if you don’t end up switching, the perspective is useful.

  2. The syntax is truly ugly, I cannot understand why anyone would like to type more to do the same things that C does.

    That aside, I would’ve shifted regardless if the safety features were as great as the community always seems to claim but I am yet to see a single embedded program in rust which does not include unsafe code (which defeats the point of using it entirely).

  3. I’m hoping Rust is just another fad which will go away. I’ve yet to see an example of Rust offering something Ada cannot, while Ada is “human readable”. Perhaps too much misinformation about Ada blasted in the content forums? The compile time checks are awesome, and the runtime checks can be turned on or off. The compiler is based on gcc/llvm and produces executables as similar to having compiled C so can’t even complain about it producing poor code. Really at a loss TBH.

    1. Rust will never ‘go away’. Just like Fortran, Ada, Pascal, C, C++, Java, Python, Perl, JavaScript, Etc., there will always be those people that think ‘a’ certain language is the best ‘ever’. Right now the new fad in software development is ‘Rust’. It may fade (or not), but regardless it will never ‘go away’. That is wishful thinking :) . I prefer C/C++, Python, and Assembly myself. I’ve written some apps in Rust for fun, but not ‘taken’ with the language to convert over to it. I certainly do NOT like how it tries to force ‘style’ on you.

    1. Please add a Photo and maybe a 3 seconds GIF video. More self marketing please. The clean design looks great but not everybody reads the code to imagine whats behind it. And add a link to this article.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.