PermeAgility has been installed successfully on all models of Raspberry Pi computers including (A+,B,B+,B2). It is a great way to put a full secure web server with data management on a cheap device. The permegility-plus-reality module allows you to setup the collection of sensor readings to the database that you can access it on your home network from any web enabled device.
Here are the steps for setting up PermeAgility on a Raspberry Pi.
Load an SD card with the latest RASPIAN os
Connect a monitor and keyboard (this is the only time you will need it)
Fire it up and do the first raspi-config to configure the following
Expand your filesystem
Allow SSH (under advanced)
Add device drivers if you have any special hardware you want to talk to (I2C, SPI, etc...)
Hook the Raspberry Pi up to your network or set up a wireless dongle (either way, you will need its IP address to continue via SSH and to access it from another computer)
ssh to your Raspberry Pi from your desktop/laptop ssh pi@192.168.1.??
You can now remove the monitor and keyboard and do everything from the comfort of your desktop/laptop computer and continue to set up PermeAgility as per the standard linux deployment instructions
Tutorials for setting up PermeAgility for IoT applications using Raspberry Pi will be coming soon.
To startup PermeAgility at boot time, create the permeagility directory and randr.sh script as per the deployment instructions and create a file called permeagility in the /etc/init.d directory
sudo vi /etc/init.d/permeagility
then paste this into it:
#!/bin/sh
### BEGIN INIT INFO
# Provides: permeagility
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start PermeAgility
# Description: Run unstoppable PermeAgility
### END INIT INFO
case "$1" in
start|"")
echo -n "Starting PermeAgility..."
cd /home/pi/permeagility
./randr.sh &
echo "OK"
;;
start|stop|status|restart|reload|force-reload)
echo "Error: argument '$1' not supported - Use the WebUI" >&2
exit 3
;;
*)
echo "Usage: permeagility [start]" >&2
exit 3
;;
esac
:
Then make it executable
sudo chmod 755 /etc/init.d/permeagility
Then run this command to set it up to start at boot time:
sudo update-rc.d permeagility defaults
To remove it from startup at boot time:
sudo update-rc.d permeagility remove
Note that there is no provision for stop or restart as that can be invoked from the Web interface. This ensures that only an authorized used can stop the server. (or someone with access to kill -9)