I have an Arduino Uno fitted with my v1.2 CAN Bus shield. It initializes regardless of whether or not it’s connected with CAN-H&L wires and the baudrate set. When I do connect the CAN wires, it’s directly tapped from the vehicle (not OBD port), and the RX light blinks constantly. CAN.checkReceive never changes, it’s always CAN_NOMSG and I haven’t been able to get a message yet.
The PWR light is solid when arduino is plugged in.
I tried disconnecting the resistor from P1 and quickly realized this is not a solution to my problem, so I resoldered the resistor back in.
I have the arduino plugged in via usb and CAN-H and CAN-L wires attached to the bus. The switch is on, though I doubt it’ll have any effect on receiving messages.
Reversing the L and H wires yields no change in results.
The Shield always initializes as long as the SCI pin is set to 9.
I’ve used a bunch of default sketches, including every supported baudrate from the library, all with the same issue.
What must I do to get messages from my vehicle?
One of the sketches I’m using:
[code]#include <SPI.h> #include “mcp_can.h”
MCP_CAN CAN(9); // necessary to initialize
void setup()
{
Serial.begin(115200);
START_INIT:
if(CAN_OK == CAN.begin(CAN_125KBPS)) // I've tried them all
{
Serial.println("CAN BUS Shield init ok!");
}
else
{
Serial.println("CAN BUS Shield init fail");
delay(100);
goto START_INIT;
}
The entirety of the output is “CAN BUS Shield init ok!”
If I print CAN.checkReceive in the loop it always returns 4 (CAN_NOMSG) and never 3 (CAN_MSGAVAIL) even when the RX light is blinking, tested with each baudrate.
Did you find out the solution? I have exactly the same problem. I own Can Bus Shield v.1.2 and all things match your problem. Now I’m wondering if something is wrong with the shield? No much support available…
I’ve got CAN BUS INIT OK regardles off connection status, even if the wires are not connected to car CAN network. When I connect to OBD2 port CANH, CANL I get some message, which changes when I turn on my ignition, so I guess it’s ignition/battery status. But it doesn’t matter. I want to connect to another CAN Network, so I connect to CANH, CANL bus on my PDC module. Orange led is blinking, so I believe there is some traffic on the network. I tried all available speeds, with no results. My CAN bus uses 500kbps, but it also doesn’t work on any other. It always returns CAN_NOMSG.
I tried to understand the chipset documentation, and it seems that there is no need to use any mask/filter functions, and the shield should return all messages by default. I also tried to play with these functions - no results. The shield is totally useless for now.
Can anybody help what is wrong? I don’t think the problem is related with software as the API is quite simple. I’d rather say it’s something wron with the hardware.
First of all I checked my car’s CAN network documentation and figured out that each device within my network has buil-in termination resistor 820ohms. I started to dig more about termination resistors in CAN networks and most of them use 120ohm resistors at the beginning and end of the network. My networks seems to be different. As I said - the network documentation provided by car manufacturer was crucial. I’d not expect that I need to use exactly 820ohm resistor.
Can Bus shield v 1.2 has buil-in resistor called “R3” 62ohms (120ohms in 1.1 version), which I decided to desolider. Unfortunately not lot of documentation in this matter… Then I connect my car network to the shield in this way:
So we need to put the resistor between CANH, CANL. Now everything works fine, new LED on the shield started to blink. Read about termination restistors, figure out how the physical layer of your neetwork looks like, remove the standard 62ohm resistor (it works between two shield, but can’t imagine it works in any other car…) I did the car sniffing successfully.
I’m glad you figured it out, can I ask how you found the value of the terminating resistor? I’ve looked all through my factory service manual and haven’t found anything; I just know that without R1 my dashboard lit up like a christmas tree, and the car isn’t affected when it’s soldered in. I tried tapping in to the wires with the module plugged in (hoping that if it’s a resistance problem, the resistor would be built in and I could just tap into the network without resistance) but it had no changes.
I really have no idea on what to try next unless I tried random resistors in hopes that one would work and solve the problem, if that’s it.
The LED RX blinks quickly and the TX a bit less frequently. Is that all that should happen when correctly connected with a CAN bus? Or should the INT light also have activity?
Now that I think about it, it’s a network it can’t actually be shorted right? Does that mean it was working without the resistor but I just had the wrong speed, messing up everything?
You should remove R3 resistor (not R1 you mentioned) or break connection of P1 (I couldn’t do this with knife, according to documentation, so decided to desolder R3 resistor).
I’ve found BUS specification of my car (I treat it as miracle) and there was one sentence that catched my attention: “All devices within the network are terminated by the resistors”. I started to dig more and found one more document (another miracle) with the resistance of each bus system. This way I figured out, that my bus (100kbps) require 820ohm resistor in each device connected to the network (some other devices uses 1020ohms). Although, some other BUS in my car (fastest ones, with speed 500kbps) don’t use termination resistors in each device, but at the edges of the networks (don’t know the resistance, I guess 120ohms) - I think you tested this case (if you desolder R3 not R1), if the resistors are at the edges of the network, it should work without R3 resistor.
I don’t remember which leds are blinking exactly, but at the beginning, only green/yellow led was active (strong light), and the orange led was blinking or in better words: it was trying to blink - the light was significantly weaker than green/yellow one. After removing R3 resistor and putting new 820ohm resistor between CANL and CANH, it blinks much more stronger with additional orange led (so as far as I remember I have 3 leds active right now).