An alarm clock using an ESP32-C3 written with Rust and Embassy
Main repository is hosted at CodeBerg
This project is still a work in progress
- Uses external RTC to keep time and to set alarms
- Connects to (S)NTP to correct RTC time
- 16x2 LCD Screen
- Remote control via Web Server
- [WIP] Remote control via Bluetooth
- [WIP] Volume control via PWM
- ESP32-C3 Mini
- DS3231 RTC Module
- Breadboard Power Supply
- IRLZ44N Logic-Level MOSFET
- 3-12V Active Buzzer
- Flyback diode
- A10K Potentiometer
- A bunch of resistors and wires (ofc)
The documentation and resources I had to read while making this project is honestly quite fragmented and all over the place. So here are the quick links
Honestly it's a lot of going back and forth between docs.rs and the
GitHub examples of the various crates. It's not uncommon for me
to have at least 30+ tabs open. I went back and forth between:
- Example project: A similar project
- esp-hal examples: By far the most useful and informative
- embassy_sync
- impl Rust for ESP32
- esp-radio docs
- embassy-net docs
- TrouBLE docs
- TrouBLE examples
- smoltcp docs: Most logic is done through
embassy-netthat reuses somesmoltcptypes - Website GET
- TrouBLE Starting Code
- esp-hal sntpc example: This single line handles DHCP for embassy
- esp-hal sntpc example: Also a single line (assuming you setup Stack correctly)
smoltcp DNS example: Not that useful in my case
Sync our alaram clock to correct time
- esp-hal sntpc embassy
- sntpc docs
- sntpc embassy example: Example uses std but useful for learning how to implement traits
Our nifty external RTC module
Timezones are pain
- jiff Timezones: Jiff is so much nicer and ergonomic to work with compared to chrono
- chrono Datetime
- chrono NaiveDatetime
It seems rather daunting but I was able to do most of the wireless features in 2 days. From zero knowledge about GATT, interfaces, SNTP and stacks, to barely enough to use them.
