{"id":15011758,"url":"https://github.com/olegccc/esp32-axum-ws","last_synced_at":"2025-06-20T06:07:01.761Z","repository":{"id":235280526,"uuid":"790441435","full_name":"olegccc/esp32-axum-ws","owner":"olegccc","description":"Rust for ESP32 with Axum and Websockets","archived":false,"fork":false,"pushed_at":"2024-04-23T09:13:10.000Z","size":19,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T06:06:41.884Z","etag":null,"topics":["axum","esp-rs","esp32","preact","rust","tokio-rs","vite"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olegccc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-22T22:10:28.000Z","updated_at":"2025-02-20T03:57:22.000Z","dependencies_parsed_at":"2024-04-22T23:31:39.150Z","dependency_job_id":"89d1bdf7-0362-422a-9b99-1c360be46f9f","html_url":"https://github.com/olegccc/esp32-axum-ws","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"cbae96e59a0163e836462cf0cf62af9ba2a4e57e"},"previous_names":["olegccc/esp32-axum-ws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olegccc/esp32-axum-ws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegccc%2Fesp32-axum-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegccc%2Fesp32-axum-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegccc%2Fesp32-axum-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegccc%2Fesp32-axum-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olegccc","download_url":"https://codeload.github.com/olegccc/esp32-axum-ws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegccc%2Fesp32-axum-ws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260891142,"owners_count":23077910,"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":["axum","esp-rs","esp32","preact","rust","tokio-rs","vite"],"created_at":"2024-09-24T19:41:36.664Z","updated_at":"2025-06-20T06:06:56.741Z","avatar_url":"https://github.com/olegccc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust for ESP32 with Axum and Websockets\n\nThis repository provides base but working functionality for ESP32 board with Rust environment\nbased on `esp-rs` project, where it runs fully functional web server based on Axum web framework\nwith the support of Websockets. Axum by itself is based on Tokio.rs asynchronous runtime. \n\nOnce you have built and run the code, it opens a web server page where you can manage state of a LED:\nturn it on and off and query its status. All the communication is done through a Websocket channel.\n\nThe `client` folder contains basic but fully functional React-based web application that knows\nto open Websocket channel and use it to communicate with the device.\n\nTested on ESP32S3 dev board (Seeed Studio XIAO ESP32S3). Note that the configured LED pin number (21) triggers physical\nLED on this board. This will work on any ESP32 board but you will need to know and adjust the pin number for your board.\n\nI don't see any reason why it may not work on any other ESP32 board with enough flash memory\n(its image size is about 2.4MB and current partition layout is set to have at least 3MB flash memory).\n\nIn general, I think it is the best of all known ways to build a secure, reliable web application that requires intensive communication\nwith ESP32 device. It is enough to write only web interface, without the need of developing mobile applications\n(however Websockets work perfectly with Android and iOS native apps, Flutter apps etc).\n\nThe fact that it is based on Tokio and Rust opens all the existing ecosystem of Rust libraries for you.\nYou can write tests and debug your app on desktop, before moving to mobile device.\n\nThis configuration works on macOS and Linux, it will require minor changes to work on Windows.\n\n## Setup build environment\n\nInstall Rust on ESP build environment\nhttps://github.com/esp-rs/rust-build\n\nInstall latest NodeJS LTS\nhttps://nodejs.org/en/download\n\nInstall Yarn\nhttps://yarnpkg.com/getting-started/install\n\n## Prepare\n\nCopy `.env.default` to `.env` and change default values to the actual ones.\n\nTo prepare the build environment, execute the following command each time you open a terminal window:\n\n`. ~/export-esp.sh`\n\n## Build\n\nTo build the project, use the following command:\n\n`cargo build`\n\nTo run the project, use the following command:\n\n`cargo run`\n\n## Reference links\n\n* Rust-ESP installation process https://github.com/esp-rs/rust-build\n* Tokio.rs asynchronous runtime https://tokio.rs/tokio/tutorial\n* Axum web application framework https://github.com/tokio-rs/axum\n* Seeed Studio XIAO ESP32S3 https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/\n* Awesome ESP Rust https://github.com/esp-rs/awesome-esp-rust\n* esp32-s3-rust-axum-example (used as a prototype for this project) https://github.com/aedm/esp32-s3-rust-axum-example/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegccc%2Fesp32-axum-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folegccc%2Fesp32-axum-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegccc%2Fesp32-axum-ws/lists"}