Giter Club home page Giter Club logo

2can's Introduction

2CAN is both hardware and software

Hardware: Atmel AT90CAN32 + Microchip MCP2515 + FTDI FT232R Software: embedded (avr-gcc) + host (python/tornado) + UI (HTML5/websockets)

The goal is to build a flexible CAN analyzer which can be inserted in-line in a working CAN environment for the purposes of reverse-engineering an existing network. To facilitate this, frames are captured going in both directions, and individual frames can be filtered out to observe how the system behavior is affected.

Host Software Overview

The python script '2con.py' is both an interactive debug console and the HTTP server for the UI.

It requires Python 2.6. I am using a native Windows python build and not the one with Cygwin.

When run you should see something like this:

C:\p4_2\2can>python 2con.py
Found device 0 named 2CAN
{'serial': 'AHUT0TGP', 'type': 5, 'id': 67330049, 'description': '2CAN'}
Virtual COM port is COM3
Opened serial port COM3

2con.py uses a python library for the FTDI USB to serial chip that is windows specific. It is called PyUSB and it wraps the FTDI D2XX drivers for Python.
This is not strictly necessary; the main purpose it serves is to automatically detect which emulated serial port the 2CAN is connected to. Above you can see it determined automatically that COM3 was the correct port by enumerating all FTDI chips and looking for the one with the matching device description.

Download PyUSB 1.6 here

Install Python 2.6

Install setuptools

Install Tornado:

C:\Python26\Scripts>easy_install tornado

Install sockjs: git clone git://github.com/mrjoes/sockjs-tornado C:...GitHub\sockjs-tornado>python setup.py install

TODO: details on programming FTDI chip to have '2CAN' as the device description.

Web Interface

2con.py starts a web server on port 8888. Connect to http://localhost:8888 with a modern browser that supports websockets. Screenshot

Embedded Software

The '2can' directory contains the embedded code. '2can.avrgccproj' is the project file for AVR Studio 5. There is no Makefile. It may build with AVR Studio 6 but I have not tried it. Atmel web site with older versions for download

2can's People

Contributors

metakevin 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.