Skip to content

example of commuication with protocolbuffers between an ESP32 and Browser using WebSerial

License

Notifications You must be signed in to change notification settings

oltdaniel/webserial-protobuf-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

WebSerial Protocolbuffer example

Sending protcolbuffers between the browser and an ESP32 via WebSerial.

Preview

Components

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.

Getting started

Requirements

Install

git clone https://github.com/oltdaniel/webserial-protobuf-example.git
cd webserial-protobuf-example

Program the ESP32 Board with the firmware

NOTE The boards need to supported USB OTG.

Open the repository in VSCode and flash the current project. All dependencies will be downloaded automatically.

Prepare and start the web interface

Steps to get started with the project:

  1. Open the web directory of this repo.
  2. Start the dev server with yarn dev.

Steps to compile the new proto file:

  1. Install all dependencies using yarn.
  2. Compile the protobuffer file using yarn proto:build.

License

MIT License

About

example of commuication with protocolbuffers between an ESP32 and Browser using WebSerial

Topics

Resources

License

Stars

Watchers

Forks