{"id":13612501,"url":"https://github.com/playfulFence/esp-clock","last_synced_at":"2025-04-13T12:32:02.590Z","repository":{"id":41092185,"uuid":"499959811","full_name":"playfulFence/esp-clock","owner":"playfulFence","description":"Implementation of clock on ESP chips and Rust(std). Will be re-implemented as a facility monitoring system on bare-metal Rust","archived":false,"fork":false,"pushed_at":"2023-02-23T15:14:26.000Z","size":589423,"stargazers_count":15,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T20:42:29.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/playfulFence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-04T23:43:32.000Z","updated_at":"2024-08-04T08:36:04.000Z","dependencies_parsed_at":"2024-01-14T04:44:03.223Z","dependency_job_id":"bb498850-f615-46e6-b15b-2d7a3b6dbff2","html_url":"https://github.com/playfulFence/esp-clock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playfulFence%2Fesp-clock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playfulFence%2Fesp-clock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playfulFence%2Fesp-clock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playfulFence%2Fesp-clock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playfulFence","download_url":"https://codeload.github.com/playfulFence/esp-clock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714606,"owners_count":21149926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:00:30.832Z","updated_at":"2025-04-13T12:32:02.242Z","avatar_url":"https://github.com/playfulFence.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":["`std`"],"readme":"# esp-clock :crab:\n\nThis project was inspired by the [rusty-clock](https://github.com/TeXitoi/rusty-clock) project\n\n\nThe 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.\n\nGenerally, 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\nso you have two possibilites how to run this project:\n\n* On the RUST-BOARD itself, enabling the `esp32c3_rust_board_ili9341` feature, in `Cargo.toml` file.\nOn-board sensors will be used.\n* Using another chip (list of availible configurations somewhere below), activating the corresponding feature in `Cargo.toml` file.\n\n\u003eYou can learn more about RUST-BOARD [here](https://github.com/esp-rs/esp-rust-board)\n\n\n\u003cbr\u003e\n\n\n\u003e### **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\n\u003e### MQTT measurements sender is implemented [here](https://github.com/playfulFence/esp32-mqtt-publish) also by myself and of course it's also for RUST-BOARD since this project is dedicated to it\n\n\n\u003cbr\u003e\n\n## Hardware\n\n### ESP32-C3-RUST-BOARD\nThe basic use case for this project involves the use of a RUST-BOARD and [ILI9341](https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf) display.\n\n### Used pins\n| ILI9341 |    ESP-RUST-BOARD   |\n----------|---------------------|\n| RST     | GPIO3               |\n| CLK     | GPIO6               |\n| D_C     | GPIO21              |\n| CS      | GPIO20              |\n| MOSI    | GPIO7               |\n\u003cbr\u003e\n\n### ESP32-С3-RUST-BOARD with ILI9341 display\n\n\n\u003ca data-flickr-embed=\"true\" href=\"https://www.flickr.com/photos/196173186@N08/52242796290/in/dateposted-public/\" title=\"esp-clock_esp-rs-logo\"\u003e\u003cimg src=\"https://live.staticflickr.com/65535/52242796290_71cf2364e2_o.png\" width=\"550\" height=\"543\" alt=\"esp-clock_esp-rs-logo\"\u003e\u003c/a\u003e\n\n\u003ca data-flickr-embed=\"true\" href=\"https://www.flickr.com/photos/196173186@N08/52242317203/in/dateposted-public/\" title=\"esp-clock_working\"\u003e\u003cimg src=\"https://live.staticflickr.com/65535/52242317203_4c06ea1c69_o.png\" width=\"550\" height=\"543\" alt=\"esp-clock_working\"\u003e\u003c/a\u003e\n\n\n\u003e### [Corresponding Wokwi project](https://wokwi.com/projects/336529450034266706)\n\n\u003cbr\u003e\n\n## Features\n\n- Enable `esp32c3_rust_board_ili9341` feature if you want to use RUST-BOARD and it's on-board sensors with `ili9341` display\n- Enable `esp32c3_ili9341` if you're using `ESP32-C3` board and `ili9341` display **OR** if you want to use RUST-BOARD with **MQTT-messaging** to receive temperature and humidity from another RUST-BOARD\n- Enable `esp32s3_ili9341` if you're using `ESP32-S3` board and `ili9341` display\n- Enable `esp32s2_ili9341` if you're using `ESP32-S2` board and `ili9341` display\n- Enable `esp32s3_usb_otg` if you're using `ESP32-S3-USB-OTG` board and `ili9341` display\n\u003e **Warning**\n\u003e\n\u003e  Not optimized yet.\n- Enable `esp32s2_usb_otg` if you're using `ESP32-S2-USB-OTG` board and `ili9341` display\n\u003e **Warning**\n\u003e\n\u003e  Not optimized yet.\n\n\u003cbr\u003e\n\n\u003e### **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](https://github.com/playfulFence/esp-clock/blob/main/src/main.rs#L169-L177) lines of code\n\n\n\u003cbr\u003e\n\n## Plans\n- [ ] Model a box :alarm_clock:\n- [ ] Make some kind of a monitoring system with the ability to place several sensors(RUST-BOARDS) over the room/building/whatever\n- [ ] Optimize project for other targets (`ESP32-S3-BOX`, `ESP32-S2-Kaluga-1`, `ESP32-S2-HMI-DevKit-1`)\n- [ ] [Grafana](https://grafana.com) integration :bar_chart:\n- [ ] [Slint](https://slint-ui.com) integration :pager:\n\n\u003cbr\u003e\n\n## Dev Containers\nThis repository offers Dev Containers supports for:\n-  [Gitpod](https://gitpod.io/)\n   - [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/playfulFence/esp-clock/tree/gitpod-wokwi-simulation)\n-  [VS Code Dev Containers](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container)\n-  [GitHub Codespaces](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace)\n\u003e **Note**\n\u003e\n\u003e In order to use Gitpod the project needs to be published in a GitLab, GitHub,\n\u003e or Bitbucket repository.\n\u003e\n\u003e In [order to use GitHub Codespaces](https://github.com/features/codespaces#faq)\n\u003e the project needs to be published in a GitHub repository and the user needs\n\u003e to be part of the Codespaces beta or have the project under an organization.\n\nIf using VS Code or GitHub Codespaces, you can pull the image instead of building it\nfrom the Dockerfile by selecting the `image` property instead of `build` in\n`.devcontainer/devcontainer.json`. Further customization of the Dev Container can\nbe achived, see [.devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference).\n\nWhen using Dev Containers, some tooling to facilitate building, flashing and\nsimulating in Wokwi is also added.\n### Build\n- Terminal approach:\n\n    ```\n    scripts/build.sh  [debug | release]\n    ```\n    \u003e If no argument is passed, `release` will be used as default\n\n\n-  UI approach:\n\n    The default build task is already set to build the project, and it can be used\n    in VS Code and Gitpod:\n    - From the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl-Shift-P` or `Cmd-Shift-P`) run the `Tasks: Run Build Task` command.\n    - `Terminal`-\u003e `Run Build Task` in the menu.\n    - With `Ctrl-Shift-B` or `Cmd-Shift-B`.\n    - From the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl-Shift-P` or `Cmd-Shift-P`) run the `Tasks: Run Task` command and\n    select `Build`.\n    - From UI: Press `Build` on the left side of the Status Bar.\n\n### Flash\n\n\u003e **Note**\n\u003e\n\u003e When using GitHub Codespaces, we need to make the ports\n\u003e public, [see instructions](https://docs.github.com/en/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#sharing-a-port).\n\n- Terminal approach:\n  - Using `flash.sh` script:\n\n    ```\n    scripts/flash.sh [debug | release]\n    ```\n    \u003e If no argument is passed, `release` will be used as default\n\n- UI approach:\n    - From the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl-Shift-P` or `Cmd-Shift-P`) run the `Tasks: Run Task` command and\n    select `Build \u0026 Flash`.\n    - From UI: Press `Build \u0026 Flash` on the left side of the Status Bar.\n- Any alternative flashing method from host machine.\n\n\n### Wokwi Simulation\nWhen using a custom Wokwi project, please change the `WOKWI_PROJECT_ID` in\n`run-wokwi.sh`. If no project id is specified, a DevKit for esp32c3 will be\nused.\n\u003e **Warning**\n\u003e\n\u003e  ESP32-S3 is not available in Wokwi\n\n- Terminal approach:\n\n    ```\n    scripts/run-wokwi.sh [debug | release]\n    ```\n    \u003e If no argument is passed, `release` will be used as default\n\n- UI approach:\n\n    The default test task is already set to build the project, and it can be used\n    in VS Code and Gitpod:\n    - From the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl-Shift-P` or `Cmd-Shift-P`) run the `Tasks: Run Test Task` command\n    - With `Ctrl-Shift-,` or `Cmd-Shift-,`\n        \u003e **Note**\n        \u003e\n        \u003e This Shortcut is not available in Gitpod by default.\n    - From the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) (`Ctrl-Shift-P` or `Cmd-Shift-P`) run the `Tasks: Run Task` command and\n    select `Build \u0026 Run Wokwi`.\n    - From UI: Press `Build \u0026 Run Wokwi` on the left side of the Status Bar.\n\n\u003e **Warning**\n\u003e\n\u003e  The simulation will pause if the browser tab is in the background.This may\n\u003e affect the execution, specially when debuging.\n\n#### Debuging with Wokwi\n\nWokwi offers debugging with GDB.\n\n- Terminal approach:\n    ```\n    $HOME/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gdb target/riscv32imc-esp-espidf/debug/esp_clock -ex \"target remote localhost:9333\"\n    ```\n\n    \u003e [Wokwi Blog: List of common GDB commands for debugging.](https://blog.wokwi.com/gdb-avr-arduino-cheatsheet/?utm_source=urish\u0026utm_medium=blog)\n- UI approach:\n    1. Run the Wokwi Simulation in `debug` profile\n    2. Go to `Run and Debug` section of the IDE (`Ctrl-Shift-D or Cmd-Shift-D`)\n    3. Start Debugging by pressing the Play Button or pressing `F5`\n    4. Choose the proper user:\n        - `esp` when using VS Code or GitHub Codespaces\n        - `gitpod` when using Gitpod\n        \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FplayfulFence%2Fesp-clock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FplayfulFence%2Fesp-clock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FplayfulFence%2Fesp-clock/lists"}