Hi guys,
I've had a little project in mind of connecting a RaspberryPi to my '04 1.9Tdi. What the end of this will be is yet to be decided.
I've found a lot of information and examples here, but can't find any information on the can bus PIDs, so thought I'd post my own findings here, for anyone else, or as just a back up for me.
I have used a Raspberry Pi 3 (so has Bluetooth and WiFi built in)
4gb SD Card
and USB key sticks
for the CAN connection, the PiCAN HAT from skpang.co.uk
I previously added a device to connect a phone/iPod with a 3.6mm headphone cable which tricks the radio into thinking there is a CD changer installed, I used this to splice into the CANH and CANL to connect to the PiCAN HAT
Once the Pi is connected and powered up, ssh in and run the following:
## run as root
# remove unneeded packages
apt remove --purge scratch minecraft-pi sonic-pi dillo gpicview penguinspuzzle Wolfram-engine libreoffice
apt-get clean && sudo apt-get autoremove
apt update
apt upgrade
# install packages
apt install can-utils
apt install realvnc-vnc-server
apt install wireshark
# add needed to /boot/config.txt
sed 's/#dtparam=spi=on/dtparam=spi=on/' -i /boot/config.txt
echo "dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25" >> /boot/config.txt
echo "dtoverlay=spi-bcm2835-overlay" >> /boot/config.txt
echo "dtoverlay=spi-dma-overlay" >> /boot/config.txt
# add to /etc/network/interfaces
echo "auto can0" >> /etc/network/interfaces
echo "iface can0 inet manual" >> /etc/network/interfaces
#
# 100kbs (info bus) ###
echo " pre-up ip link set $IFACE type can bitrate 100000 listen-only off triple-sampling on" >> /etc/network/interfaces
echo " up /sbin/ifconfig $IFACE up" >> /etc/network/interfaces
echo " down /sbin/ifconfig $IFACE down" >> /etc/network/interfaces
# reboot at this point
At the moment I am connected to the info bus, bit rate of 100kbs
I've had a little project in mind of connecting a RaspberryPi to my '04 1.9Tdi. What the end of this will be is yet to be decided.
I've found a lot of information and examples here, but can't find any information on the can bus PIDs, so thought I'd post my own findings here, for anyone else, or as just a back up for me.
I have used a Raspberry Pi 3 (so has Bluetooth and WiFi built in)
4gb SD Card
and USB key sticks
for the CAN connection, the PiCAN HAT from skpang.co.uk
I previously added a device to connect a phone/iPod with a 3.6mm headphone cable which tricks the radio into thinking there is a CD changer installed, I used this to splice into the CANH and CANL to connect to the PiCAN HAT
Once the Pi is connected and powered up, ssh in and run the following:
## run as root
# remove unneeded packages
apt remove --purge scratch minecraft-pi sonic-pi dillo gpicview penguinspuzzle Wolfram-engine libreoffice
apt-get clean && sudo apt-get autoremove
apt update
apt upgrade
# install packages
apt install can-utils
apt install realvnc-vnc-server
apt install wireshark
# add needed to /boot/config.txt
sed 's/#dtparam=spi=on/dtparam=spi=on/' -i /boot/config.txt
echo "dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25" >> /boot/config.txt
echo "dtoverlay=spi-bcm2835-overlay" >> /boot/config.txt
echo "dtoverlay=spi-dma-overlay" >> /boot/config.txt
# add to /etc/network/interfaces
echo "auto can0" >> /etc/network/interfaces
echo "iface can0 inet manual" >> /etc/network/interfaces
#
# 100kbs (info bus) ###
echo " pre-up ip link set $IFACE type can bitrate 100000 listen-only off triple-sampling on" >> /etc/network/interfaces
echo " up /sbin/ifconfig $IFACE up" >> /etc/network/interfaces
echo " down /sbin/ifconfig $IFACE down" >> /etc/network/interfaces
# reboot at this point
At the moment I am connected to the info bus, bit rate of 100kbs