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. Error! Cannot load library pcanbasic
QtWS25 Last Chance

Error! Cannot load library pcanbasic

Scheduled Pinned Locked Moved Solved Mobile and Embedded
9 Posts 4 Posters 5.0k 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.
  • xmastreeX Offline
    xmastreeX Offline
    xmastree
    wrote on last edited by xmastree
    #1

    Hello,
    I am trying to communicate with CAN interface via peakcan hardware, this is the link that I follow https://doc.qt.io/qt-5.11/qtserialbus-peakcan-overview.html
    Program is run without errors if I dont use peakcan interface in the code

    The error is : Cannot load library pcanbasic: (pcanbasic: cannot open shared object file: No such file or directory)
    

    Hardware is connected successfully, when I "dmesg" on the console it outputs

    91929.495137] peak_usb 1-11:1.0: PEAK-System PCAN-USB adapter hwrev 28 serial FFFFFFFF (1 channel)
    [91929.495564] peak_usb 1-11:1.0 can0: attached to PCAN-USB channel 0 (device 20)
    

    this is my sample code, and this line couldn't run also, error occurs here.

    QCanBusDevice *device = QCanBus::instance()->createDevice(
        QStringLiteral("peakcan"), QStringLiteral("can0"));
    

    and also if I try to run my application it outputs to the kernel an error, which is shown when I type 'dmesg'

    segfault at 8 ip 00007f1fe3409049 sp 00007ffebd9e07b0 error 4 in libQt5SerialBus.so.5.10.0[7f1fe33fc000+40000]
    

    Before that I connected a real BMS' can line, it worked well, but now I am trying to make CAN Simulator via using PeakCan, and this is where I found myself.

    Thanks for help people.

    1 Reply Last reply
    0
    • xmastreeX Offline
      xmastreeX Offline
      xmastree
      wrote on last edited by xmastree
      #8

      Hello people,

      I found the solution, whether or not using PEAK hardware does not matter, SocketCAN is a general purpose Can driver, so if your CAN hardware connected at can0, usb1, usb2 etc. you dont need to use peakcan interface because of your hardware is PEAKCAN, you could connect it via socketcan.

      ocgltdO 1 Reply Last reply
      0
      • aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi @xmastree, welcome!

        Cannot load library pcanbasic: (pcanbasic: cannot open shared object file: No such file or directory)

        The error is very obvious, it cannot load the shared library pcanbasic.so - therefore your program crashes.

        So please tell us:

        • where the library pcanbasic.so resides?
        • what file pcanbasic.so outputs?
        • Which Qt version you are using?

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        2
        • xmastreeX Offline
          xmastreeX Offline
          xmastree
          wrote on last edited by
          #3

          Hello

          I am using Qt 5.10

          and pcanbasic.so outputs I will provide 1-2 hours later, I am so sorry about that, little far away from computer,

          Any suggestion after outputting

          file pcanbasic.so
          

          Thanks alot.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kuzulis
            Qt Champions 2020
            wrote on last edited by
            #4

            Hi,

            Seems, you can try a generic SocketCAN plugin (as I assume, you work on Linux) too. I'm think, the Linux kernel already contains an appropriate PCAN drivers.

            1 Reply Last reply
            1
            • xmastreeX Offline
              xmastreeX Offline
              xmastree
              wrote on last edited by
              #5

              Hello

              Yes ı am working on linux, but the problem is, I have peak hardware, so I should use it, and also in Qt there is peak interface, So how can I use it, or how can I add the pcanbasic library, how to make it work ?

              Thanks for helps

              aha_1980A 1 Reply Last reply
              0
              • xmastreeX xmastree

                Hello

                Yes ı am working on linux, but the problem is, I have peak hardware, so I should use it, and also in Qt there is peak interface, So how can I use it, or how can I add the pcanbasic library, how to make it work ?

                Thanks for helps

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @xmastree

                On Linux you can indeed use SocketCAN, please see https://doc.qt.io/qt-5.11/qtserialbus-socketcan-overview.html

                Peak hardware has a good support here, if your Linux Kernel is recent enough and has the Peak SocketCAN driver included.

                If you like to use the Peak proprietary driver and library, you have to compile the Peak driver and PCAN-Basic library yourself:

                https://www.peak-system.com/Details.114+M5be7fb58f77.0.html?&L=1
                http://www.peak-system.com/quick/BasicLinux

                Regards.

                Qt has to stay free or it will die.

                1 Reply Last reply
                2
                • xmastreeX Offline
                  xmastreeX Offline
                  xmastree
                  wrote on last edited by
                  #7

                  Hello

                  Can I use SocketCAN to send and receive can messages from connected PEAK Hardware.
                  I mean it could be possible, because connected PEAK Hardware also using can0...
                  What is your opinion ?

                  1 Reply Last reply
                  0
                  • xmastreeX Offline
                    xmastreeX Offline
                    xmastree
                    wrote on last edited by xmastree
                    #8

                    Hello people,

                    I found the solution, whether or not using PEAK hardware does not matter, SocketCAN is a general purpose Can driver, so if your CAN hardware connected at can0, usb1, usb2 etc. you dont need to use peakcan interface because of your hardware is PEAKCAN, you could connect it via socketcan.

                    ocgltdO 1 Reply Last reply
                    0
                    • xmastreeX xmastree

                      Hello people,

                      I found the solution, whether or not using PEAK hardware does not matter, SocketCAN is a general purpose Can driver, so if your CAN hardware connected at can0, usb1, usb2 etc. you dont need to use peakcan interface because of your hardware is PEAKCAN, you could connect it via socketcan.

                      ocgltdO Offline
                      ocgltdO Offline
                      ocgltd
                      wrote on last edited by
                      #9

                      @xmastree Could you explain your solution? In other words, what did you do exactly to stop getting this error?

                      1 Reply Last reply
                      0

                      • Login

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