{"id":13741877,"url":"https://github.com/PhilippFux/ESP32_CAN_Interface","last_synced_at":"2025-05-08T22:32:39.988Z","repository":{"id":54018891,"uuid":"196201478","full_name":"PhilippFux/ESP32_CAN_Interface","owner":"PhilippFux","description":"CAN_Interface for ESP32 (Cannelloni Protocol)","archived":false,"fork":false,"pushed_at":"2021-03-10T09:47:01.000Z","size":5951,"stargazers_count":52,"open_issues_count":1,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-15T12:37:08.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilippFux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-10T12:29:54.000Z","updated_at":"2024-11-14T12:47:02.000Z","dependencies_parsed_at":"2022-08-13T06:01:15.499Z","dependency_job_id":null,"html_url":"https://github.com/PhilippFux/ESP32_CAN_Interface","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippFux%2FESP32_CAN_Interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippFux%2FESP32_CAN_Interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippFux%2FESP32_CAN_Interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippFux%2FESP32_CAN_Interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippFux","download_url":"https://codeload.github.com/PhilippFux/ESP32_CAN_Interface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253158480,"owners_count":21863308,"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":[],"created_at":"2024-08-03T04:01:03.626Z","updated_at":"2025-05-08T22:32:39.181Z","avatar_url":"https://github.com/PhilippFux.png","language":"C++","funding_links":[],"categories":["Hardware"],"sub_categories":["Espressif Systems (ESP8266, ESP32)"],"readme":"# CAN-Interface ESP32\n\nWireless CAN-Interface for the ESP32 by Espressif. \nWhich uses the cannelloni protocol to send CAN-Frames via UDP over an Wi-Fi tunnel. \n\n### Features\n\n* CAN-Frame accumulation in a UDP-Package\n* send and receive CAN-Frames from a connected CAN-Bus\n* CAN Driver configuration \n* Arbitration ID filter (hardware and software)\n* python-can support\n* CAN-FD support \n* UDP support \n* [Documentation](https://esp32-can-interface.readthedocs.io/en/latest/)\n\n## Getting Started\n\nThese following instructions will help you to install and run the project on the ESP32 for development and testing purposes. \n\n### Prerequisites \n\nWhich hardware components and software are needed and how to install them \n\n#### Hardware components \n\n* ESP32 by Espressif\n* CAN-Transceiver\n* cables\n* D-SUB connector (male)\n\n#### Software \n\n* [Arduino IDE](https://www.arduino.cc/en/main/software) - The tool for flashing the ESP32\n\n### Connecting the hardware\n\n![](https://github.com/PhilippFux/ESP32_CAN_Interface/blob/master/circuit_diagram.PNG)\n\n\n\nConnect the following Pins from the ESP32 with the specified Pins of the CAN-Transceiver\n\n|          | ESP32 | CAN-Transceiver |\n| :------- | :---- | :-------------- |\n| 3.3 Volt | 3V3   | 3V3             |\n| Ground   | GND   | GND             |\n| CTX      | GPIO5 | CTX             |\n| CRX      | GPIO4 | CRX             |\n\n\n\nConnect the following Pins from the CAN-Transceiver with the specified Pins of the D-SUB connector\n\n|          | CAN-Transceiver | D-SUB connector |\n| -------- | --------------- | --------------- |\n| CAN High | CANH            | Pin 7           |\n| CAN Low  | CANL            | Pin 2           |\n\n### Install and configure the Arduino IDE\n\n1. Download and install the [Arduino IDE](https://www.arduino.cc/en/main/software)\n2. Open Preferences in the Arduino IDE ( File -\u003e Preferences )\n3. Include https://dl.espressif.com/dl/package_esp32_index.json under Additional Boards Manager URLs \n4. Open the Board Manager ( Tools -\u003e Board -\u003e Boards Manager... )\n5. Search for esp32 and install the esp32 by Espressif Systems \n6. Finish! The installation should be completed in a few seconds\n\n### Upload the Project to the ESP32\n\nConnect the ESP32 via USB with a Computer and follow the instructions\n\n1. Open the Arduino IDE \n2. Choose a ESP32 Board ( Tools -\u003e Board -\u003e ESP32 Arduino)\n3. Choose the used port ( Tools -\u003e Port: -\u003e COMx )\n4. Download the Project and open the \"CAN_Interface.ino\" ( File -\u003e Open...)\n5. Press the Upload Button in the Arduino IDE \n6. If everything went as expected a \"Done uploading.\" message should appear\n\n## Usage\n\n### Important Notice \n\nCAN-Interface is not suited for production purposes. It is not guaranteed that CAN-Frames will reach their destination or reach in the right order. Use the CAN-Interface only for purposes where packet loss is tolerable. \n\n### Example\n\n#### Preparation\n\n* Connect the SUB-D connector from the CAN-Interface with a CAN-Bus\n* Make a Wi-Fi connection between a Computer and the access point of the CAN-Interface\n\n* To start the communication with the CAN-Interface send an initialization message to the UDP-Socket\n\n#### Sending\n\n1. Open an UDP-Socket\n\n2. Build a Cannelloni Data Package containing the CAN-Frames to send (Header + encoded CAN-Frames)\n\n   ```python\n   class CANNELLONIDataPacket(object):\n       \"\"\"\n       Header for Cannelloni Data Packet\n       \"\"\"\n       def __init__(self):\n           self.version = 0\n           self.op_code = 0\n           self.seq_no = 0\n           self.count = 0\n   ```\n\n3. Send the Cannelloni Data Package via UDP to the CAN-Interface \n\n#### Receiving\n\n1. Open an UDP-Socket \n2. Receive the UDP-Packages sent from the CAN-Interface\n3. Unpack the CAN-Frames using the Cannelloni Data Package \n4. Decode the CAN-Frames\n\n## Use with python-can\n\nThe CAN-Interface can also be used with the library python-can which provides CAN support for Python. \n\n### Important Notice \n\nIn order to use the CAN-Interface with python-can, the library with support for the CAN-Interface has to be installed\n\n**TODO:  Describe the use with python-can (entered in library? y/n)**\n\n\n\n## Authors\n\n* **Philipp Fuxen** - *Initial work* - [PhilippFux](https://github.com/PhilippFux)\n\n## Acknowledgments\n\n* **cannelloni** - *SocketCAN over Ethernet tunnel* - [mguentner/**cannelloni**](https://github.com/mguentner/cannelloni)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilippFux%2FESP32_CAN_Interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPhilippFux%2FESP32_CAN_Interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhilippFux%2FESP32_CAN_Interface/lists"}