Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: johand on September 17, 2015, 02:35:00 AM
-
I am completely new to TinyCore. Installed my first system yesterday. So far I am very impressed! I try to enable a CAN interface on Raspberry Pi 2. I use the PICAN board based on MCP2515 (http://skpang.co.uk/catalog/pican-canbus-board-for-raspberry-pi-p-1196.html) and follows the instructions here: http://skpang.co.uk/blog/archives/1165
The problem I found is that the ip-command is not available. Any idea on how to set up the interface without ip? Doesn´t look like it is available in any extension.
Maybe something else is missing making this project “impossible”, but I would like to give it a try.
Johan
-
Hi Johan,
welcome on board. piCore by default contains only the basic kernel modules. For CAN you need to install CAN modules from the repository. It is not there yet, but will add it, please be patient a while. Same for ip command which is part of iproute2.
Are you using piCore 6.x or 7.x?
-
Thank you for your very quick reply! I use 6.1 right now. Should I change to 7.0? Any timeframe for when they will be added to the repository?
Johan
-
6.1 is fine. When it works, would appreciate to try on 7.0 also for testing.
Will try to do it today.
-
iproute2 and can modules added to 6.x / armv7 repo. To install them, as tc user use the following command in the terminal
tce-load -iw iproute2 can-3.18.10_v7-piCore+
or use the tce browser in the gui. Let us know the result or if something still missing.
-
That was quick, thanks!
Noticed that the description for the CAN extension is ” Kernel modules and drivers for Bluetooth”, too much copy-paste?
Unfortunately I cannot get this running (I got it running under Raspbian).
Added to config.txt:
dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
rebooted
tc@box:~$ sudo ip link set can0 up type can bitrate 250000
Cannot find device "can0"
I guess I am missing something really simple. Can you see what is missing?
(this is 6.1, maybe I should try 7.0?)
Johan
-
Yes, it is a copy paste bug, thanks for reporting.
First lets work with 6.1, it must work and there were user feedbacks on working can.
Probably you must load the kernel modules manually. Check with lsmod command whether can modules are loaded and also /dev dir. If not loaded, load them manually:
sudo modprobe can
Probably you must load the driver also not only tha can system itself.
-
I loaded the can module manually and it shows up with lsmod. But it doesn´t show up under /dev. Where can I find the name of the driver to load?
-
Well, just checked and the mcp251x driver module is not in the 3.18 kernel (piCore 6.x), only in the 4.1 kernel (piCore 7.x)
I'm adding the can kernel modules to the 7.x /armv7 repo within an hour. It looks like you need 7.0alpha5
-
Wow now CAN Bela?
Had the chips and microchip Lin/Can tools for a few years, waiting, waiting....
RPi OBD display, Can bus robotics controller.....
Lots of new projects just popped into my head.
You have just blown open the industrial automation field, piCore rules.
Regards
Gavin
-
Sorry to bother you again. Installed 7.0alpha5. But I cannot figure out how to load the driver, where should it be located? Nothing shows up from dmesg. Can also not load the can module any more.
tc@box:~$ sudo modprobe can
modprobe: module can not found in modules.dep
tc@box:~$ lsmod
Module Size Used by Not tainted
ipv6 342679 18 [permanent]
i2c_dev 6027 0
regmap_i2c 2714 0
bcm2835_gpiomem 2987 0
spi_bcm2835 7280 0
i2c_bcm2708 4950 0
regmap_mmio 2969 0
uio_pdrv_genirq 2966 0
uio 8347 1 uio_pdrv_genirq
tc@box:~$
-
Did you install the can-modules-4.1.7-piCore_v7+.tcz package?
-
Yes
tc@box:~$ ls /mnt/mmcblk0p2/tce/optional/
bash.tcz iproute2.tcz.dep mc.tcz
bash.tcz.dep iproute2.tcz.md5.txt mc.tcz.dep
bash.tcz.md5.txt iptables.tcz mc.tcz.md5.txt
bzip2-lib.tcz iptables.tcz.dep nano.tcz
bzip2-lib.tcz.md5.txt iptables.tcz.md5.txt nano.tcz.dep
can-modules-4.1.7-piCore_v7+.tcz ipv6-4.1.7-piCore_v7+.tcz nano.tcz.md5.txt
can-modules-4.1.7-piCore_v7+.tcz.md5.txt ipv6-4.1.7-piCore_v7+.tcz.md5.txt ncurses.tcz
db.tcz libelf.tcz ncurses.tcz.md5.txt
db.tcz.md5.txt libelf.tcz.md5.txt netfilter-4.1.7-piCore_v7+.tcz
file.tcz libffi.tcz netfilter-4.1.7-piCore_v7+.tcz.md5.txt
file.tcz.md5.txt libffi.tcz.md5.txt openssh.tcz
findutils.tcz libgcrypt.tcz openssh.tcz.dep
findutils.tcz.md5.txt libgcrypt.tcz.dep openssh.tcz.md5.txt
gamin.tcz libgcrypt.tcz.md5.txt openssl.tcz
gamin.tcz.md5.txt libgpg-error.tcz openssl.tcz.md5.txt
glib2.tcz libgpg-error.tcz.md5.txt pcre.tcz
glib2.tcz.dep libssh2.tcz pcre.tcz.dep
glib2.tcz.md5.txt libssh2.tcz.dep pcre.tcz.md5.txt
iproute2.tcz libssh2.tcz.md5.txt
tc@box:~$ more /mnt/mmcblk0p2/tce/onboot.lst
mc.tcz
openssh.tcz
nano.tcz
iproute2.tcz
can-modules-4.1.7-piCore_v7+.tcz
findutils.tcz
tc@box:~$
-
can-modules-4.1.7-piCore_v7+.tcz was buggy. Fixed, please update your system.
-
Seems to be working perfect now! Thanks for your support!
I it possible to add these extensions to armv6 as well? I have a plan using MCP2515 with the Raspberry Pi Compute Module in near future.
Johan
-
I can see that you added iproute2 to armv6 as well, but that extension have a broken dependency. It depends on the not existing extension netfilter-4.1.6-piCore+.
Johan
-
Seems to be working perfect now! Thanks for your support!
I it possible to add these extensions to armv6 as well? I have a plan using MCP2515 with the Raspberry Pi Compute Module in near future.
Johan
piCore 7.0alpha for 4.1.7 kernel is a work in progress. There are some issues but will be available soon. There are no intention to release new kernel modules for 7.0alpha with 4.1.6 or older kernel thought.
-
Can these modules be added to 8.x as well? I'm trying to use the same chip. Thanks.
-
Why not make your own extension with it...like this..
Just when the tce-load command remove the w if you get this error message.
tce-load -wil squashfs-tools.tcz
squashfs-tools is already downloaded.
cd
wget http://tinycorelinux.net/8.x/armv6/releases/RPi/src/kernel/4.4.39-piCore%2B_modules.tar.xz -O - | tar -xvJf -
mkdir /tmp/package/usr/local/lib/modules/4.4.39-piCore\+/kernel/drivers/net/can/
cp /home/tc/modules/4.4.39-piCore\+/kernel/drivers/net/can/can-dev.ko $_
mkdir /tmp/package/usr/local/lib/modules/4.4.39-piCore\+/kernel/drivers/net/can/spi/
cp /home/tc/modules/4.4.39-piCore\+/kernel/drivers/net/can/spi/mcp251x.ko $_
tce-load -wil squashfs-tools.tcz
mksquashfs package /etc/sysconfig/tcedir/optional/mcp251x.tcz
echo mcp251x.tcz >> /etc/sysconfig/tcedir/onboot.lst
sync
sudo reboot
-
Thanks :) I'm pretty new to tinycore, that was easy enough.