Buenas, tengo un problema a la hora de conectarme a mi seat ibiza 2010 a través del can Bus, en principio he tenido una serie de problemas ya solucionados, pero les resumo como tengo montado todo y lo que me ocurre:
- Arduino uno
- CAN-BUS Shield de SparkFun con sus respectivos pines
- CAN-Low y CAN-High conectados desde los pines de la shield a los pines del coche.
Mi problema es que al ejecutar el código, debería empezar a ver todos los paquetes que circulan por la red CAN, pero no consigo leer nada, la consola serie simplemente me muestra "CAN BUS Init", pero no me muestra los paquetes ni nada de información...
Les dejo el código:
/*
* ------ CAN Bus Basic Example --------
*
* This sketch shows how to send data through CAN Bus standard.
*
* Copyright (C) 2014 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Version: 0.1
* Implementation: Luis Antonio Martin & Ahmad Saad
*/
// Include always these libraries before using the CAN BUS functions
#include <CAN.h>
#include <SPI.h>
// ID numbers
#define IDWAITED 200
#define OWNID 100
// Create an instance of the object
CAN myCAN = CAN();
// Setting up our devices and I/Os
void setup() {
// Inits the UART
Serial.begin(115200);
delay(100);
// Let's open the bus. Remember the input parameter:
// 1: 1Mbps
// 500: 500Kbps <--- Most frecuently used
// 250: 250Kbp
// 125: 125Kbps
myCAN.begin(125);
}
void loop() {
//****************************************
// 1. Receive data
//****************************************
if (myCAN.messageAvailable() == 1) {
// Read the last message received.
myCAN.getMessage(&myCAN.messageRx);
// Print in the serial monitor the received message
myCAN.printMessage(&myCAN.messageRx);
}
}