Homepage GitHub

OSError: [Errno 19] No such device in demo

Hello everyone,
I am pretty new to all this and I am trying to get my hands on things by playing with the demo.
Unfortunately I ran into an obstacle and I have no clue about where to begin to solve this issue.
I am on linux, I think I have set-up everything according to the tutorial but I am having this issue when trying to launch the python script :

~/git/uavcan-test/demo$ python3 demo_app.py
Traceback (most recent call last):
  File "demo_app.py", line 170, in <module>
    app = DemoApp()
  File "demo_app.py", line 63, in __init__
    self._node = pyuavcan.application.make_node(node_info, DemoApp.REGISTER_FILE)
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/application/_node_factory.py", line 199, in make_node
    node = SimpleNode(pyuavcan.presentation.Presentation(init_transport()), info, registry)
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/application/_node_factory.py", line 172, in init_transport
    out = make_transport(registry, reconfigurable=reconfigurable_transport)
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/application/_transport_factory.py", line 215, in make_transport
    transports = list(itertools.chain(*(f(registers, node_id) for f in _SPECIALIZATIONS)))
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/application/_transport_factory.py", line 284, in _make_can
    media = SocketCANMedia(iface.split(":")[-1], mtu=mtu)
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/transport/can/media/socketcan/_socketcan.py", line 68, in __init__
    self._sock = _make_socket(iface_name, can_fd=self._is_fd)
  File "/home/louis-nicolas/.local/lib/python3.8/site-packages/pyuavcan/transport/can/media/socketcan/_socketcan.py", line 295, in _make_socket
    s.bind((iface_name,))
OSError: [Errno 19] No such device

I have seen that it was an error message that has occurred to other people in different context but the solution does not seem systematic. If you have any idea of the potential mistake I have made or where I should dig in it would be greatly appreciated thank you !

It would appear that you don’t have that network interface available. Please post the output of ip link show here. You should see something like this:

$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
<...snip...>
5: vcan0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/can

As you appear to be using UAVCAN/CAN, you should have at least one interface with the link type can available.

Thank you for answer Pavel !

ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 48:2a:e3:38:d2:1f brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether a4:c3:f0:5c:b2:b9 brd ff:ff:ff:ff:ff:ff
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:42:0b:d5:b1:28 brd ff:ff:ff:ff:ff:ff
5: vcan0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/can 

So it seems that indeed I don’t have at least one interface with the link type can available.
So if I am correct I should change something somewhere to make the demo uses the vcan interface or set up a can interface (Sorry if my latest statement does not make any sens) ?

By default, the demo assumes that you run it with UAVCAN/UDP. If you want UAVCAN/CAN, you have to make sure that your CAN interfaces are available (you already have vcan0 so that’s a start) and the script is configured to use them (this is done via registers like UAVCAN__CAN__IFACE=vcan0).

If you were using the demo with a different transport configuration before doing this, consider removing the register file to make sure there are no obsolete options remaining from the previous run: rm *.db.

Ok thank you really much it worked by removing the *.db !