Home

Awesome

ESP32 CANViewer

A ESP32 based CAN interface for your webbrowser

Super basic webclient

Requirements

Libraries

Hardware

Setup

  1. Download the required libraries
  2. Compile sketch and upload
  3. Use the ESP32 Sketch Data Upload Plugin to upload the data folder

What should work?

Server

The ESP32 tries to connect to your specified WIFI network. If no connection is possible it will start an access point.
On port 80 a simple webserver is available that serves the index.html.
The communication works via websockets on port 1337.

The websockets accepts JSON strings.
Currently the following commands are implemented on the server side:

The server broadcasts a STATUS message every second:
{"ts":1234,"type":"STATUS","baudrate":500000,"filterId":-1,"filterMask":-1}
ts: timestamp (Arduino millis)
type: message type = STATUS
baudrate: current baudrate
filterId: currently set filter id (-1 means no filter set)
filterMask: currently set filter mask (-1 means no filter set)

Whenever a CAN packet gets received a message gets broadcasted:
{"ts":1234,"type":PACKETTYPE,"dlc":LENGTH,"data":[1,2,3,4,5,6,7,8]}
ts: timestamp (Arduino millis)
type: message type

dlc: Data Length Code = 1-8 Bytes
data: 0-8 Bytes of payload data, only in STD and EXT Frames

Client

The client is currently just a super simple first try. It just creates a HTML table with all received packets and is pretty ugly. In javascript there are more functions available than what the GUI represents: