NOTE: This project is just a small example to prove this is possible. The code in this repo was mostly written in a single afternoon with the motivation of "get this somehow working". Maybe I'll rewrite it some day for a much cleaner version with better abstraction.
Sending protcolbuffers between the browser and an ESP32 via WebSerial.
This project uses the following software:
- nanopb for using protocolbuffers on the esp32 within the arduino framework using some glue from eric-wieser/nanopb-arduino.
- protobuf.js to use protocolbuffers in the web application interface.
- Web Serial API to get both the ESP32 and Web Interface talking via Serial. This is only supported on chrome-based browsers (last check: 2024-05-03).
- Protocol Buffers as the base idea of protocol to make this communication.
git clone https://github.com/oltdaniel/webserial-protobuf-example.git
cd webserial-protobuf-example
NOTE The boards need to supported USB OTG.
Open the repository in VSCode and flash the current project. All dependencies will be downloaded automatically.
Steps to get started with the project:
- Open the
web
directory of this repo. - Start the dev server with
yarn dev
.
Steps to compile the new proto file:
- Install all dependencies using
yarn
. - Compile the protobuffer file using
yarn proto:build
.