Giter Site home page Giter Site logo

esp-idf-canbus-monitor's Introduction

esp-idf-CANBus-Monitor

Monitor Canbus traffic.

USBCAN-V800

Background

Windows application for monitoring CANBus is published here.
This tool is designed to be used with this hardware.
bazaar487719_1

So, I made the hardware side with ESP32.

Application structure

+-------------+           +-------------+           +-------------+            +-------------+
| Windows     |           |   USB-TTL   |           |             |            | SN65HVD23x  |
| Application |<--(USB)-->|  Converter  |<--(TTL)-->|    ESP32    |<--(TWAI)-->|   CAN-BUS   |<--(CAN BUS)-->CAN Network
|             |           |             |           |             |            | Transceiver |
+-------------+           +-------------+           +-------------+            +-------------|

Software requirement

esp-idf v4.2-dev-2243 or later.
Use twai(Two-Wire Automotive Interface) driver instead of can driver.

Hardware requirements

  1. Windows PC
    Windows applications can be downloaded here.

  2. USB-TTL Converter
    ESP32 development board has USB.
    This USB connects to Linux and is used for writing the firmware and displaying the LOG.
    Need converter to connect with Windows PC.

Converter ESP32
RXD -- GPIO4
TXD -- GPIO5
GND -- GND
  1. SN65HVD23x CAN-BUS Transceiver
SN65HVD23x ESP32
D(CTX) -- GPIO21
GND -- GND
Vcc -- 3.3V
R(CRX) -- GPIO22
Vref -- N/C
CANL -- To CAN Bus
CANH -- To CAN Bus
RS -- GND(*1)

(*1) N/C for SN65HVD232

  1. Termination resistance
    I used 150 ohms.

Test Circuit

   +-----------+ +-----------+ +-----------+ 
   | Atmega328 | | Atmega328 | |   ESP32   | 
   |           | |           | |           | 
   | Transmit  | | Receive   | | 21    22  | 
   +-----------+ +-----------+ +-----------+ 
     |       |    |        |     |       |   
   +-----------+ +-----------+   |       |   
   |           | |           |   |       |   
   |  MCP2515  | |  MCP2515  |   |       |   
   |           | |           |   |       |   
   +-----------+ +-----------+   |       |   
     |      |      |      |      |       |   
   +-----------+ +-----------+ +-----------+ 
   |           | |           | | D       R | 
   |  MCP2551  | |  MCP2551  | |   VP230   | 
   | H      L  | | H      L  | | H       L | 
   +-----------+ +-----------+ +-----------+ 
     |       |     |       |     |       |   
     +--^^^--+     |       |     +--^^^--+
     |   R1  |     |       |     |   R2  |   
 |---+-------|-----+-------|-----+-------|---| BackBorn H
             |             |             |
             |             |             |
             |             |             |
 |-----------+-------------+-------------+---| BackBorn L

      +--^^^--+:Terminaror register
      R1:120 ohms
      R2:150 ohms(Not working at 120 ohms)

Install

git clone https://github.com/nopnop2002/esp-idf-CANBus-Monitor
cd esp-idf-CANBus-Monitor
make menuconfig
make flash

Configure

config-1

config-2

How to use

  • Write firmware to ESP32.
  • Connect ESP32 and Windows PC using USB-TTL Converter.
  • Start a Windows application.

User manual

See here.

CAN receive message transfer

CAN receive messages are broadcast using UDP.
You can use recv.py.
USBCAN-501

esp-idf-canbus-monitor's People

Contributors

nopnop2002 avatar bmk74 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.