Hi,
I am trying to make python-can work on Ubuntu 18.04 for a work project that will require me to use CAN messages to control a robot using ROS. Only problem is I am new to all of these things, I know how to use Ubuntu at a basic level and I have experience with python (using python 2 on the system because of ROS) but I have no experience with CAN devices.
I have downloaded the drivers and PCAN-Basic API but now I don't know how to use the python library with the PCAN-USB device I have access to at work. I have tried going through the python-can tutorials and the Peak-System documentations too and other online resources (including ChatGPT) but nothing seems to work.
If someone can guide me to how to make my device work/ get recognized in the python script (and then I can go from there) it would be very much appreciated. If anything is unclear or you need more info to help out please let me know.
Thanks.
How to use my PCAN-usb device with python-can on Ubuntu 18.04
-
- Posts: 2
- Joined: Fri 12. Jan 2024, 10:49
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: How to use my PCAN-usb device with python-can on Ubuntu 18.04
As you could run different CAN Drivers on Linux (SocketCAN and the PEAK-System CharDev driver), which offers different APIs, you need first to know which one you use.
Based on the used driver, are different APIs available.
One from the community, the SocketCAN / NetDev Driver --> see SocketCAN API and also Python samples
And one from PEAK --> see PEAK-System API called PCAN-Basic which is available for Windows and LINUX - so you could use code on both Systems
But all samples codes etc. for our Driver / API is available from our WEB Page - also many samples , documentation etc.
For installing teh LINUX Driver you need to follow teh documentation - step by step - all is very well documented
https://www.peak-system.com/fileadmin/m ... /index.htm
The CAN Basics are a must - but also here you find many resources online. As this is a commercial Forum we only support original PEAK-System CAN Interfaces.
Based on the used driver, are different APIs available.
One from the community, the SocketCAN / NetDev Driver --> see SocketCAN API and also Python samples
And one from PEAK --> see PEAK-System API called PCAN-Basic which is available for Windows and LINUX - so you could use code on both Systems
But all samples codes etc. for our Driver / API is available from our WEB Page - also many samples , documentation etc.
For installing teh LINUX Driver you need to follow teh documentation - step by step - all is very well documented
https://www.peak-system.com/fileadmin/m ... /index.htm
The CAN Basics are a must - but also here you find many resources online. As this is a commercial Forum we only support original PEAK-System CAN Interfaces.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 2
- Joined: Fri 12. Jan 2024, 10:49
Re: How to use my PCAN-usb device with python-can on Ubuntu 18.04
Thanks for the reply. I have installed the Peak-system driver (peak-linux-driver-8.16.0) and PCAN-Basic-Linux-4.7.0.3 API too. Could you please provide a link to the right documentation for my driver and API as I am kind of lost at the moment.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: How to use my PCAN-usb device with python-can on Ubuntu 18.04
As we wrote - you need to know which driver do you use
The "PEAK Driver" could be used as CharDev or Socket CAN - PLEASE read the manual -
check with
PCAN-Basic API / Doku / Samples are available from the WEB Page
Which CAN-Interface do you use exactly ? As i wrote - we do ONLY support PEAK-System CAN Interfaces.
If you buy a PEAK-System CAN Interface you also have the manual that include all information to, also on the product page - all is available...
The "PEAK Driver" could be used as CharDev or Socket CAN - PLEASE read the manual -
check with
Code: Select all
cat proc/pcan
Which CAN-Interface do you use exactly ? As i wrote - we do ONLY support PEAK-System CAN Interfaces.
If you buy a PEAK-System CAN Interface you also have the manual that include all information to, also on the product page - all is available...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------