Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Error! Cannot load library pcanbasic

    Mobile and Embedded
    4
    9
    2982
    Loading More Posts
    • 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.
    • xmastree
      xmastree last edited by xmastree

      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 Reply Quote 0
      • xmastree
        xmastree last edited by 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.

        ocgltd 1 Reply Last reply Reply Quote 0
        • aha_1980
          aha_1980 Lifetime Qt Champion last edited by

          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 Reply Quote 2
          • xmastree
            xmastree last edited by

            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 Reply Quote 0
            • K
              kuzulis Qt Champions 2020 last edited by

              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 Reply Quote 1
              • xmastree
                xmastree last edited by

                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_1980 1 Reply Last reply Reply Quote 0
                • aha_1980
                  aha_1980 Lifetime Qt Champion @xmastree last edited by

                  @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 Reply Quote 2
                  • xmastree
                    xmastree last edited by

                    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 Reply Quote 0
                    • xmastree
                      xmastree last edited by 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.

                      ocgltd 1 Reply Last reply Reply Quote 0
                      • ocgltd
                        ocgltd @xmastree last edited by

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

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post