SHOW:
|
|
- or go back to the newest paste.
1 | pi@raspberrypi ~ $ sudo su | |
2 | # Enable the spi-bcm2708 driver and blacklist the mcp251x driver | |
3 | root@raspberrypi:/home/pi# nano /etc/modprobe.d/raspi-blacklist.conf | |
4 | # add the spi-config and the new mcp2515 modules in file /etc/modules | |
5 | root@raspberrypi:/home/pi# nano /etc/modules | |
6 | # the network can0 auto connect. | |
7 | root@raspberrypi:/home/pi# nano /etc/network/interfaces | |
8 | root@raspberrypi:/home/pi# cat /etc/modules | |
9 | # /etc/modules: kernel modules to load at boot time. | |
10 | # | |
11 | # This file contains the names of kernel modules that should be loaded | |
12 | # at boot time, one per line. Lines beginning with "#" are ignored. | |
13 | # Parameters can be specified after the module name. | |
14 | ||
15 | snd-bcm2835 | |
16 | # MCP2515 configuration with /INT on GPIO25 and 16MHz clock | |
17 | spi-config devices=\ | |
18 | bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=20:pds32-0=16000000:pdu32-4=0x2002:force_release | |
19 | ||
20 | #and of course the mcp2515 driver | |
21 | mcp2515 | |
22 | ||
23 | root@raspberrypi:/home/pi# cat /etc/network/interfaces | |
24 | auto lo | |
25 | ||
26 | iface lo inet loopback | |
27 | iface eth0 inet dhcp | |
28 | ||
29 | allow-hotplug wlan0 | |
30 | iface wlan0 inet manual | |
31 | wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | |
32 | iface default inet dhcp | |
33 | ||
34 | auto can0 | |
35 | iface can0 inet manual | |
36 | pre-up /sbin/ip link set can0 type can bitrate 125000 | |
37 | up /sbin/ifconfig can0 up | |
38 | down /sbin/ifconfig can0 down | |
39 | root@raspberrypi:/home/pi# reboot |