https://github.com/matiasvlevi/esp32-ws-car
Control an esp32 robot with Oxenode client scripts through WebSockets
https://github.com/matiasvlevi/esp32-ws-car
esp32 javascript oxenode robots visual-scripting websockets
Last synced: 13 days ago
JSON representation
Control an esp32 robot with Oxenode client scripts through WebSockets
- Host: GitHub
- URL: https://github.com/matiasvlevi/esp32-ws-car
- Owner: matiasvlevi
- License: mit
- Created: 2023-11-18T03:07:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-27T04:01:38.000Z (over 1 year ago)
- Last Synced: 2025-06-13T06:08:37.801Z (13 days ago)
- Topics: esp32, javascript, oxenode, robots, visual-scripting, websockets
- Language: C
- Homepage: https://github.com/oxenode/
- Size: 30.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esp32-ws-car
This is proof of concept for my upcoming project [Oxenode](https://oxenode.io/).
### Repository contains:
* An esp32s3 firmware.
Provides a set of commands called through websocket buffers, allowing a web client to control the device. [See more](./firmware/README.md)* An [Oxenode](https://oxenode.io/) plugin. Provides bindings for sending instructions through websockets. Acts as a web client to the esp32 firmware. [See more](./oxenode/esp32-ws-car/README.md)
## Robot & Hardware
The firmware is meant to be used with an `ESP32-S3-DevKitC-1`, wired to a `l298` motor controller and an `HC-SR04` ultrasound sensor.
![]()
Close Up | Top View
:-------------------------:|:-------------------------:
 | 
## Oxenode Client Script
#### Plugin CDN
```
https://cdn.jsdelivr.net/gh/matiasvlevi/esp32-ws-car@latest/oxenode/esp32-ws-car
```### Websocket creation
We first need to establish a connection with our end device.

We can use the `Websocket Create` node from the `oxenode-std-ws` plugin to create a reference to a websocket and store it in a global variable.
### Key down event (WASD controls)
We can use a `Switch` node to match keys to motor websocket commands
To prevent spamming our end device with the same commands, we add an if codition checking if the key was repeated.

notice that we need to supply the socket reference since the nodes in this plugin use WebSockets under the hood.
### Key up event (Stopping motors)
Do not forget to add a way to stop.

We send a brake command to the end device when the user releases a key
---
License MIT