25 Replies Latest reply on Aug 30, 2021 3:40 AM by roryyorke

    Help: Encountering CAN Bus Problem on SmartEdge IIoT Gateway


      Hi All,


      I was wondering if anyone has had any experience using the CAN Controller on the SmartEdge IoT Gateway

      The box has a Built-in MCP2515 CAN Controller on board, which is great & why I selected it for a project that requires CAN


      For the most part, it works fine, but every so often I'm encountering "Garbage" data coming from the chipset (at a rate of about 1 message every 10 mins with a message cycle of 100ms)

      This is shown below, when simply monitoring using candump and nothing else


      the shown 67 EB in bytes 7 & 8 are the bits Garbage Data in question. It should be noted that when I do get the garbage, its always the same 2 Bytes and same values.


      The sender device is broadcasting the same message repeatedly, so there should be no changes at all!


      I was also able to confirm that it is not present on the physical bus by using a PCAN USB and datalogging with Pcan-View at the same time.

      The data dump from Pcan-View shows no messages like the one highlighted!


      Seems like this is happening on the Controller Hardware or Driver Implementation side on the IIoT Gateway

      Anyone encountered this before? Either on this product or any other Raspberry Pi ?


      I've tried adjusting the bit timing, sampling point, everything I could think of, but still encountering a random error every so often


      Here is my CAN settings from /etc/network/interfaces


      auto can0
      iface can0 inet manual
         pre-up /sbin/ip link set can0 type can bitrate 250000 sample-point 0.875 triple-sampling on
         up /sbin/ifconfig can0 up
         down /sbin/ifconfig can0 down


      And here is the output of ip -details -statistics link show can0

      ip -details -statistics link show can0
      4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
          link/can  promiscuity 0 
          can <TRIPLE-SAMPLING> state ERROR-ACTIVE restart-ms 0 
        bitrate 250000 sample-point 0.875 
        tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
        mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
        clock 8000000
        re-started bus-errors arbit-lost error-warn error-pass bus-off
        0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 
          RX: bytes  packets  errors  dropped overrun mcast   
          17224264   2153033  0       1508    0       0       
          TX: bytes  packets  errors  dropped carrier collsns 
          16         2        0       0       0       0


      Note: Kernel Version 4.14.79-v7+, & Software Image: avnet_iot_demo_20190719a_shrink

      (Also tried with latest release avtse-iiotg-v-11-20200326.img, which apparently updated the MCP2515 driver, but problem still persists)


      Any advice?