Homepage GitHub

Yakut Error OSError: [Errno 22] Invalid argument

Hey all,
I’m in the process of trying to read the data incoming from a GNSS Node I put together from the example: 107-Arduino-GNSS-Node_Example.ino
I’ve setup Yakut following the screenshare example and when using yakut monitor I get this error flashing repeatedly:

NodID Mode Health VSSC Uptime         VProtcl VHardwr VSoftware(major.minor.vcs.crc)            Unique-ID                        Name                    
    2 ?    ?      ?    offline          1.0     0.0     0.6                                     32bd38c3a62734a7d218a81ee1b3be9c org.uavcan.yakut.monitor
APPLICATION LAYER CONNECTIVITY MATRIX [t/s=transfer/second] Colors: pub/cln\u2502sub/srv\u2502(pub+sub)/(cln+srv)\u2502activity\u2502uavcan.node.port.List is published/not\u2502
MESSG \u2211t/s \u2211B/s     
\u2211t/s    0      \u2196 t/s
\u2211B/s         0      
RQ+RS \u2211t/s \u2211B/s     
\u2211t/s    0      \u2196 t/s
\u2211B/s         0      
TOTAL \u2211t/s \u2211B/s     
\u2211t/s    0           
\u2211B/s         0      
Total transport layer errors:        0         Values averaged over 10.0 sec
2021-09-14 17:26:27 0004624 ERR pyuavcan.application.heartbeat_publisher: HeartbeatPublisher(heartbeat=uavcan.node.Heartbeat.1.0(uptime=22, health=uavcan.node.Health.1.0(value=0), mode=uavcan.node.Mode.1.0(value=0), vendor_specific_status_code=24), priority=NOMINAL, period=1.0) publisher task exception: [Errno 22] Invalid argument
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/application/heartbeat_publisher.py", line 203, in _task_function
    if not await pub.publish(self.make_message()):
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/presentation/_port/_publisher.py", line 113, in publish
    return await self._maybe_impl.publish(message, self._priority, self._loop.time() + self._send_timeout)
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/presentation/_port/_publisher.py", line 190, in publish
    return await self.transport_session.send(transfer, monotonic_deadline)
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/transport/can/_session/_output.py", line 206, in send
    return await self._do_send(can_id, transfer, monotonic_deadline)
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/transport/can/_session/_output.py", line 163, in _do_send
    if await self._send_handler(transaction):
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/transport/can/_can.py", line 335, in _do_send
    t.monotonic_deadline,
  File "/usr/local/lib/python3.7/dist-packages/pyuavcan/transport/can/media/socketcan/_socketcan.py", line 130, in send
    timeout=monotonic_deadline - self._loop.time(),
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 425, in sock_sendall
    return await fut
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 434, in _sock_sendall
    n = sock.send(data)
OSError: [Errno 22] Invalid argument

I think I’ve setup the the PATH and DSDL definitions correctly.
For hardware on the Arduino side I’m using the MKR zero stack recommended but with a different Serial GPS, and on the raspberry pi I’m using a SEEEDuino RPI Can Shield connected via SPI, SocketCan.
Any help in troubleshooting would be appreciated. If any more information is needed let me know.
Thankyou

Add this:

export UAVCAN__CAN__MTU=8

By default, Yakut uses CAN FD with MTU 64 bytes, but your network is Classic CAN with MTU 8 bytes. An attempt to write a large-MTU frame into a Classic CAN socket reults in the invalid argument error.

Would you volunteer to add an error handler here that catches OSError with the invalid argument error code and re-raises it with a more sensible InvalidMediaConfigurationError? That would be a significant usability boost.