CAN BUS Problem Receiving with Serial

Hello, I am having trouble reading CAN messages through my Arduino Uno paired with an ElecFreaks CAN BUS Shield.

I am trying to read CAN BUS messages from an instrument cluster. I have CAN-H and CAN-L hooked up to the shield from the cluster.

I have the Arduino set to Com3 and the serial from the shield to Com4. When I monitor Com4 with the serial monitor, I am only receiving backwards question marks.

I have also tried opening a Putty session on Com4 and I am getting blocks that quickly fill up the window. I am sure that I am receiving data from the instrument cluster because when I turn off power to it, the data stops. When I turn it back on, it starts receiving again.

I am guessing this is a Baud Rate issue but I have tried several different rates, with no noticeable changes.

I am using the Seeed Can Bus libraries with the following code:

// demo: CAN-BUS Shield, receive data with check mode
// send data coming to fast, such as less than 10ms, you can use this way
// loovee, 2014-6-13


#include <SPI.h>
#include "mcp_can.h"


// the cs pin of the version after v1.1 is default to D9
// v0.9b and v1.0 is default D10
const int SPI_CS_PIN = 9;

MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin

void setup()
{
    Serial.begin(115200);

    while (CAN_OK != CAN.begin(CAN_500KBPS))              // init can bus : baudrate = 500k
    {
        Serial.println("CAN BUS Shield init fail");
        Serial.println(" Init CAN BUS Shield again");
        delay(100);
    }
    Serial.println("CAN BUS Shield init ok!");
}


void loop()
{
    unsigned char len = 0;
    unsigned char buf[8];

    if(CAN_MSGAVAIL == CAN.checkReceive())            // check if data coming
    {
        CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf

        unsigned int canId = CAN.getCanId();
        
        Serial.println("-----------------------------");
        Serial.print("Get data from ID: ");
        Serial.println(canId, HEX);

        for(int i = 0; i<len; i++)    // print the data
        {
            Serial.print(buf[i], HEX);
            Serial.print("\t");
        }
        Serial.println();
    }
}

I am just trying to view the CAN messages for now so that I can reverse engineer them. Any help is appreciated

I have not used the ElecFreaks CAN BUS Shield. I have used the seeedstudio CAN-BUS_Shield_V1.2 - the only problem I had was the CANH and CANL on the 9 pin out did not match the pin out on my other canbus kit. It is worth checking your pin out.
I find a USB-CAN dongle for a PC is very useful for debugging Canbus projects.

Have you connected the CAN bus ground to the Shield ground?

Should there be a CAN bus ground? I double checked the pinout for the cluster I am trying to connect to and it shows 3 CAN wires:

5 - CAN high speed display (high +)
6 - CAN high speed display (low -)
7 - CAN high speed display (screen)

I am not sure what (screen) is but could this be the ground you are talking about?

did you connect your cluster to the ElecFreaks CAN BUS Shield D type connector or to the screw terminals?
if you connected to the 9 pin Dtype connector looking at the schematic the ElecFreaks CAN BUS Shield the pin out is CAN high is pin 3 and CAN low is pin 5

on all my other canbus kit the pin out is CAN low is pin 2 and CAN high is pin 7 with CAN_GND pin 3

I would recommend you get a USB-CAN dongle for a PC so you can check that the ElecFreaks CAN BUS Shield is working correctly

horace:
did you connect your cluster to the ElecFreaks CAN BUS Shield D type connector or to the screw terminals?
if you connected to the 9 pin Dtype connector looking at the schematic the ElecFreaks CAN BUS Shield the pin out is CAN high is pin 3 and CAN low is pin 5

on all my other canbus kit the pin out is CAN low is pin 2 and CAN high is pin 7 with CAN_GND pin 3

I would recommend you get a USB-CAN dongle for a PC so you can check that the ElecFreaks CAN BUS Shield is working correctly

I have CAN H and CAN L connected to the screw terminals on the board. Is this not the correct location for them?

I will look into the USB-CAN dongle, although I may try the Seeed CAN BUS shield before shelling out $120 for the dongle. Appreciate the links

CJ_:
I have CAN H and CAN L connected to the screw terminals on the board. Is this not the correct location for them?

yes, I tend to use the Dtype 9pin connect as I have cables made up

I will look into the USB-CAN dongle, although I may try the Seeed CAN BUS shield before shelling out $120 for the dongle. Appreciate the links

if you look on ebay you should find some CAN-USB dongles for £20-£30

if you have a seeed CANBUS shield you may find this Canbus monitor useful

So I hooked up the can shield to ground as mikb55 suggested, that gave me the light on the CAN Shield labeled RX.

It seems to have changed the data coming into putty but it is still unrecognizable characters (boxes). I also got the Seeed CAN bus shield in today and was able to try it out.

This might be a dumb question but should I be monitoring on putty via the serial port on the shield, or the usb port on the arduino? When I run the serial monitor on Arduino, on COM3 (Arduino USB), the CAN initializes and is able to connect, but then I get no data. When I run the serial monitor on COM4 (serial-usb from Canbus shield), thats when I get all the un-readable data. I am still using the same code I posted above

horace:
if you have a seeed CANBUS shield you may find this Canbus monitor useful

I tried to use the Canbus monitor and I was not able to get it to initialize. I will try again tomorrow and post what the errors were

CJ_:
I tried to use the Canbus monitor and I was not able to get it to initialize. I will try again tomorrow and post what the errors were

to check the Arduino is programmed OK open the ArduinoCanbusCode.ino file with the IDE, program the device and then run the Serial Monitor at 115200baud, it should display

Canbus monitor
CAN BUS Shield init ok!

Close the Serial Monitor and run the C# program