playfulFence / esp-clock

Implementation of clock on ESP chips and Rust(std). Will be re-implemented as a facility monitoring system on bare-metal Rust
Apache License 2.0
15 stars 3 forks source link

esp-clock :crab:

This project was inspired by the rusty-clock project

The initial goal of the project was just to implement clocks with brand new ESP32-C3-RUST-BOARD, but over time, new ideas and more use cases began to appear.

Generally, project is created to demonstrate the capabilities of the new board in the Rust language, but now I've taken the direction to create a monitoring system based on the RUST-BOARD, so ch so you have two possibilites how to run this project:

You can learn more about RUST-BOARD here


Important : every configuration other than esp32c3_rust_board_ili9341 requires Wi-Fi connection and uses MQTT messaging to revceive data from RUST-BOARD, which is measuring temperature and humidity

MQTT measurements sender is implemented here also by myself and of course it's also for RUST-BOARD since this project is dedicated to it


Hardware

ESP32-C3-RUST-BOARD

The basic use case for this project involves the use of a RUST-BOARD and ILI9341 display.

Used pins

ILI9341 ESP-RUST-BOARD
RST GPIO3
CLK GPIO6
D_C GPIO21
CS GPIO20
MOSI GPIO7


ESP32-С3-RUST-BOARD with ILI9341 display

esp-clock_esp-rs-logo

esp-clock_working

Corresponding Wokwi project


Features


Important : If you using any configuration with Wi-Fi, it will set time automatically. Also, if you're using esp32c3_rust_board_ili9341 configuration and you want to enable Wi-Fi time setting - just add --features wifi to execution command. Otherwise, you will need to set the time manually at THESE lines of code


Plans


Dev Containers

This repository offers Dev Containers supports for:

If using VS Code or GitHub Codespaces, you can pull the image instead of building it from the Dockerfile by selecting the image property instead of build in .devcontainer/devcontainer.json. Further customization of the Dev Container can be achived, see .devcontainer.json reference.

When using Dev Containers, some tooling to facilitate building, flashing and simulating in Wokwi is also added.

Build

Flash

Note

When using GitHub Codespaces, we need to make the ports public, see instructions.

Wokwi Simulation

When using a custom Wokwi project, please change the WOKWI_PROJECT_ID in run-wokwi.sh. If no project id is specified, a DevKit for esp32c3 will be used.

Warning

ESP32-S3 is not available in Wokwi

Warning

The simulation will pause if the browser tab is in the background.This may affect the execution, specially when debuging.

Debuging with Wokwi

Wokwi offers debugging with GDB.