Socketcan error in Apalis board QT

Hi , i am trying to use the can0 of my apalis board with QT.
I am 4 weeks old at using apalis and its my first embedded linux board.

There is two issues i encounter when trying to follow this setup guide and this setup guide also.


  1. Even if the documentation says canutils is installed by default…
    “in the Apalis family, CAN is enabled by default in our BSP. That means that the kernel and, if applicable, a device tree are provided.”
    I am able to configure and setup the can0 and can1 ports.
    [upload|bn9X7iwcdyYM1D/R9XJS+CjI9i0=]
    but cannot access can0 or any of the tools,
    [upload|KqXpUpqSDnzX+qXLinesEWFRfS4=]

  1. When i try to replicate the Qt example using socketcan i get this error when the device is created:
    [upload|GfcZpSTjEtmTMAO0kkvhUALnaXY=]
    I have no idea of how or what to install because opkg cannot find any canutils package
    [upload|tCbHAGpN7TGsMK1CiPhDBqgDpWo=]

You will need to build your own Boot2Qt configured with libsocketcan, and with the can-utils if required.

For this setup in particular you can trigger Qt support.

Best regards,
André Curvello

Thanks Andre, i will try QT support.
If i manage to fix this ill come back here and post what worked for me.

cheers

Thank you for contacting Qt Support!
Unfortunately socketcan is missing from Boot2Qt images, 
but my colleague made a fix, so it will be included in the future releases.

Before that release you can build your own image following this guide:
https://doc.qt.io/QtForDeviceCreation/qtee-custom-embedded-linux-image.html

Although you need to make this modification:
https://codereview.qt-project.org/c/yocto/meta-qt5/+/327919/1/recipes-qt/qt5/qtserialbus_git.bb
before running "bitbake b2qt-embedded-qt5-image" command.

Sorry for the inconvenience!

Hi @javiernicola,

Ok! Thanks.

Hi @javiernicola,

Congrats on finding this issue with Boot2Qt.
I’m happy to know that it’s now fixed and will be available in future releases.

Did you manage to get it working with the guide and the modification?

Best regards,
André Curvello

Hi @javiernicola,

Please update your original post with more details about your environment, regarding the “versions” of the Apalis and Ixora you are using (like V1.1A, or V1.2B, something like that).

The Boot2Qt is a BSP generated from Qt with support for Toradex modules.
So, it’s not necessarily maintained by us.

But, let’s go for your issues.

About how to handle CAN on Linux, you need to rely on can-utils utilities to send, receive, sniff, dump CAN messages. So, just executing “can0” will not work.

You need to check if can-utils is installed on Boot2Qt.
You can check here some examples of can-utils.

In another words, is using cansend, candump, among other can-utils commands, together with CAN0 interface and it works, so you are fine with your setup.

Judging by your error on Qt, if “can bus plugin” is available, so your Boot2Qt has support for it.
But strangely, your error tells that there is no SocketCAN.

Doing a quick search, I found that other users reported this on Qt Community:
https://forum.qt.io/topic/112743/libsocketcan-not-found-in-5-14-1/4

So you need to install libsocketcan package.

Best regards,
André Curvello

Thanks for your complete answer Andre.

Please update your original post with
more details about your environment,

I updated the details about the enviroment you asked.


The Boot2Qt is a BSP generated from Qt
with support for Toradex modules. So,
it’s not necessarily maintained by us.
Ok i didnt know that, its a bit blurry for me where toradex support starts and qt ends.


About how to handle CAN on Linux, you
need to rely on can-utils utilities to
send, receive, sniff, dump CAN
messages. So, just executing “can0”
will not work.

In another words, is using cansend,
candump, among other can-utils
commands, together with CAN0 interface
and it works, so you are fine with
your setup.

sorry, i attached the correct command not found capture now
[upload|gHqp82LVuqQsPE7fHz5mYz7KHeY=]


You need to check if can-utils is
installed on Boot2Qt. You can check
here some examples of can-utils.

i already tried that doc but unfortunatelly there is no canutils package available, i checked manually opkg list and i couldnt find any canutils or can-utils similar package in the list dumped.
[upload|5IkgBdfrhOcQrSNKA2Csw0GRcKQ=]


Judging by your error on Qt, if “can
bus plugin” is available, so your
Boot2Qt has support for it. But
strangely, your error tells that there
is no SocketCAN.

i was also amazed by that error


So you need to install libsocketcan package.

Ok, how do i install that package , do i need to build my own b2qt image for that? or is there any tool i can use?