PEAK-Linux Driver on Raspberry Pi

This forum covers PCAN-Linux and Linux development issues concerning our products
haseel
Posts: 9
Joined: Thu 27. Jul 2017, 09:09

Re: PEAK-Linux Driver on Raspberry Pi

Post by haseel » Thu 10. Aug 2017, 06:29

Dear Michael,

Some more clarifications required.
I am able to read and write the CAN messages through command window using "CANSEND" and "CANDUMP" commands, i can send the message to CANBUS from python program using "Write" function also :) , now only difficulty is reading the message through python using "Read" function. It would be great if you clarify why should i install chardev for this particular requirement.

Thanks in advance.

Rgs,
HASEEL

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Thu 10. Aug 2017, 08:10

because we offer only sample for python for the CharDev driver API PCAN-Basic. If you need/want to use the SocketCAN, please google in the community - this is a community driver and thousends of applications that support SocketCAN are available all over the Internet - we could only support our CharDev Driver, which include the PCAN-Basic API (which also support python)

Here the first 3 entrys when google socketCAN and python...
https://python-can.readthedocs.io/en/la ... ative.html
http://www.bencz.com/hacks/2016/07/10/p ... socketcan/
https://www.python-forum.de/viewtopic.php?t=33795
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

haseel
Posts: 9
Joined: Thu 27. Jul 2017, 09:09

Re: PEAK-Linux Driver on Raspberry Pi

Post by haseel » Thu 10. Aug 2017, 13:56

Thanks Mr. Wilhelm,

As you said, i installed chardev and now read function is working with python.Thank you for your great support. But its working only in first execution (needs reboot for working again) after that it showing error " The receive queue is empty" (value of "object.GetErrorText" ). Any idea?

Rgs,
HASEEL

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Thu 10. Aug 2017, 14:31

Looks like your CAN Controller is in BUS OFF mode (could happened if no secod CAN Contrroller is active on the BUS) You do not need to REBOOT - simply call a INIT again... see here
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

haseel
Posts: 9
Joined: Thu 27. Jul 2017, 09:09

Re: PEAK-Linux Driver on Raspberry Pi

Post by haseel » Thu 10. Aug 2017, 15:30

Thanks Mr. Wilhelm,

I am using INIT function in the beginning of my python script ("objPCAN.Initialize(channel, baud)" ), so whenever i run the script it will initialize again, but same error is populating.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Thu 10. Aug 2017, 15:35

Looks like you have a HW Problem - please simply check with a Windows System and PCAN-View or with the LINUX Tools we ship, if it works.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

haseel
Posts: 9
Joined: Thu 27. Jul 2017, 09:09

Re: PEAK-Linux Driver on Raspberry Pi

Post by haseel » Thu 10. Aug 2017, 15:40

Ok, i will check that.

Btw what is actually happening when i do reboot? Can we simulate the same in the script apart from INIT function?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Thu 10. Aug 2017, 15:43

You Re-Init the CAN-Hardware (like plug off / plug on) but calling CAN_Init() again does also a Hardreset.
You need to find the problem - not a workaround for the problem.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

haseel
Posts: 9
Joined: Thu 27. Jul 2017, 09:09

Re: PEAK-Linux Driver on Raspberry Pi

Post by haseel » Wed 16. Aug 2017, 11:32

Hi Wilhelm,

I tried with another PEAK USB device, still issue is persist.

Output of below line is
>> print object.Read(channel)
32, that means QRCVEMPTY , CAN bus is empty.
If i do hard reset (USB remove and connect) then it will work for firsttime. The same error will come in second time.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Wed 16. Aug 2017, 14:30

Looks like your power supply for the RPi is maybe not strong enough - please replace with a supply that could handle more current, or use a Laboratory power supply for testing.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply