Hello community,
I am new here, and ask my first question around the CAN protocol, if anyone can help.
I am willing to make a communication between a card (Renesas Rcar H3 starter kit) and a radar sensor (AWR6843AOP) as follows :
Radar-CAN FD > CAN to USB adapter > Card-USB
For that, I boot a linux system on the card, I chose the following USB-CAN adapter which I am not sure about. I only confirmed it uses CAN 2.0a and 2.0b which works with CAN FD. And I will be using my radar to send data.
I have many questions and doubts since I never worked with CAN + if I ask the company to purchase the adapter I must make sure it fits. So my questions are :
Any advice regarding the adapter ?
How canI implement a CAN transmission through linux (even though I checked a few things but it is still unclear).
I have used the InnoMaker USB2CAN with my Linux laptop to sniff the CAN bus. It can appear as a network device, and then I was able to use Wireshark to monitor traffic on the can0 device. All the software to do that was part of Ubuntu, no additional libraries necessary.
The description states that it does have C/Python libraries for working directly with the device using Socket-CAN. I have not experimented with those yet, though I intend to check that out tomorrow…
First I’d suggest you to bring out the can0 Network interface for the USB to can converter. Refer here
Then once you have a can0 interface on the result of ifconfig command. Use this script to initialize can communication with devices on your bus. Be sure to terminate the bus so that that communcation is successful.
This is what you would do in a typical Linux system. Don’t have any idea about the Renesas Rcar H3
More details about the platform and OS would be helpful.
This works because of SocketCAN which is an extension of the way Linux handles networking. Thus the interfaces are named can0, similar to eth0, typically.
Also, while it’s still around on quite a few systems, the ifconfig command set was deprecated* in favor of iproute2 commands… which is kinda funny that CTRE is using both in the same script… maybe I’ll submit a pull request.