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:
But opening CANFD failes with parameter error:
I have followed your gide from:
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?
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:
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")
now it works! Thank you very much.
Glad to hear that you were able to resolve this!
- closed -