QT plugin

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

QT plugin

Post by JGarza » Thu 21. Oct 2021, 14:38

Hi,

I manage to install the latest version of your driver to my ubuntu 20 machine, I can run candump on the command line and I can see the
CAN messages that are sent from a sensor. I want to read CAN data using the peakcan qt plugin but on the QT basic example I always get:

"The value of a PCAN-Client handle is invalid"

I made the driver installation using:
make netdev
make install

Is there any step missing on the driver installation so that QT can find your driver?
Thanks

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1268
Joined: Fri 10. Sep 2010, 19:34

Re: QT plugin

Post by U.Wilhelm » Thu 21. Oct 2021, 15:20

We do not officially support the QTCAN Bus Lib - please contact the QT community! --> LINK
As far as we know, you could use both driver types CharDev (PEAK-System Driver) and also NetDev (also supported by PEAK-System Devices) .
Best is to decide which one you like to use and install this driver of your choice. Then use the tools to test if the driver itself work. (simple CAN communication)
After that try the QT Lib
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

Re: QT plugin

Post by JGarza » Mon 25. Oct 2021, 12:33

Hello,

I removed the driver installation I had and did the build and installed the netdev version of your driver with:

Code: Select all

$ sudo make netdev
and

Code: Select all

$ sudo make install
on the folder where I have the files. I wanted to test now that the driver was correctly working but when I do candump I get:
Command 'candump' not found, but can be installed with:

sudo apt install can-utils
Did I miss a step from your readme file? or why is candump not found?
Thanks for the support.
Last edited by K.Wagner on Mon 25. Oct 2021, 12:38, edited 1 time in total.
Reason: Code formatting for better reading

User avatar
U.Wilhelm
Sales & Support
Sales & Support
Posts: 1268
Joined: Fri 10. Sep 2010, 19:34

Re: QT plugin

Post by U.Wilhelm » Mon 25. Oct 2021, 12:45

the tool is not part of the driver - it is part of the NetDev/Socket CAN Tools --> link
So you need to download the Tool seperatly

Code: Select all

sudo apt install can-utils
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------

JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

Re: QT plugin

Post by JGarza » Mon 25. Oct 2021, 13:00

ok, done. Following the manual I set up can0 to 500kbaud and then did candump. Is this received data being processed by your driver or by
canutils.
I ask, because the reason Im using you driver is that on QT when using socketcan its not possible to set timestamps to hardware timestamps.
But on your driver its by default the hardware timestamps as I understood.

Thanks

JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

Re: QT plugin

Post by JGarza » Mon 25. Oct 2021, 13:49

I tried the netdev on qt but was not using the hardware timestamps, I went back to the original driver and now it works. I dont know why QT did not recognized the can messages before.
In any case its solved. Thanks

JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

Re: QT plugin

Post by JGarza » Fri 12. Nov 2021, 11:36

I tried to make a new post but somehow I did not find the option, so I post here.

My question is:

I am using your driver with the QT plugin and I get following time stamp on a can message: 1636713378.7591
This time should be aproximatly: nov. 12 11:34 of 2021

When I convert in python I get: 2021-11-12 11:36:18.759100

which is not correct. Im using this python code:


"""import datetime
s=1636713378.7591
print(datetime.datetime.fromtimestamp(s).strftime('%Y-%m-%d %H:%M:%S.%f'))

JGarza
Posts: 13
Joined: Wed 2. Dec 2020, 12:01

Re: QT plugin

Post by JGarza » Fri 12. Nov 2021, 11:44

sorry somehow I copy past the wrong values.

I get this timestamp: 1636714205.0324
it should be actually around: 11:43 of nov. 21
when I convert I get : 2021-11-12 11:50:05.032400

which is not correct.

M.Heidemann
Sales & Support
Sales & Support
Posts: 681
Joined: Fri 20. Sep 2019, 13:31

Re: QT plugin

Post by M.Heidemann » Fri 12. Nov 2021, 12:31

Hello,

We do not officially support the QTCAN Bus Lib -
please contact the QT community! --> https://doc.qt.io/qt-5/qtcanbus-backends.html

Please check with PCANBasic API itself, if the same behavior can be reproduced.

Best Regards

Marvin

Post Reply