Trouble with CANFD using Python on Raspberry Pi 4 B

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
Spezies8472
Posts: 2
Joined: Sun 3. Oct 2021, 15:01

Trouble with CANFD using Python on Raspberry Pi 4 B

Post by Spezies8472 » Sun 3. Oct 2021, 15:41

Hi,

I have trouble with CANFD using Python on a Raspberry Pi 4 B. Last week I have tried to install and test CANFD using Pyton.
I was able to initialize CAN as you can see here:
Image
But opening CANFD failes with parameter error:
Image
I have followed your gide from:
viewtopic.php?t=3381
But i used newest Buster version:
Release date: May 7th 2021
Kernel version: 5.10

Could you please help me. What I am doing wrong?

Best regards

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

Re: Trouble with CANFD using Python on Raspberry Pi 4 B

Post by M.Heidemann » Mon 4. Oct 2021, 07:38

Hello,

You are using python 3.7.3.

In this case (Python 3.x) you'll need to prefix
the Bitrate FD string with "b" in order to
have it interpret this as a byte literal:

Example:

Code: Select all

Result = objPCAN.InitializeFD(PCAN_USBBUS1, b"f_clock=20000000, nom_brp=5, nom_tseg1=2, nom_tseg2=1, nom_sjw=1, data_brp=2, data_tseg1=3, data_tseg2=1, data_sjw=1")
Please report back to us, if this solved your issue.

Best Regards

Marvin

Spezies8472
Posts: 2
Joined: Sun 3. Oct 2021, 15:01

Re: Trouble with CANFD using Python on Raspberry Pi 4 B

Post by Spezies8472 » Mon 4. Oct 2021, 12:28

Hi,

now it works! Thank you very much.


Greetings

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

Re: Trouble with CANFD using Python on Raspberry Pi 4 B

Post by M.Heidemann » Mon 4. Oct 2021, 12:35

Hello,

You're welcome=)

Glad to hear that you were able to resolve this!


- closed -

Locked