Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. SocketCAN - Cannot load library
Forum Updated to NodeBB v4.3 + New Features

SocketCAN - Cannot load library

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 252 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Damian7546
    wrote on 18 Jan 2025, 11:57 last edited by Damian7546
    #1

    Hi ,
    I am learning using Openstlinux-eglfs on embedded device.
    In my device I turned on the CAN socked in device tree, and socket can0 is available in device:

    can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              UP RUNNING NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:60
    
    

    Now I would like to access to can0 using qt libraries and, so I try run below example :

    if (QCanBus::instance()->plugins().contains(QStringLiteral("socketcan"))) {
            QString errorString;
            QCanBusDevice *device = QCanBus::instance()->createDevice(QStringLiteral("socketcan"), QStringLiteral("can0"), &errorString);
            if (!device)
                qDebug() << device;
            else
                device->setConfigurationParameter(QCanBusDevice::BitRateKey, 1000000);
            device->connectDevice();
    }
    else
            qDebug() << "Plugin are not available";
    

    But when I deploy my app I get errors:

    qt.canbus.plugins.socketcan: Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
    qt.canbus.plugins.socketcan: Cannot load library libsocketcan, some functionality will not be available.
    Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
    qt.canbus.plugins.socketcan: Function can_set_bitrate() is not available.
    qt.canbus.plugins.socketcan: Cannot apply parameter: 4 with value: 1000000

    Any idea what can be wrong ?

    J 1 Reply Last reply 18 Jan 2025, 12:20
    0
    • J JonB
      18 Jan 2025, 12:20

      @Damian7546
      Cannot load library libsocketcan, some functionality will not be available
      https://forum.qt.io/post/692971

      Did you try read/write on the canbus? I remember seeing this issue and it still worked and was able to do everything I wanted to on the CANbus.

      Read/write OK. Worked.

      ?

      D Offline
      D Offline
      Damian7546
      wrote on 18 Jan 2025, 13:55 last edited by
      #3

      @JonB I not tried if the read and write works while the errors appears...

      I installed below libraries on device :
      IMAGE_INSTALL:append = " libsocketcan can-utils"

      and now is without any errors.

      1 Reply Last reply
      0
      • D Damian7546
        18 Jan 2025, 11:57

        Hi ,
        I am learning using Openstlinux-eglfs on embedded device.
        In my device I turned on the CAN socked in device tree, and socket can0 is available in device:

        can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
                  UP RUNNING NOARP  MTU:16  Metric:1
                  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                  collisions:0 txqueuelen:10
                  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
                  Interrupt:60
        
        

        Now I would like to access to can0 using qt libraries and, so I try run below example :

        if (QCanBus::instance()->plugins().contains(QStringLiteral("socketcan"))) {
                QString errorString;
                QCanBusDevice *device = QCanBus::instance()->createDevice(QStringLiteral("socketcan"), QStringLiteral("can0"), &errorString);
                if (!device)
                    qDebug() << device;
                else
                    device->setConfigurationParameter(QCanBusDevice::BitRateKey, 1000000);
                device->connectDevice();
        }
        else
                qDebug() << "Plugin are not available";
        

        But when I deploy my app I get errors:

        qt.canbus.plugins.socketcan: Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
        qt.canbus.plugins.socketcan: Cannot load library libsocketcan, some functionality will not be available.
        Cannot load library socketcan: (socketcan: cannot open shared object file: No such file or directory)
        qt.canbus.plugins.socketcan: Function can_set_bitrate() is not available.
        qt.canbus.plugins.socketcan: Cannot apply parameter: 4 with value: 1000000

        Any idea what can be wrong ?

        J Online
        J Online
        JonB
        wrote on 18 Jan 2025, 12:20 last edited by
        #2

        @Damian7546
        Cannot load library libsocketcan, some functionality will not be available
        https://forum.qt.io/post/692971

        Did you try read/write on the canbus? I remember seeing this issue and it still worked and was able to do everything I wanted to on the CANbus.

        Read/write OK. Worked.

        ?

        D 1 Reply Last reply 18 Jan 2025, 13:55
        0
        • J JonB
          18 Jan 2025, 12:20

          @Damian7546
          Cannot load library libsocketcan, some functionality will not be available
          https://forum.qt.io/post/692971

          Did you try read/write on the canbus? I remember seeing this issue and it still worked and was able to do everything I wanted to on the CANbus.

          Read/write OK. Worked.

          ?

          D Offline
          D Offline
          Damian7546
          wrote on 18 Jan 2025, 13:55 last edited by
          #3

          @JonB I not tried if the read and write works while the errors appears...

          I installed below libraries on device :
          IMAGE_INSTALL:append = " libsocketcan can-utils"

          and now is without any errors.

          1 Reply Last reply
          0
          • D Damian7546 has marked this topic as solved on 18 Jan 2025, 13:55

          1/3

          18 Jan 2025, 11:57

          • Login

          • Login or register to search.
          1 out of 3
          • First post
            1/3
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved