Skip to content
Andrew Wippler edited this page Dec 30, 2015 · 3 revisions

Webserver

sudo apt-get install apache2-bin php5-mysql php5-gd php5-curl php5-json php5 libapache2-mod-php5
# cd /var/
# git clone https://github.com/andrewwippler/rpi-wayfinding.git www
Crontab:
crontab -e

Contents:

1 0 * * * curl --silent --compressed http://localhost/cron_daily.php
1,16,31,46 * * * * curl --silent --compressed  http://localhost/cron_regularly.php
MySQL
CREATE DATABASE IF NOT EXISTS rpiwayfinding;
CREATE USER 'wayfinding'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON rpiwayfinding.* TO 'wayfinding'@'localhost';
USE rpiwayfinding;
CREATE TABLE IF NOT EXISTS events (PID INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(PID),EventName TEXT,Start DATETIME,End DATETIME,Room TEXT,Grp TEXT,Bldg TEXT);
Final steps
  1. Edit rooms.php
  2. Edit settings.php

RPi

sudo apt-get install feh
Create shell script
touch /home/pi/rpi-wayfinding.sh
chmod +x /home/pi/rpi-wayfinding.sh
nano /home/pi/rpi-wayfinding.sh

Contents (where UPPERCASE is the same as inside rooms.php):

#!/bin/bash

sleep 75
feh --hide-pointer -F -R 1200 http://webserver/image.php?i=RPI &

For a group (floor level) sign:

#!/bin/bash

sleep 75
feh --hide-pointer -F -R 1200 http://webserver/image.php?g=GROUPNAME &

For a building (lobby) sign:

#!/bin/bash

sleep 75
feh --hide-pointer -F -R 1200 http://webserver/image.php?b=BLDGNAME &
Create autorun on start
mkdir /home/pi/.config/autostart
nano /home/pi/.config/autostart/rpi-wayfinding.desktop

Contents:

[Desktop Entry]
Type=Application
Exec=/home/pi/rpi-wayfinding.sh
Rotating the RPi for group/building screens

1 = 90* clockwise 3 = 270* clockwise (90* counter-clockwise)

sudo echo display_rotate=1 >> /boot/config.txt