Skip to content

Latest commit

 

History

History
73 lines (39 loc) · 1.83 KB

README.md

File metadata and controls

73 lines (39 loc) · 1.83 KB

esp32-ws-car

This is proof of concept for my upcoming project Oxenode.

Repository contains:

  • An esp32s3 firmware. Provides a set of commands called through websocket buffers, allowing a web client to control the device. See more

  • An Oxenode plugin. Provides bindings for sending instructions through websockets. Acts as a web client to the esp32 firmware. See more


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.

mbot-begin

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.

mbot-key

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.

mbot-key

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



License MIT