How to use CanBus with Python on NVIDIA Jetson NX Module?
1- Installing CanBus python packages
2- Using CanBus analyser on host machine
3- Communicating via CanBus
Hardware: DSBOX-NX2 & DSBOARD-NX2
OS: Applied to all JetPack Versions
CanBus with Python ZIP 1
CanBus with Python ZIP 2
In this post, we will use CanBus standard with Python on NVIDIA Jetson NX Module. For doing that, we will use a host machine which has Windows 10 operating system, "IXXAT Usb-to-Can converter" and NVIDIA Jetson NX Module. We need to install Can Analyser interface for checking data stream.
Firstly, download two zip files at the top of the post, go the two zip file’s location and extract them with unzip command on terminal. Then We have to run the script which enables us to use Can standard like below.
sudo chmod +x enable_can_nx.sh./enable_can_nx.sh
"python3-pip", "python3-can" should be install by using "sudo apt-get install" command. "can" and "python-can" should be installed with by using "pip3" command.
sudo apt-get install python3-pippip3 install cansudo apt-get install python3-canpip3 install python-canpip3 install python-can --upgrade
On host side, we have to make sure that the bitrate and protocol are set as "Both" and "500kbit/s" respectively. For doing that, we should click the "setting button".
Then we can set the bitrate and protocol properties from this window. When we are done with the arrangements, we should click the "OK" button.
We use the script to transmit and receive data via CanBus. You can find the script at the end of the post.
sudo python3 testcanbus.py
When we run this script on NVIDIA Jetson NX module, a message will be sent to host machine from the Jetson module.
The sent message can be seen on Can Analyser interface like below.
The written data can be seen on Jetson module.
Thank you for reading our blog post.
If you want to get updated on new blog posts, product launches and discounts, you can fill out the form and sign up for our newsletter. By signing up, you can reach various blog posts about AI, deep learning, machine vision, high-speed cameras, and industrial interfaces.
You will receive a "free shipping" code for next purchase immediately.
cansend can0 123#1122334455667788