Machine CAN OSError: [Errno 116] ETIMEDOUT

Hello, I’m trying to used CAN shield (old) with the new OpenMV RT1062 using the Exemple/Board Control/can.py. But I have an error OSError: [Errno 116] ETIMEDOUT in send and recv.
With the old version of OpenMV i have no problem using pyb lib.
Somebody have the same problem ? Any idea to solve this. Software or hardware ?
It possible it’s due to the compatibilité of CAN Shield – OpenMV
This module used

P2 = CAN TX

P3 = CAN RX

New module use

P1 = CAN TX (default)

P2 = CAN TX (alternative)

P3 = CAN RX

Is it software or hardware probleme ?
It is working for somebody ?

# This work is licensed under the MIT license.
# Copyright (c) 2013-2024 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# CAN Shield Example
#
# This example demonstrates CAN communications between two cameras.
# NOTE: you need two CAN transceiver shields and DB9 cable to run this example.

import time
from machine import CAN

# NOTE: Set to False on receiving node.
TRANSMITTER = True

can = CAN(0, CAN.NORMAL, baudrate=1000000, auto_restart=True)

if TRANSMITTER:
    while True:
        # Send message with id 1
        can.send("Hello", 1, timeout=100, extframe=False)
        time.sleep_ms(1000)

else:
    # Runs on the receiving node.
    # Set a filter to receive messages with id=1 and 2
    # Filter index, mode (DUAL, etc..), FIFO (0), params
    can.setfilter(0, CAN.DUAL, 0, [1, 2])

    while True:
        # Receive messages on FIFO 0 (there's only one fifo)
        print(can.recv(0, timeout=10000))

Hi, the CAN shield is on the wrong pins for the RT1062.

It’s not physically compatible. However, we just launched the new CAN shield and it’s in the store now! You can buy it.

Otherwise, you need to modify the old CAN shield you have and move its TX pin to a different I/O pin.

Ok thank you for your answer, it works after adding a bridge between P1 and P2.

1 Like