Update pulse width to 100ms
[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 Cross Compiling on Windows
7 ==========================
8 I am no expert on this but the following seems to work:
9
10 - Download the tool chain here: http://gnutoolchains.com/raspberry/ (I used 4.6.3 universal, which requires a sysroot sync)
11 - Do the sysroot sync (http://gnutoolchains.com/raspberry/tutorial/sysroot)
12 - After the tool chain has synced, use mingw to run make and it should compile (I used git bash).
13
14 NB: When syncing the sysroot, make sure WiringPi is installed on the Pi, otherwise the sysroot on Windows won't have it and compilation will fail.
15
16 Running
17 ======
18 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.
19
20 Pin 7 needs to be shorted to pin 9 for the magic to happen.
21
22 Run ./hdmi-switcher as root, or using sudo.
23
24 Script Automation
25 =================
26 The scripts assume the following:
27 - An fstab entry for /dev/sda1 pointing to /mnt/usb-update
28 - Binary, scripts and public.pem all live in /home/pi/hdmi-switcher
29
30 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 /home/pi/hdmi-switcher
31
32 In addition, it will update the software on the Pi. This will only be copied if the signature can be verified. If a different version of the software is detected then the Pi is rebooted.
33
34 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:
35
36 ```
37 /home/pi/hdmi-switcher/start.sh
38 ```