Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pi@raspberrypi ~ $ sudo su
- # Enable the spi-bcm2708 driver and blacklist the mcp251x driver
- root@raspberrypi:/home/pi# nano /etc/modprobe.d/raspi-blacklist.conf
- # add the spi-config and the new mcp2515 modules in file /etc/modules
- root@raspberrypi:/home/pi# nano /etc/modules
- # the network can0 auto connect.
- root@raspberrypi:/home/pi# nano /etc/network/interfaces
- root@raspberrypi:/home/pi# cat /etc/modules
- # /etc/modules: kernel modules to load at boot time.
- #
- # This file contains the names of kernel modules that should be loaded
- # at boot time, one per line. Lines beginning with "#" are ignored.
- # Parameters can be specified after the module name.
- snd-bcm2835
- # MCP2515 configuration with /INT on GPIO25 and 16MHz clock
- spi-config devices=\
- bus=0:cs=0:modalias=mcp2515:speed=10000000:gpioirq=25:pd=20:pds32-0=16000000:pdu32-4=0x2002:force_release
- #and of course the mcp2515 driver
- mcp2515
- root@raspberrypi:/home/pi# cat /etc/network/interfaces
- auto lo
- iface lo inet loopback
- iface eth0 inet dhcp
- allow-hotplug wlan0
- iface wlan0 inet manual
- wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
- iface default inet dhcp
- auto can0
- iface can0 inet manual
- pre-up /sbin/ip link set can0 type can bitrate 125000
- up /sbin/ifconfig can0 up
- down /sbin/ifconfig can0 down
- root@raspberrypi:/home/pi# reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement