ecu_reader_logger.cpp: In function 'void setup()':
ecu_reader_logger:159: error: 'Canbus' was not declared in this scope
ecu_reader_logger:159: error: 'CANSPEED' was not declared in this scope
ecu_reader_logger.cpp: In function 'void loop()':
ecu_reader_logger:174: error: 'Canbus' was not declared in this scope
ecu_reader_logger:174: error: 'ENGINE_RPM' was not declared in this scope
ecu_reader_logger:184: error: 'Canbus' was not declared in this scope
ecu_reader_logger:184: error: 'VEHICLE_SPEED' was not declared in this scope
ecu_reader_logger:192: error: 'Canbus' was not declared in this scope
ecu_reader_logger:192: error: 'ENGINE_COOLANT_TEMP' was not declared in this scope
ecu_reader_logger:201: error: 'Canbus' was not declared in this scope
ecu_reader_logger:201: error: 'THROTTLE' was not declared in this scope
ecu_reader_logger.cpp: In function 'void logging()':
ecu_reader_logger:223: error: 'Canbus' was not declared in this scope
ecu_reader_logger:223: error: 'CANSPEED_500' was not declared in this scope
ecu_reader_logger:262: error: 'class SdFile' has no member named 'writeError'
ecu_reader_logger:277: error: 'Canbus' was not declared in this scope
ecu_reader_logger:277: error: 'ENGINE_RPM' was not declared in this scope
ecu_reader_logger:288: error: 'Canbus' was not declared in this scope
ecu_reader_logger:288: error: 'VEHICLE_SPEED' was not declared in this scope
ecu_reader_logger:297: error: 'Canbus' was not declared in this scope
ecu_reader_logger:297: error: 'ENGINE_COOLANT_TEMP' was not declared in this scope
ecu_reader_logger:306: error: 'Canbus' was not declared in this scope
ecu_reader_logger:306: error: 'THROTTLE' was not declared in this scope
It seems to be related to the Canbus.h file but just cant work it out?
It is related to canbus.h either not being included in your sketch, or not in the proper library location. See http://www.ladyada.net/library/arduino/libraries.html for the proper way to install these (it differs between Win, Mac, and Linux). FWIW, I have the CanBus shield, and it works perfectly, but the library does have to be in the right place. Good luck!
rustybikes wrote:It is related to canbus.h either not being included in your sketch, or not in the proper library location. See http://www.ladyada.net/library/arduino/libraries.html for the proper way to install these (it differs between Win, Mac, and Linux). FWIW, I have the CanBus shield, and it works perfectly, but the library does have to be in the right place. Good luck!
Nice hint
I checked through the guide and realised there was no Library folder in my working folder. (there was a library in the install folder but not in my working one)
So I created the folder and placed the library files in there and it all worked a treat.
I also have the sparkfun canbus shield and am struggling to get it working.
I am using the same code. Instead of the lcd I am using the serial monitor. So I have the shield connected to the OBD port and a laptop connected to the arduino. (obviously the shield is mounted to the arduino)
After getting it to compile I started up the serial monitor. I get to the point where I can choose to move the joystick up, after which the i get the error "CAN Failed" and the program ends.
applehero wrote:I also have the sparkfun canbus shield and am struggling to get it working.
I am using the same code. Instead of the lcd I am using the serial monitor. So I have the shield connected to the OBD port and a laptop connected to the arduino. (obviously the shield is mounted to the arduino)
After getting it to compile I started up the serial monitor. I get to the point where I can choose to move the joystick up, after which the i get the error "CAN Failed" and the program ends.
Any help would be greatly appreciated.
What car is it being connected to?
I found VW/Audi didn't use CAN for diagnostics until about 2005. Earlier cars used a K line and the shield doesn't work throught the OBD port on these cars
I did eventually get some of it working. If you move the folder named Canbus into the libraries folder of the Arduino, it will work. Run Arduino.exe and open the ecu_code_reader in the canbus sub-menu.
I am connecting to a Renault Twingo 1.
I manage to initalise then the files are created, but are not populated with any data. Have looked at the code, can only think the module is incompatible with my car.
Having done some more investigative work, I found that the connections from the OBD connector to the D-Sub are not what I expected. The connections to the Canbus (High and Low) were for a protocol different to my own.
I soldered the wires to the correct pins. However no improvement...