Homepage GitHub

Using Yakut monitor on Raspberry Pi compute module 4

Hi,

I’m currently trying to install yakut onto a raspberry pi compute module 4.
I’ve followed the install instructions found here, however when i try to run yakut moniter i get the following error: OSError: /usr/local/lib/python3.8/dist-packages/libpcap/_platform/_linux/x64/tcpdump/libpcap.so: cannot open shared object file: No such file or directory

The full output with verbose is this:

  File "/usr/local/bin/yakut", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/yakut/main.py", line 209, in proxy
    return loop.run_until_complete(f(*args, **kwargs))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/yakut/cmd/monitor/_cmd.py", line 132, in monitor
    iface = Iface(node)
  File "/usr/local/lib/python3.8/dist-packages/yakut/cmd/monitor/_iface.py", line 30, in __init__
    node.presentation.transport.begin_capture(self._process_capture)
  File "/usr/local/lib/python3.8/dist-packages/pyuavcan/transport/udp/_udp.py", line 292, in begin_capture
    self._sniffer = self._sock_factory.make_sniffer(self._process_capture)
  File "/usr/local/lib/python3.8/dist-packages/pyuavcan/transport/udp/_ip/_v4.py", line 142, in make_sniffer
    return SnifferIPv4(self._local, handler)
  File "/usr/local/lib/python3.8/dist-packages/pyuavcan/transport/udp/_ip/_v4.py", line 151, in __init__
    self._link_layer = LinkLayerSniffer(filter_expression, handler)
  File "/usr/local/lib/python3.8/dist-packages/pyuavcan/transport/udp/_ip/_link_layer.py", line 122, in __init__
    dev_names = _find_devices()
  File "/usr/local/lib/python3.8/dist-packages/pyuavcan/transport/udp/_ip/_link_layer.py", line 341, in _find_devices
    import libpcap as pcap
  File "/usr/local/lib/python3.8/dist-packages/libpcap/__init__.py", line 7, in <module>
    from ._pcap      import * ; del _pcap      # noqa
  File "/usr/local/lib/python3.8/dist-packages/libpcap/_pcap.py", line 73, in <module>
    from ._dll      import dll
  File "/usr/local/lib/python3.8/dist-packages/libpcap/_dll.py", line 10, in <module>
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/libpcap/_dll.py", line 8, in <module>
    dll = DLL(DLL_PATH)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.8/dist-packages/libpcap/_platform/_linux/x64/tcpdump/libpcap.so: cannot open shared object file: No such file or directory

Does anyone know how to fix this?
Thanks

I see that you are using the UAVCAN/UDP transport, that’s cool.

Yakut is built on top of PyUAVCAN, which has an optional dependency on libpcap if the UAVCAN/UDP transport is needed:

The sources of the libpcap wrapper are here: https://github.com/karpierz/libpcap. It comes with prebuilt native libraries for some of the platforms, including GNU/Linux x86/x86_64, Windows, and macOS. Prebuilt libraries for ARM-based platforms are not included, for which you have two solutions:

  • Quick and dirty: install the native libpcap for your platform and symlink libpcap.so from the path referenced in your original post.

  • Proper: send a pull request against the libpcap wrapper adding support for your platform, or modify the wrapper to search for the libpcap binary in the standard lib paths for the system.

Thanks very much! all working now!!

Just incase anyone else has this issue and want’s to know what i did to fix this I followed this link: https://stackoverflow.com/questions/59507388/cross-compile-libpcap-dev-aarch64

And then deleted the libpcap.so file at the location “/usr/local/lib/python3.8/dist-packages/libpcap/_platform/_linux/x64/tcpdump”

At that same location i created a symlink to the libpcap.so file compiled with this command:
ln -s /usr/lib/aarch64-linux-gnu/libpcap.so libpcap.so

2 Likes