Error! Cannot load library pcanbasic
-
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 codeThe 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.
-
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.
-
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
- where the library
-
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.
-
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.
-
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
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/BasicLinuxRegards.
-
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.
-
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.