Giter Site home page Giter Site logo

arduino-canhacker's Introduction

CanHacker (lawicel) CAN adapter on Arduino + MCP2515

Use that Library to communicate with MCP2515

Features

Implement communication with CAN bus via MCP2515 by CanHacker (lawicel) protocol.

  • send & receive can frames
  • supports standart (11 bit) & extended (29 bit) frames
  • supports remote frames (RTR)
  • supports filter by ID (mask + code)
  • interface using Stream: ability to work with Serial, SoftwareSerial, Ethernet and other
  • supported can baudrates from 10Kbps up to 1Mbps
  • supported modules with different oscillators (8, 16, 20 MHz), 16 MHz is default, use setClock if your oscillator is not 16MHz
  • support CanHacker (application for Windows)
  • support CANreader (application for Android)

Documentation

English

Русский

Library Installation

  1. Install MCP2515 Library
  2. Download the ZIP file from https://github.com/autowp/arduino-canhacker/archive/master.zip
  3. From the Arduino IDE: Sketch -> Include Library... -> Add .ZIP Library...
  4. Restart the Arduino IDE to see the new "canhacker" library with examples

Testes with Arduino Nano. On Arduino Uno have problem with too long boot period and losing first command

Contributing

Feel free to open issues, create pull requests and other contributions

arduino-canhacker's People

Contributors

autowp avatar bigjohnson avatar dvv avatar lordware avatar thero0t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-canhacker's Issues

Not receiving any data.

Hi

I have made appropriate changes to use 8Mhz crystal but unfortunately, I don't see any data in receiver.

I am not sure what's wrong with my code. Can you please guide me to debug the issue or any ways to figure out the problem.

Just to add: I am using Arduino uno

No data over CAN

Hello. Use two Arduinos: leonardo and mega 2560 with similar shield

For Leonardo in sketch change pins assignment to:

const int SPI_CS_PIN = 9;
const int INT_PIN = 2;

CANHacker successfully connect to arduino, seeing FW version, but there no data from CAN on any speed. Check arduino serial monitor - nothing
Sketch compiled with Arduino IDE 1.8.19

Check this issue, but already have 16MHz oscillator.

After 30 seconds arduino freezes

I can send and receive data only for a brief moment, after 30 seconds everything stops and i have to click disconnect and connect in CANHacker program to start receiving and sending data again. I mainly use this for gauge cluster diagnostics but when i connect this to a can network on my car it works only for 1 second. Is there something i can do to receive data without stopping? Sorry for poor English

mcp2515 со скоростью 83.333

Здравствуйте, Дмитрий! Подскажите пожалуйста, пытаюсь подключиться к interior can шине mercedes w220 ардуиной мега с can shield, чтобы посмотреть пакеты. Шина работает на частоте 83.333 кбит/с. Программа для просмотра canhacker. Соответственно, там такой скорости нет. На просторах интернета нашел программу mbtime для моего контроллера. Для необходимой скорости она мне выдает следующие параметры tq=8, brp-1=11, osc1=192, %err=83.333 Как их привести к необходимому виду для внесения в ручном режиме в canhacker не могу понять.

id 29bit

Добрый день! Дмитрий, когда я запускаю Canhacker, то не вижу сообщения c длинными id, только с трехзначными. При использовании Canreadera все ОК. Я использую скорость 33 kbps.

GMLAN 33.3kbps ?

I tried to connect to GMLAN (swcan 33.3kbps) but I couldn't. In CANHACKER's settings window there are 10kb 50kb etc but there is no 33.3kbps.

It wants btr0 and btr1 values.

How can I connect to GMLAN with 33.3kbps speed?

Problem with SavvyCAN

When i want to use my Arduino Nano and MCP2515 8MHz with SavvyCan v208, i need to enter manually the command S2 and O to receive the CAN-Messages.

Can anyone help me?

By using CANable there is no problem

Extended can id error.

Hi,

Thanks for your hard work.

When I send extended can id ex: 0x0CF50401 the CAN MODULE actually sends 0x0EF50401

In CanHacker.cpp changed line 97.

CanHacker::ERROR CanHacker::writeCan(const struct can_frame *frame) {
    if (mcp2515->sendMessage(MCP2515::TXB1,frame) != MCP2515::ERROR_OK) { //added MCP2515::TXB1, 0x0CF50401
        return ERROR_MCP2515_SEND;
    }

    return ERROR_OK;
}

PS: Don't know about std ids only use ext.

компиляция для ESP32

Здравствуйте, Дмитрий. Хотел запустить ваш проект на ESP32, "прикрутить" к нему bluetooth. При компиляции скетча дает ошибку по библиотекам, выбираешь плату Nano3 - ошибок нет. Я так понимаю надо править библиотеку(и)? Возможно сделать версию для ESP32/ESP8266?

Data with higher DLC

How do I capture data with more than 8 DLC as example below, in the case of dtc 1 - dtc 5 it only displays dtc1 with dlc 8 and not able to see dtc 2 unless I clear the first fault.

BO_ 2566834942 DM1: 22 Vector__XXX
SG_ FlashRedStopLamp : 12|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ FlashProtectLamp : 8|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ FlashMalfuncIndicatorLamp : 14|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ FlashAmberWarningLamp : 10|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ MalfunctionIndicatorLampStatus : 6|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ AmberWarningLampStatus : 2|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ RedStopLampState : 4|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ ProtectLampStatus : 0|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ DTC5 : 144|32@1+ (1,0) [0|4294967295] "" Vector__XXX
SG_ DTC4 : 112|32@1+ (1,0) [0|4294967295] "" Vector__XXX
SG_ DTC3 : 80|32@1+ (1,0) [0|4294967295] "" Vector__XXX
SG_ DTC2 : 48|32@1+ (1,0) [0|4294967295] "" Vector__XXX
SG_ DTC1 : 16|32@1+ (1,0) [0|4294967295] "" Vector__XXX

ESP32 + SN65HVD232

Hello.

Is there any chance to have the library also working for ESP32 + SN65HVD232.

I tried SLCAN I can manage to connect to canhacker but never receive send correct values. ARDUINO NANO +MCP works very well.

I guess there is an issue with the packing/data format of the output can protocol.

Can.h

I can't find can.h file.

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.