{"id":13741906,"url":"https://github.com/Cellgalvano/ESP32_CANViewer","last_synced_at":"2025-05-08T22:32:41.921Z","repository":{"id":215965472,"uuid":"345676585","full_name":"Cellgalvano/ESP32_CANViewer","owner":"Cellgalvano","description":"A ESP32 based CAN interface for your webbrowser","archived":false,"fork":false,"pushed_at":"2021-03-08T16:19:38.000Z","size":46,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-15T12:37:08.741Z","etag":null,"topics":["can","canbus","esp32","websocket"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cellgalvano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-08T14:04:46.000Z","updated_at":"2024-07-16T05:58:30.000Z","dependencies_parsed_at":"2024-01-25T08:07:00.302Z","dependency_job_id":"61301f18-27f5-4eb9-9ac2-0b6052545fa6","html_url":"https://github.com/Cellgalvano/ESP32_CANViewer","commit_stats":null,"previous_names":["cellgalvano/esp32_canviewer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cellgalvano%2FESP32_CANViewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cellgalvano%2FESP32_CANViewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cellgalvano%2FESP32_CANViewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cellgalvano%2FESP32_CANViewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cellgalvano","download_url":"https://codeload.github.com/Cellgalvano/ESP32_CANViewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253158504,"owners_count":21863313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["can","canbus","esp32","websocket"],"created_at":"2024-08-03T04:01:03.916Z","updated_at":"2025-05-08T22:32:41.628Z","avatar_url":"https://github.com/Cellgalvano.png","language":"C++","funding_links":[],"categories":["Hardware"],"sub_categories":["Espressif Systems (ESP8266, ESP32)"],"readme":"# ESP32 CANViewer\nA ESP32 based CAN interface for your webbrowser\n\n### Super basic webclient\n![](basic_gui_sc.png)\n\n## Requirements\n### Libraries\n- [Arduino CAN (Adafruit fork)](https://github.com/adafruit/arduino-CAN) or [Arduino CAN](https://github.com/sandeepmistry/arduino-CAN)\n- [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer)\n- [arduinoWebSockets](https://github.com/Links2004/arduinoWebSockets)\n- [ArduinoJson](https://arduinojson.org/)\n\n### Hardware\n- ESP32\n- 3.3V CAN Transceiver e.g. SN65HVD230\n\n## Setup\n1. Download the required libraries\n2. Compile sketch and upload\n3. Use the [ESP32 Sketch Data Upload Plugin](https://github.com/me-no-dev/arduino-esp32fs-plugin) to upload the data folder\n\n## What should work?\n### Server\nThe ESP32 tries to connect to your specified WIFI network. If no connection is possible it will start an access point.  \nOn port 80 a simple webserver is available that serves the index.html.  \nThe communication works via websockets on port 1337.  \n\nThe websockets accepts JSON strings.  \nCurrently the following commands are implemented on the server side:  \n- SEND: `{\"cmd\":\"SEND\", \"id\":1, \"dlc\":4, \"data\":[4,5,6,7]}`  \ncreates a CAN packet with ID 0x1 and the four data bytes\n- SETFILTER: `{\"cmd\":\"SETFILTER\", \"id\":8, \"mask\":2047}`  \nsets the CAN acceptance filter to ID 0x8 and the MASK to 0x7FF (I don't know how to reset the filter so you need to reset the ESP in order to clear it)\n- SETSPEED: `{\"cmd\":\"SETSPEED\", \"speed\":125000}`  \nresets the CAN library and configures the desired speed (there are no plausibilty checks included from my side, use a valid speed)\n\nThe server broadcasts a STATUS message every second:   \n`{\"ts\":1234,\"type\":\"STATUS\",\"baudrate\":500000,\"filterId\":-1,\"filterMask\":-1}`  \nts: timestamp (Arduino millis)  \ntype: message type = STATUS  \nbaudrate: current baudrate  \nfilterId: currently set filter id (-1 means no filter set)  \nfilterMask: currently set filter mask (-1 means no filter set)  \n\nWhenever a CAN packet gets received a message gets broadcasted:  \n`{\"ts\":1234,\"type\":PACKETTYPE,\"dlc\":LENGTH,\"data\":[1,2,3,4,5,6,7,8]}`  \nts: timestamp (Arduino millis)  \ntype: message type\n- STD: Standard CAN Frame\n- EXT: Extended CAN Frame\n- RTR: Remote Transmission Request\n- ERTR: Extended Remote Transmission Request  \n\ndlc: Data Length Code = 1-8 Bytes  \ndata: 0-8 Bytes of payload data, only in STD and EXT Frames  \n\n### Client\nThe client is currently just a super simple first try. It just creates a HTML table with all received packets and is pretty ugly.\nIn javascript there are more functions available than what the GUI represents:  \n- `setSpeed(speed)`  \ne.g. setSpeed(125000); sets a baudrate of 125KBit/s\n- `setFilter(id, mask)`  \ne.g. setFilter(0x8, 0x7FF); sets the filter to only receive packets with id 0x8\n- `sendPacket(id, dataArray)`  \ne.g. sendPacket(0x8, [1,2,3,4,5]); sends a five byte CAN packet with id 0x8 and the content 1,2,3,4,5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCellgalvano%2FESP32_CANViewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCellgalvano%2FESP32_CANViewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCellgalvano%2FESP32_CANViewer/lists"}