AHT20 update, and my open source experience
It’s been more than two years since I released my AHT20-driver (a Rust driver for a temperature and humidity sensor). I’ve had a lot of support and friendly interactions as a result, and I’d like to highlight what a pleasant experience it’s been.
The AHT20 sensor is a temperature and humidity sensor by the company Asair. I used the Adafruit AHT20 board during development. The driver is written in Rust, which I’ve come to really enjoy programming in.
After my initial blog post about the 1.0 release, I immediately got some great advice about Rust from Adam Grieg, which helped me sort out an awkward bit of my code. Receiving this help and feedback was so very encouraging. I’d worried a bit about the kind of feedback I might receive, and getting this kind of positive and helpful comment from Adam was both a relief, and joyful.
I’ve released five versions with fixes and improvements after the initial 1.0 release.
- v1.1.0 - I added defmt logging. Helpful, but also introduced some additional steps to using the driver. My first Github issue was opened by nvankessel about this extra friction.
- v1.2.0 - added a measurement method without floating point as a result of a suggestion from Reddit user /u/SnakeHand. This is important as some microcontrollers implement floating point in software, which can be slow.
- v1.2.1 - Max Barnash (arr-ee) submitted a very useful patch for a misbehaviour, and provided some insightful and thoroughly researched troubleshooting of the issue.
- v1.2.2 - Samuel Holland (smaeul) found and fixed
a bug in the humidity calculation that evaded my testing. Andrew Straw
(astraw) added a feature flag to turn off
defmt, which fixed the issue opened bynvankessel. - v2.0.0 - Andrew Straw again provided some excellent contributions, upgrading
the driver to use the 1.0 version of the embedded HAL, and also implemented
core::error::Errorfor the code base’saht20_driver::Error<E>.
This feels like a fantastic set of advice, discussion and contributions for such a small project like my little AHT20 driver. To me, it’s felt like getting visits and gifts from my neighbours in my very niche hobby space. Neighbours from the internet.
ALl of this has been an excellent experience, and feels like it encompasses the ideals that open source is built around. I’ve scratched my own itch by writing a driver that suited my own purposes, and others have not only been able to enjoy the fruits of my labours, but have also pitched in with help in several different forms!
I’ve learnt a lot along the way, and felt very encouraged to keep at it. Thank you to Adam Grieg, nvankessel, u/SnakeHand, Max Barnash, Samuel Holland, and Andrew Straw who have so far helped me along in their various ways.
It’s also been very clear to me that I owe a great deal to the authors of the tools and educational resources that I used along the way. Tools like:
Blog posts like Ferrous Systems’ Testing a Driver Crate gave me some very straightforward and well-explained patterns to follow.
I might look into the embedded async ecosystem, but I feel that the code is otherwise in pretty good shape. I’d like to add more examples to the repository, perhaps using the Microbit, or some of the Arduino devices.
At some point my Github stars ticked over to a mighty ten, giving me double digit stars! While stars are a nicely measurable metric, what I’m actually thrilled by is the interactions I’ve had, and the thought that this software is being useful in someone else’s projects.
If you have any more feedback on my project, please get in touch. If you’ve thought about publishing something yourself in the Rust ecosystem, but worried about how it might be received, I hope you feel encouraged to release your creations.