Software setup - mjp-2013/bbqTemp GitHub Wiki
I use updated Raspbian “wheezy”.
sudo apt-get update sudo apt-get upgrade)
JAVA and Tomcat (servlet container)
sudo apt-get install openjdk-7-jdk Download Tomcat from http://tomcat.apache.org/download-60.cgi (I use 6.xx version) un-archive tomcat eg. to /usr/local/ (you can start tomcat with sudo /usr/locat/tomcatdir/bin/catalina.sh start
Configure tomcat manager application to allow easy deploy of BBQTemp jar file. Add this line to tomcat-user.xml (which locates in tomcat installdir / conf directory.
<user username="tomcat" password="secretpassword" roles="manager-gui"/>
Install WiringPI as instructed in: https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/
Install pi4j
wget http://pi4j.googlecode.com/files/pi4j-0.0.4.deb (or the latest snapshot) sudo dpkg -i pi4j-0.0.4.deb (this installs the library and examples into /opt/pi4j
Install JDBC Driver to Tomcat http://jdbc.postgresql.org/download.html download the JDBC4 jar and copy it to tomcatdir/lib
Install postgresql server
sudo apt-get install postgresql sudo apt-get install postgresql-client edit /etc/postgresql/9.1/main/pg_hba.conf to allow connections from your network (e.g. "host all all 192.168.0.0/24 trust") NOTE: if you need to connect database from outside edit /etc/postgresql/9.1/main/postgresql.conf (allow tcp ip connections listen_addresses = '*' for all connections.)
Setup database and user
su <enter> su postgres <enter> createuser -P <enter> bbqtemp <enter> bbqtemp <enter> psql <enter> create database bbqtemp owner bbqtemp; <enter> \quit <enter>
TODO DB Table creation... and better way to make bbqtemp users..
To ensure that SPI is enabled on the Raspberry pi
sudo modprobe spi_bcm2708 You can add spi_bcm2708 to /etc/modules for autoloading SPI module on startup gpio load spi
Deploy BBQ temp WAR file with tomcat manager web-app