Note 1: this is a can232 car, and you'll need those libraries for sure.
2: the radio can bus is 83.3kbps (white&orange[H]/white[L]) the canhacker id for that Baud rate is s051C
3: the diag port (via the odb2 is 500kbps, however, you need to send the right code to get through the gateway, which I don't yet know)
4: the arduino bus rate is 115200 and the uno runs at 16mhz
ID: 1A6 (steering wheel buttons)
00 00 (ready)
01 00 (menu up)
04 00 (menu down)
02 00 (menu right)
08 00 (music button)
10 00 (menu button)
20 00 (vol up)
80 00 (vol down)
40 00 (nav button)
Notes:
00 00 must follow other commands to "ready" the system
in CAN HACKER it looks like:
ID: 1A6 DLC:2 DATA:XX 00 (xx = see above table)
My Arduino Sketch: (not my code, just fixed it)
Code: Select all
/*****************************************************************************************
* This is implementation of CAN BUS ASCII protocol based on LAWICEL v1.3 serial protocol
* of CAN232/CANUSB device (http://www.can232.com/docs/can232_v3.pdf)
*
* Made for Arduino with Seeduino/ElecFreaks CAN BUS Shield based on MCP2515
*
* Copyright (C) 2015 Anton Viktorov <latonita@yandex.ru>
* https://github.com/latonita/arduino-canbus-monitor
*
* This library is free software. You may use/redistribute it under The MIT License terms.
*
* Modified by Wekiwu 2016 to omit filter and add SPI CS PIN 10
*****************************************************************************************/
#include <SPI.h>
#include "mcp_can.h"
#include "can-232.h"
#include "SoftwareSerial.h"
const int SPI_CS_PIN = 10;
MCP_CAN CAN(SPI_CS_PIN);
#define DEBUG_MODE
void setup() {
Serial.begin(LW232_DEFAULT_BAUD_RATE); // default COM baud rate is 115200.
Can232::init(CAN_83K3BPS, MCP_16MHz); // set default rate you need here and clock frequency of CAN shield. Typically it is 16MHz, but on some MCP2515 + TJA1050 it is 8Mhz
}
//I rewrote the following section to allow all ID's through
INT8U myCustomAddressFilter(INT32U addr) {
INT8U ret = LW232_FILTER_PROCESS;
return ret;
}
void loop() {
Can232::loop();
}
void serialEvent() {
Can232::serialEvent();
}