As the title says this guide will cover steps needed to configure Raspberry pi (2/3) to accept messages from RNS-E. This will allow to use RNS-E buttons to control Kodi player on the Raspberry PI (2/3).You will need:
- RNS-E. It can be from A4 and from A6, it can be model 1 and model 2 (media button and LED screen). I will be using A4 first model RNS-E. Most of this guide should work with RNS-D too.
- Original TV Tuner of Audi or Multimedia Adapter IMA Interface RNS-E Symphony 3 Video TV Cable Plug Audi. I am using Multimedia Adapter from Ebay.
- Raspberry 2 or 3 with accessories (microSD card and charger). Both will work and have identical steps.
- A/V Composite Cable – 3.5mm to 3 x RCA. Make sure you get correct cable, as it did have some changes between Raspberry versions. Pi (2/3) has 4 sectors in the cable, one of them is ground, without it, you might have some static noise.
- PiCAN2 CAN-Bus Board for Raspberry Pi 2. Bought it from skpang. Took a box too, which is optional.
I have used 16GB Class 10 micro SD card, you can use the one you have and smaller storage, but keep in mind that Kodi does requires fast storage.
For the base of this project I have selected 2016-05-10-raspbian-jessie-lite image, you should be able to use any Raspbian based operating system, but I selected this to keep packages to the minimal amount.
In order to begin write image to the microSD card and insert it to the Raspberry Pi. Plug in the Ethernet cable and power it on.
Use SSH client (Putty for example) to connect to it, for that you will need IP address of the device, check your router in order to locate it.
Default login information is:
Once you are logged in we need to enable some features and update the image we are using, in order to do so type:
In this tool you need to go through these sections:
- 1. Expand Filesystem – Select it and wait few moments, then just click Ok.
- 3. Boot Options – Select it and then in the next windows “Console Autologin”, then click OK.
- 4 Wait for Network at Boot – Select it and then “Fast Boot without waiting for network connection”. This will speed up Kodi launch a lot.
- 9 Advanced Options – Select it and then “A5 SPI”, select “Yes” to enable SPI Interface.
- Now select “Finish” and reboot.
You will be disconnected from the Raspberry, wait few moment and re-connect back with your SSH client. Now we need to update current software in the operating system. In order to do so type:
sudo apt-get update
sudo apt-get upgrade
This might take a while, after that is done install some other packages which we will need to use later:
sudo apt-get install git python-setuptools autoconf libtool
Now it is good time to adjust boot configuration file to load needed modules:
sudo nano /boot/config.txt
Command above will open text file which we need to modify. Note please that # means that parameter is commented out and does not work. Leaving it in there as a referrence, as that was parameter which you had to use in previous Rasbian versions.
Now some explanations. First 4 lines (including #) are for canbus module, other 3 are to force video format and disable splash. As RNS-E is quite old device, we need to force Raspberry to use PAL signal. Now we need to reboot to apply all changes and new boot commands.
Then re-connect again and use this command, if all is ok you should not receive any response:
sudo /sbin/ip link set can0 up type can bitrate 100000
You should see this can0-00:
If all is as above, then we can continue. Now we need to use these commands, there must be no error reports at all:
git clone https://github.com/linux-can/can-utils.git
sudo make install
Now whole PiCan side is done, yet we still need to start it automatically with the system. in order to do that:
sudo nano /etc/rc.local
Then scroll down and just above “exit 0” type this:
sudo python /home/pi/python_can.py
At the moment python_can.py file does not exist and we need to create. In order to do so:
And paste this text in to it. This is needed to auto start can0 and to launch kodi as root. I personally no longer start kodi as root:
#os.system("sudo ip link set can0 up type can bitrate 100000 restart-ms 100 loopback on")
os.system("ip link set can0 up type can bitrate 100000 restart-ms 100")
Now while you are in /home/pi type:
tar -xvf hardbyte-python.tar
sudo python setup.py install
sudo nano /usr/local/lib/python2.7/dist-packages/python_can-1.4.3-py2.7.egg/can/interfaces/interface.py
Last command will open editor, which you need to use to add two lines:
can.rc['interface'] = 'socketcan_ctypes'
can.rc['channel'] = 'can0'
PiCan part is completed. Now we need to install Kodi:
sudo apt-get install kodi
Installation will take a while to complete. After that:
sudo nano edit /etc/default/kodi
In there change user name from kodi to pi and change auto-start Enable 0 to 1
Once that is done reboot your system and and re-connect. Kodi should start automatically now, as there are no other GUI.
Now we need to install some add-ins for Kodi:
You can install them from Kodi settings, addons install from zip. While you are in the settings of kodi you also should go to Settings – Services – Webserver – Allow control via HTTP.
That is pretty much it. This article is collection of the information I have located from various sources.