CAN Module and OSMC

Hi,

I’m trying to run OSMC as Media Center in my car. For a better control I’m using a CAN module (PiCAN2). Only problem is that I’m not able to get the CAN module working on OSMC while its perfectly working on Raspbian.

I already enabled SPI in the settings and added following lines to the boot/config.txt:

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

Some say you should not use “-overlay” so I also tried without it, but it’s still not working while its perfectly working on Raspbian.

On of the problems is, that /sbin/ip is not available, according to the guide for installing a PiCAN2 on a RPi you need to use the following command to enable the board:

sudo /sbin/ip link set can0 up type can bitrate 100000

Therefore I used "apt-get install iproute2 so I can use /sbin/ip but I guess this is not the right way. When I execute the command I simply get a message, that can0 device can not be found.

Is all of this somehow related to connman? Is there any workaround to enable the can0 interface in OSMC? Would be supercool, as I don’t want to switch back to Raspbian but if it is not possible to get this working I have no other choice :frowning:

Hi,

I’ve not used a Pican2 or similar device, but I think the first here is to find if osmc is seeing it; so I can help with this:

Can you please provide debugging logs, details of this can be found here. This will at least show if your changes to config.txt, have been picked up by OSMC.

Also if you do an ifconfig is can0 (or something similar in the list)

whats the output of:

dmesg | grep can

Thanks Tom.

Hi Tom,

glad that you are trying to help me out here. I did a fresh install and what I noticed was, that after I enabled SPI in myOSMC there was already an entry called “dtoverlay=spi-bcm2835-overlay” there in /boot/config.txt, Sadly situation is still the same, as soon as I run
sudo /sbin/ip link set can0 up type can bitrate 100000
i get an error "Cannot find device “can0”. ifconfig is therefore not containing a can0 interface and dmesg | grep can doesn’t give me any results either.

Here’s a link to my log file: http://paste.osmc.io/obaxivikig

As this is a fresh install I guess I don’t have to hide anything :stuck_out_tongue:

Thanks for your help in advance.

Best Regards
Thomas

Hi,

Unfortunately not a lot to go on in the logs.

whats the output of: lsmod | grep spi

Thanks Tom.

Hi,

this is my result:

osmc@osmc:~$ lsmod | grep spi
spi_bcm2835             7753  0

Best
Tom

Hi Tom,

If remove the following from config.txt:

dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay

reboot, what now is the output of:

dmesg | grep spi 
lsmod | grep spi

Thanks Tom.

After commenting out both of the above mentioned lines I get the following output:

osmc@osmc:~$ dmesg | grep spi
osmc@osmc:~$ lsmod | grep spi
spi_bcm2835             7753  0

Best
Tom

Hi Tom,

Whats the output of:

ls /dev/spidev*

Expected: /dev/spidev0.0 /dev/spidev0.1

If thats correct un-comment

dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25

reboot

whats the output now of:

sudo /sbin/ip link set can0 up type can bitrate 100000

Thanks Tom.

Hi Tom,

the output of ls /dev/spidev* is as expected but uncommenting the line and running the command again still gives me:

Cannot find device “can0”

Best
Tom

@sam_nazarko

Hi Sam,

According to this support for this has added:

Can you please advise?

Thanks Tom.

This was exactly the issues on github that I also found yesterday. It made me think, that it should work with OMSC and that’s why I gave it a try :smiley:

Hi Tom,

I thinking the same as you, thats why I’ve flagged it to Sam.

Regards Tom.

Hi Tom,

Just had another, the request wasn’t closed off untill 17th of last month, have you updated to yesterdays release?

Thanks Tom.

Hi Tom,

I just saw that I was not on the latest version as the installer still ships 2017.3-1 as latest version so I updated to 2017.4-1 manually. Sadly this doesn’t fix the problem, tried all of the above but result is still the same :confused:

Best
Tom

Sorry to hear, hopefully Sam will be able to advise.

If not have you asked http://skpang.co.uk, if they are aware of issues with it working with OSMC.

Thanks Tom.

Hi guys,

so I was in contact with SKPang but the answer was pretty much as expected that it’s an OS related problem.

[…] Looks like OSMC does not support the PiCAN2 board.

Best
Tom

Hi Tom,

Apologies I hadn’t realised it wasn’t in the current release, I’ll try and find out if it will supported on the pi, for a future update.

Thanks Tom.

Hi Tom,

The Can Module drivers should be available when the kernel is upgraded to 4.9, this has been scheduled for next months release.

Sorry for the confusion, over this this issue.

Regards Tom.

hi, Raspberry pi zero W.
Problem with the MCP2515 can Bus board from NiRen.
MCP2515 NiRen
/boot/config.txt

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
dtoverlay=spi-bcm2835-overlay

ssh

reboot

sudo /sbin/ip link set can0 up type can bitrate 100000
$can0 device can not found

ls /dev/spidev*

/dev/spidev0.0 /dev/spidev0.1

everything works on raspbian

What else should I do?

Please provide the system journal. Run grab-logs -J and post the URL it returns.