Score:0

Cannot find device "can0" with Ubuntu-Server 20.04

mw flag

my question is about using the SPI interface to do some things with CAN. On my Raspberry with the Raspberry OS everything worked fine.

Since I want to use the CAN data with ROS, I decided to install Ubuntu Server 20.04 on it. In doing so, I ran into a problem (Cannot find device "can").

These are my configurations:

$ nano /boot/config.txt 

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835
dtparam=spi=on

.

$ ./can_setup.sh 
#!/bin/bash

ip link set can0 up type can bitrate 1000000
ip link set can1 up type can bitrate 1000000

.

$ ls /dev/

shows me that spidev0.0 and spidev0.1 are present

I have analyzed MISO MOSI and SCK with a logic analyzer and seen nothing.

Can someone help me?

Score:0
ro flag

assuming, that you use Ubuntu as OS for running ROS, you should make your entries for dtoverlay inside the /etc/firmware/config.txt.

My can bus device with MCP2515 works fine with Ubuntu 22.04.

Then try

ls /sys/bus/spi/devices/spi0.0/net

It should show something like

can0

Hope this helps ...

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.