Update readme
[hdmi-switcher.git] / README.md
1 Setting Up
2 =========
3 - Install WiringPi. Easy instructions here http://wiringpi.com/download-and-install/
4 - That's it at this stage. The makefile takes care of the rest.
5
6 Running
7 ======
8 The pin numbers can be confusing. If you hold the Pi such that the GPIO header is on the *RIGHT* hand side of the board, the top left pin is refered to as pin 1, the pin directly to the right of it is pin 2. The pins continue to be named in this fashion.
9
10 Pin 7 needs to be shorted to pin 9 for the magic to happen.
11
12 Run ./hdmi-switcher as root, or using sudo.
13
14 Script Automation
15 =================
16 The scripts assume the following:
17 - An fstab entry for /dev/sda1 pointing to /mnt/usb-update
18 - Binary and scripts live in /home/pi/hdmi-switcher
19
20 The usb-update script will naively look to see if /dev/sda1 exists. If it does, it mounts it and then copies over any files on the drive with names config.ini, video.mp4 to the cwd.
21
22 In addition, it will update the software on the Pi. Unlike when config.ini and video.ini are copied, the software will always be extracted to /home/pi/hdmi-switcher (this is to stop me accidentally overwriting changes when I modify source code in /home/pi/hdmi-switcher-src)
23
24 If you want to run the script on boot, you should use start.sh. start.sh runs the usb-update script, and then starts playing video.mp4 on a loop. It uses omxplayer (make sure whatever version you use has the --loop option). I would suggest simply adding the following to /etc/init.d/rc.local:
25
26 ```
27 /home/pi/hdmi-switcher/start.sh
28 ```