Pi Kiosk
And so here we go. I'm going to be doing this one in a few posts because it's actually pretty darn complicated for a noob like me. First of all, nobody has endorsed my reference to certain sites, I'm just trying to make it easier for you to find what you need faster. :)What you will need for the project:
Raspberry Pi (I used the B+ available from www.ifactory.co.za)
Noobs SD card (also www.pifactory.co.za)
HDMI/VGA converter if your monitor isn't HDMI native (www.robotics.org.za)
HDMI cable
Power supply (www.pifactory.co.zahttp://www.pifactory.co.za/node/30)
Keyboard & Mouse (can be wireless with dongle)
Monitor (Any size will do. If at all possible, get one with an HDMI port, otherwise you'll need this converter as the Pi only has HDMI)
Internet connection
For the mirror part you'll need one way mirror or observation glass.
As soon as I have a stockist, I'll post their details here. Another option is to get silver reflective film and apply it to glass.
As I previously stated, this was not my original idea. I got the idea from a very clever Netherlands guy by the name of Michael Teewn. (michaelteeuwn.nl)
However, I tried and failed to get this right about 5 times. Not even kidding. I think this was partly because I am new to linux OS and partly because Michael doesn't explain everything the way that a noob would need to know.
I finally decided to Google Raspberry Pi as a kiosk (which it basically is) and came up with some helpful links that helped me trouble shoot.
A lot of what you need to do with the pi involves updating software via the terminal. But let's go back to basics. I'm going to presume you're new to linux/raspbian and start at the beginning.
First of all, attach your Pi to the monitor, power, Ethernet cable, keyboard and mouse. If you bought the noobs SD card, select Raspbian and let it install. This is pretty straight-forward and will take about 20-30 minutes.
Once it's installed, it'll take you to a screen that looks like this:
I want you to change the following settings:
1. Make sure the system boots to desktop (not command line or scratch)
2. Configure your local settings. For South Africa, look for en_za and timezone Africa.
3. In advanced settings, video memory split to 128 mb.
This isn't as necessary but I also overclocked to medium.
Should you forget any of these settings, you'll have to re-install the OS.
Before I changed the screen rotation or anything like that, I wanted to make sure I installed everything properly. As I said, I did this 5 times before getting it right.
On your desktop, double click LXTerminal.
Type: sudo su
And hit enter
It should now say something like root@raspberrypi:/home/pi#
This identifies you as Root which is important for installing everything we need to do now. Every time I enter Terminal I always change to sudo su.
First, let's update our software.
In the terminal type:
sudo apt-get update && apt-get upgrade -y
This makes sure we're on the latest software and firmware. You need to be on the internet to download all the updates and software we're going to be updating.
This actually caught me up because the servers were down on their side. If you receive any connection errors, try again. If it still doesn't work, try in a few hours or the next day.
Next, let's get Chromium which is basically chrome for the Pi.
In the terminal type:
sudo apt-get install chromium x11-xserver-utils unclutter -y
And hit enter.
Let's get PHP and Apache. This is what allows your Pi to become a web-server.
Apache:
sudo apt-get install apache2 apache2-doc apache2-utilsAnd hit enter.
PHP:
sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcacheAnd hit enter.
Then reboot your pi but clicking on the power button on the bottom right-hand side of the screen and click reboot.
I didn't change much of the code that Michael and others created. If you'd like to read about the interface click here.
Now, on the Pi I want you to go and download via Chromium this file from github. This is the important thingie that makes it all come together. Extract it to your Pi desktop and then you're going to want to do this:
Go back into terminal and type sudo su and hit enter. Then type this:
sudo chown -R pi /var/www
This is going to give you the rights to edit that file.
Go back to your desktop and enter the file you extracted. There will be several files there, namely: css, js, font, githash.php, index.php readme.md and calendar.php
I want you to copy all of them (ctrl c like with windows) and then select your start button (bottom left hand side) go to Accessories->File Manager
In file manager where it says /home/pi type : /var/www and hit enter
Now I want you to paste those files in there. If you get an error, try going back into the terminal and typing sudo chown -R pi /var/www again.
Now delete the index.html. (not the .php)
Now I want you to test everything is working. On a computer in the same network, I want you to go to your browser (chrome/IE etc) and type in your Pi's ip address. It should look like this:
To get the ip address of your pi, go into terminal and type ifconfig and hit enter. Write down the IP address. It should look something like 192.168.1.111.
Now let's change some of the variables since, I don't know about you, but I don't understand Dutch.
In the /var/www file, double click on the js folder, double click on config.js.
I'm going to change the following:
var weatherParams = {
'q':'Baarn,Netherlands',
'units':'metric',
'lang':lang
I am going to change 'Baarn,Netherlands', to 'Johannesburg,South Africa',
Then I changed the var feed to:
var feed = 'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'
//var feed = 'http://www.iol.co.za/cmlink/sport-category-rss-1.704';
//var feed = 'http://www.iol.co.za/cmlink/1.640';
You can change a few of the compliments if you like but when you're done, ctrl save and go back to the browser on the other computer to see the changes.
Ta-da!
Now, I will go into the calender etc another time but for now, I just want to get this working so let's push on.
Let's go back to the terminal and sudo su.
Type: sudo nano /boot/config.txt
And hit enter.
Around the top part of the file, type in the following:
display_rotate=1
And then on your keyboard:
Press Control-x
Press y
Press [enter]
Kioskmode:
Go into Terminal and type: etc/xdg/lxsession/LXDE/autostart
Hit enter.
Remember terminal is case-sensitive so LXDE must be uppercase or the file will be blank and you'll get errors.
Add a # in front of @xscreensaver -no-splash
And add into the file:
@xset s off
@xset -dpms
@xset s noblank
@chromium --kiosk --incognito http://localhost
Press Control-x
Press y
Press [enter]
Now reboot again an voila. It should be rotated and the site should come up upon boot!
Should you just get a blank screen, you can try again by holding down Ctrl/Shift/Q. This will take you to your desktop.
Go back into etc/xdg/lxsession/LXDE/autostart and un-change everything.
Mine works but this post helped a lot. So if you get stuck try that :)
My finished product:
And yes I do look sideways because the display is rotated while it's on its regular stand.
Onto the glass itself in the next Mirror Post.