Add local WebSocket relay server and ESP32 ultrasonic firmware example#4
Draft
musfaagv wants to merge 1 commit into
Draft
Add local WebSocket relay server and ESP32 ultrasonic firmware example#4musfaagv wants to merge 1 commit into
musfaagv wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
example_websocket_server/server.pyimplementing a relay server (listens onws://0.0.0.0:8765) with a connected-client registry, broadcast to other clients, payload parsing/validation, and structured error responses for invalid JSON or unknown message types.example_websocket_server/requirements.txt(websockets>=14.0,<16.0) andexample_websocket_server/README.mdwith setup and run instructions (e.g.python -m venv .venv, install deps,python server.py).example_firmware/esp32_ws_ultrasonic/esp32_ws_ultrasonic.inothat connects to configurable Wi‑Fi andws://<IP_LAPTOP>:8765, reads HC-SR04 distance (cm/inch), sends periodic JSON sensor payloads, and processes{"type":"led","state":"on"}/{"type":"led","state":"off"}commands to toggle a GPIO LED.example_firmware/README.mdwith configuration steps (SSID/password, laptop IP), pin mapping, payload examples, dependency notes, and server run steps.Testing
python -m py_compile example_websocket_server/server.pywhich completed successfully.Codex Task