This guide explains how to use WebSocket to establish real-time, two-way communication between your computer and the robot driver board on Linux or macOS.
Unlike HTTP, WebSocket enables full-duplex communication with millisecond-level latency, making it ideal for real-time robot control, sensor monitoring, or telemetry visualization.
📦 GitHub Repository
https://github.com/EffectsMachine/robot_driver_with_esp32s3_lite
The robot driver board includes a lightweight WebSocket server that runs on port 80, sharing the same port as its HTTP interface.
The WebSocket endpoint path is fixed at /ws.
When your PC connects to ws://<ESP32_IP>:80/ws, a persistent data channel is created:
Example message:
{"T":202,"line":1,"text":"webSocket msg","update":1}
This message updates line 1 of the OLED with the text “webSocket msg”.
Make sure Python 3.10 or newer is installed.
Check your version:
python3 --version