Fixes problem on Jetson Nano while attempting to communicate via CAN bus driver (MCP2515). This repo is fork from seeed.
NOTE: It is recommended to reflash your microSD if you did modify the system. Just make sure everything working as intended.
MCP2515 | Jetson Nano |
---|---|
VCC | 5V |
GND | GND |
CS | 24 |
MISO | 21 |
MOSI | 19 |
SCK | 23 |
INT | 31 |
- Open terminal app at your Jetson Nano
- Let's clone this repo. To do that, run these commands
git clone https://github.com/Thor-x86/seeed-linux-dtoverlays cd seeed-linux-dtoverlays
- Then build and install with these commands
make all_jetsonnano sudo make install_jetsonnano
NOTE: You'll asked for password to modify the system. It is normal when you type your password but nothing happens. Just type it as usual then hit enter.
- After that, open utility to configure the Jetson
sudo /opt/nvidia/jetson-io/jetson-io.py
- Hit up or down arrow to navigate. Make sure
Configure Jetson for compatible hardware
is highlighted then hit enter. - Navigate to
MCP251x CAN Controller
and hit enter to select - Choose
Save and reboot to reconfigure pins
and hit enter - Hit enter again to reboot
- Open the terminal again, then enter this command
ip link
- Make sure this word below shown at terminal
If not shown, possibly the wiring is not connected properly or too loose. Already correct? Then the fix is not working and you have to reflash the micro SD and start over.
can0: ...
- Now let's configure the bitrate by entering this command
Change
sudo ip link set can0 type can bitrate <your-bitrate>
<your-bitrate>
to your intended bitrate in bits unit. As example125000
for 125kbps. - To start the CAN driver, enter this command
sudo ifconfig can0 up
- To stop the CAN driver, enter this command
sudo ifconfig can0 down
- Read data from CAN bus
candump can0
- Send "Hi!" text to CAN bus
cansend can0 000#48.69.21.00