Skip to content

Instantly share code, notes, and snippets.

@ekapujiw2002
Forked from andrewvaughan/piboard.md
Created October 6, 2015 01:45
Show Gist options
  • Save ekapujiw2002/c22782112f3f8c947f1f to your computer and use it in GitHub Desktop.
Save ekapujiw2002/c22782112f3f8c947f1f to your computer and use it in GitHub Desktop.
Create a Raspberry Pi Rotating Dashboard

These instructions were performed on a RaspberryPI 2 with a proper heatsink.

Install NOOBS

  1. Follow these instructions to install NOOBS with a Mac.
  2. Choose "Raspbian" from the selected options when installing.

Configure the Pi

sudo raspi-config
  1. Choose 1. Expand Filesystem
  2. Choose 3. Enable Boot to Desktop/Scratch and choose Desktop Log in as user 'pi' at the graphical desktop
  3. Choose 7. Overclock and choose Medium
  4. Choose 8. Advanced Options
  5. Choose A1 Overscan and Enable it
  6. Choose A2 Hostname and set a hostname

Make VIM work with arrows and backspace

vi ~/.vimrc

Set these configurations:

set nocp
set backspace=2

Set the default display to the pi, not SSH

vi ~/.bashprofile

Add this line:

export DISPLAY=:0

And reload:

. ~/.bashprofile

Setup WiFi for WPA2-Enterprise

sudo -E vi /etc/wpa_supplicant/wpa_supplicant.conf

Make the file look like this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="HHC"
        proto=RSN
        key_mgmt=WPA-EAP
        pairwise=CCMP
        auth_alg=OPEN
        eap=PEAP
        identity="hhc\YOUR_GID"
        password="YOUR_PASSWORD"
        phase2="auth=MSCHAPV2"
        scan_ssid=1
}

Then reboot

sudo shutdown -r now

Update Aptitude

sudo apt-get update
sudo apt-get upgrade

Install Packages

  • iceweasel - A Mozilla Firefox port without branding made for the Pi
  • gnash and lightspark - Adobe Flash alternatives
  • nginx - Our web server
  • php5 - PHP server
sudo apt-get install iceweasel gnash gnash-common browser-plugin-gnash lightspark browser-plugin-lightspark nginx php5 php5-cli php5-fpm

Create server info site

mkdir ~/www
vi ~/www/index.php

Add the following:

<!doctype html>
<html>
  <head>
    <title>Server Information</title>
  </head>
  <body>
    <table width="80%" align="center">
      <tr>
        <td>Server IP</td>
        <td><?php echo $_SERVER["SERVER_ADDR"]; ?></td>
      </tr>
      <tr>
        <td>Details</td>
        <td><?php echo php_uname(); ?></td>
      </tr>
    </table>
  </body>
</html>

Setup Nginx

sudo -E vi /etc/nginx/sites-enabled/default

Delete the file contents and add this:

server {
  listen      80;
  server_name localhost;
  
  root  /home/pi/www;
  
  location / {
    index index.html index.php;
  }
  
  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    
    include       fastcgi_params;
  }
}

Setup Iceweasel

iceweasel

Install these addons and restart:

Setup tabs to go through, and modify preferences to open those tabs each time.

Disable Power Saving and Boot into Iceweasel Kiosk

ln -s /etc/xdg/lxsession/LXDE-pi/autostart ~/autostart
sudo -E vi ~/autostart

Make the file look as follows:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash

# Turn off screen power saving
@xset s off
@xset -dpms
@xset s noblank

# Start Iceweasel by default
@iceweasel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment