Installation

From REM

Jump to: navigation, search

Contents

Download REM Software

  • Download the REM Java files. Extract files into ~/java/net/.
  • Download the Tinyos REM MIG-generated files. Extract files into ~/java/net/tinyos/.

Configure REM Software

This is a list of hardcoded variables that you should change. For each Java file and function, change the variable values as noted below. You have to do this because REM does not yet initialize from static files.


Agents

  • EnvironmentMonitor.java

init() add IP addresses to monitor

Resources

  • DataUploader.java

--urlPost(...)

---URL url = new URL("http://127.0.0.1/autoSQL.php");

--urlPost2(...)

---URL url = new URL("http://127.0.0.1/rem/autoSQL2.php");

--postFileToUrlForm(...)

---URL url = new URL("http://127.0.0.1/autoForm.php");

  • ResidentialEnergyManager.java

--init()

---deploymentLocation = "Pleasanton";

---mailServerUser = "user.mail.server";

---emailAddressUser = "userName@user.mail.server";

---emailServerAdmin = "admin.mail.server";

---emailAddressAdmin="adminName@admin.mail.server";

Compile REM Java files.

If you download the java files (instead of the compiled class files), then first compile the REM Java files using your Java compiler. The two supported platforms (PC and NSLU2 w/ OpenSlug) have different compilers and require different command line calls.

Compile on PC Platform using Cygwin or Command Prompt

First, change directories to where the Java files are located. If you are using a Cygwin shell, then use the command:

javac *.java

The ‘*’ is a wildcard meaning the the Java compiler will compile all files in the current directory that end with a ‘.java’ extension.

Compile using Jikes (for NSLU2 platform with OpenSlug)

Be sure to have successfully installed Jikes Java compiler. The OpenSlug wiki has an excellent tutorial describing how to install Jikes.

First, change directories to where the Java files are located. Typically the java files will be located in the ~/home/java directory. Assuming the Java files reside in this directory, then the following command line call will invoke the compiler:

  /opt/bin/jikes -classpath /opt/share/jamvm/classes.zip:/opt/share/classpath/glibj.zip:/home/java *.java

The asterisk ‘*’ is a wildcard meaning the the Java compiler will compile all files in the current directory that end with a ‘.java’ extension.

The Jikes compiler will produce a series of warnings. These warnings do not affect the operation of the REM software.

Install TinyOS Applications

Download the TinyOS application files for GeezerLP, HouseMeter, and TStat (i.e Thermostat). Extract the application files into the respective directories within the ~/tinyos-1.x/apps/ directory. First clean the directories of any residual builds by using the command:

make clean

With a Tmote Sky connected to the PC through the USB port, make and install the desired application using

make tmote install.<number>

Note that <number> is the mote ID (e.g. 1,2,3...).

Set up the server

A PHP-enabled server with a MySQL database is required for the data logging functionality of the REM system. Instructions on how to install and configure on a WindowsXP machine are here.

Create and configure a MySQL table

The data logging functionalities of the current REM version require two specific MySQL tables for each deployment: archive and weather. The archive table stores wireless sensor node information. The weather table stores weather information as gathered by the WeatherMonitor agent. There are two ways to create the tables. The easy way is to import the archive_template and weather_template files directly into the database. The more difficult method is to create the table by hand, making sure the database is syntactically and data type identical to the TinyOS message structures. Correct syntax is required because the REM system automatically extracts message variables from the MIG generated Java classes for individual TinyOS messages. Upload then expects to see identical fields in the database.

Note the table name is case sensitive and must be the resulting concatenation of the deployment name and table type. For example, if the deployment name is “foo” and the table type is archive, the correct table name is “fooarchive”.

Install and configure PHP files onto server

Data logging to the MySQL database uses PHP front-end files for inserting and getting data.

The autoSQL.php file is the core file for managing data uploads to the database. Open the autoSQL.php file and change the “username” and “password” fields for your specific database.

Message files are needed for each TinyOS message in the system. Examples are GeezerMsg.php, TStatMsg.php, and MeterMsg.php. You can use the generatePHP function in REM to generate individual PHP files in real-time as messages are heard.