0

I got a problem for days now, my Can Bus stop working after sending the first message.

I use as a client the IOT-Gate-RPI which have the raspberry pi 3 compute module and a integrated hat with the MCP2551 chip for can Bus. On the other side of the line, as a monitor, I use the IXXAT software CANAnalyzer 3 Mini running on W10.

Here is my settings on Linux: On /Boot/config.txt, I added:

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi0-hw-cs #(For Kernel > 4.4.x)

I also made sure it will be mounted on boot with:

auto can0
iface can0 inet manual
    pre-up /sbin/ip link set can0 type can bitrate 125000 triple-sampling on restart-ms 100
    up /sbin/ifconfig can0 up
    down /sbin/ifconfig can0 down

Then, with can-utils:

$sudo ip link set can0 up
$cansend can0 111#1122334455667788 #Random message

And so far, so good, the message appears on the monitor on the other side. But then, if I send it again, nothing appears, I have to set the can0 down and then up to be able to send a new message.

[EDIT 2021-02-10] As asked by @Lundin, I used an oscillo to check the signals shapes. So just to explain the new set-up, the datas are continuously send by a BMS ( Battery Management System) connected on the CAN Bus. On the first picture, there's just this BMS and an IXXAT CAN to USB dongle. The signal is pretty neat and all the datas arrive safely. On the second picture, I just plug the MCP2515 hat of my IOT-Gate-RPI and the signal get messy straight. And I can only send one frame as described above.

Picture_1

Picture_2

Also the pinout given by Compulab on the IOT-Gate-RPI is the one on the third pic. Which pinout will you give according to picture 4 ?

1 = ? 2 = ? 3 = ? 4 = ? 5 = ? 6 = ?

Picture_3

Picture_4

Thank a lot for your help.

Best regards

danakil
  • 1
  • 1
  • May be the message gets no ack? This can cause the controller to stop working. If your analyzer has this option, tell it to do the ack of messages. – linuxfan says Reinstate Monica Feb 05 '21 at 15:50
  • Thank you @linuxfansaysReinstateMonica for your help ! It's a good idea but it seems that the analyzer does send an ACK. The "TX-passive" option is disable and if not it does: _Mode in which active access to the bus is prevented by hardware. Neither acknowledge nor errors can be terminated. The canAnalyser3 is only a listener_ – danakil Feb 08 '21 at 06:52
  • Does the listener software track error frames? What happens on the CAN lines when you check with an oscilloscope? – Lundin Feb 08 '21 at 07:54
  • Hi @Lundin and thank you for your help ! So just to explain the oscillo pictures, the datas are continuously send by a BMS ( Battery Management System) connected on the CAN Bus. On the first picture, there's just this BMS and an IXXAT CAN to USB dongle. The signal is pretty neat and all the datas arrive safely. On the second picture, I just plug the MCP2515 hat of my IOT-Gate-RPI and the signal get messy straight. And I can only send one frame as described above. [link](https://postimg.cc/gallery/svfYcrJ) Thank you everyone ! Best regards – danakil Feb 09 '21 at 17:53
  • Also the pinout given by Compulab on the IOT-Gate-RPI is the one on the first pic on this gallery: [link](https://postimg.cc/gallery/dJbKRnK) Which pinout will you give according to picture 2 ? '1 = ? 2 = ? 3 = ? 4 = ? 5 = ? 6 = ?' Thank you everyone ! Best regards – danakil Feb 09 '21 at 17:55
  • You should add the pics and additional details to the actual question with an edit. To me it looks like a mix up with CANH/CANL, or one of them is not connected. Also ensure you have 60 ohm between CANH and CANL. – Lundin Feb 10 '21 at 07:35
  • Hi @Lundin, Yes I believe also there's a mix on CAN_H and CAN_L but I cannot find it out. Please have a look on my edit on picture 3 and 4. And I rechecked, I got 2 x 120 ohms on both side of the line, which gives me 60Ohm average. – danakil Feb 10 '21 at 09:46
  • RJ11 isn't standardized for CAN (unlike RJ10 and RJ45). Whether to count the pins left-to-right or right-to-left depends on female vs male. Pic 4 seems to assume a male connector(?). Just sniff pins 3 and 4 with the connector unconnected. CANH will be 2.5V +1V and CANL 2.5V -1V. – Lundin Feb 10 '21 at 09:55

1 Answers1

0

So I just got a reply from Compulab support, there was a problem in the interrupt pin declared, it's 13 instead of 25.

On /Boot/config.txt:

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=13
dtoverlay=spi0-hw-cs #(For Kernel > 4.4.x)

Thanks everyone for your help, I learn a lot !

danakil
  • 1
  • 1