Difference between revisions of "Agilla Tutorial Lesson 1: Installation"
Line 30: | Line 30: | ||
See $TOSROOT/contrib/wustl/apps/Agilla/README for details on how to customize this file. | See $TOSROOT/contrib/wustl/apps/Agilla/README for details on how to customize this file. | ||
+ | |||
+ | |||
+ | == Step ?: Configuring Environment Variables == | ||
+ | |||
+ | There are several environment variables that will make using Agilla easier. They are not required, but provide shortcuts when performing common tasks. In a Windows XP/Cygwin environment, the following commands may be included in a file called "washu.sh" located within /etc/profile.d/. In a Linux or OSX environment, they can be included in ~/.bash_profile or ~/.bashrc depending on your specific shell. | ||
+ | |||
+ | <pre> | ||
+ | export WUBASE=$TOSROOT/contrib/wustl | ||
+ | alias cdwu="cd $WUBASE" | ||
+ | alias cdwuj="cd $WUBASE/tools/java" | ||
+ | alias cdwua="cd $WUBASE/apps" | ||
+ | alias runsf_pc="java net.tinyos.sf.SerialForwarder -comm tossim-serial &" | ||
+ | alias runsf_com1="java net.tinyos.sf.SerialForwarder -comm serial@COM1:mica2 &" | ||
+ | |||
+ | export AGILLA=$WUBASE/apps/Agilla | ||
+ | alias cda="cd $AGILLA" | ||
+ | alias cdaa="cd $WUBASE/apps/AgillaAgents" | ||
+ | alias cdaj="cd $WUBASE/tools/java/edu/wustl/mobilab/agilla" | ||
+ | alias ri="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -comm COM1:115200 -d &" | ||
+ | alias ri_sim="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -comm tossim-serial -d &" | ||
+ | alias ri_nc="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -nc -d &" | ||
+ | alias mj="cd $TOSROOT/tools/java/edu/wustl/mobilab/agilla; javac *.java" | ||
+ | </pre> | ||
+ | |||
+ | == Step ?: Enabling direct serial communication between Mica2 and Imote2 motes == | ||
+ | |||
+ | In order for Mica2 and MicaZ motes to communicate with Cricket motes, you need to change their UART ports to operate at 115.2kbps (the default is 57.6kbps). To change this, open $TOSROOT/tos/platforms/<platform>/HPLUART0M.nc and change outp(15, UBRR0L); to outp(7, UBRR0L);. | ||
== Downloading Pre-Packaged Versions of Agilla == | == Downloading Pre-Packaged Versions of Agilla == |
Revision as of 06:58, 10 December 2007
The following instructions assume you have a working version of TinyOS installed on your machine.
Step 1: Download
Download the tarball of Agilla's source code from here.
Step 2: Extract
Extract the files using the commands below. By default, the files go under $TOSROOT. On a Windows XP/Cygwin system, $TOSROOT is by default /opt/tinyos-1.x. On a Linux or OSX machine, $TOSROOT is wherever you have installed TinyOS 1.x.
mv Agilla*.tar.gz $TOSROOT cd $TOSROOT tar zxvf Agilla*.tar.gz
Once you have extracted the tarball, Agilla's source code will be located in three directories:
- $TOSROOT/contrib/wustl/apps/Agilla: Agilla's firmware
- $TOSROOT/contrib/wustl/tools/java: Agilla's Agent Injector Application
- $TOSROOT/contrib/wustl/apps/AgillaAgents: Example Mobile Agents.
Step 3: Create Makefile.Agilla
Create a file called "Makefile.Agilla" that contains local settings in $TOSROOT/contrib/wustl/apps/Agilla. To do this, you can simply copy the example file that comes with Agilla.
cd $TOSROOT/contrib/wustl/apps/Agilla cp Example\ Makefile.Agilla Makefile.Agilla
See $TOSROOT/contrib/wustl/apps/Agilla/README for details on how to customize this file.
Step ?: Configuring Environment Variables
There are several environment variables that will make using Agilla easier. They are not required, but provide shortcuts when performing common tasks. In a Windows XP/Cygwin environment, the following commands may be included in a file called "washu.sh" located within /etc/profile.d/. In a Linux or OSX environment, they can be included in ~/.bash_profile or ~/.bashrc depending on your specific shell.
export WUBASE=$TOSROOT/contrib/wustl alias cdwu="cd $WUBASE" alias cdwuj="cd $WUBASE/tools/java" alias cdwua="cd $WUBASE/apps" alias runsf_pc="java net.tinyos.sf.SerialForwarder -comm tossim-serial &" alias runsf_com1="java net.tinyos.sf.SerialForwarder -comm serial@COM1:mica2 &" export AGILLA=$WUBASE/apps/Agilla alias cda="cd $AGILLA" alias cdaa="cd $WUBASE/apps/AgillaAgents" alias cdaj="cd $WUBASE/tools/java/edu/wustl/mobilab/agilla" alias ri="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -comm COM1:115200 -d &" alias ri_sim="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -comm tossim-serial -d &" alias ri_nc="java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector -nc -d &" alias mj="cd $TOSROOT/tools/java/edu/wustl/mobilab/agilla; javac *.java"
Step ?: Enabling direct serial communication between Mica2 and Imote2 motes
In order for Mica2 and MicaZ motes to communicate with Cricket motes, you need to change their UART ports to operate at 115.2kbps (the default is 57.6kbps). To change this, open $TOSROOT/tos/platforms/<platform>/HPLUART0M.nc and change outp(15, UBRR0L); to outp(7, UBRR0L);.
Downloading Pre-Packaged Versions of Agilla
Click here to download a tarball containing Agilla's source code. Once you have downloaded it, you need to extract the source code. By default, the tarball should be extracted to /opt/tinyos-1.x.
Downloading Agilla via CVS
The latest version of Agilla can be downloaded using CVS. It is available through the TinyOS CVS repository located on Sourceforge. Instructions for accessing TinyOS's CVS repository are available here. Checkout module tinyos-1.x/contrib/wustl using the following command:
$ cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login $ cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co \
-P tinyos-1.x/contrib/wustl
If you are TinyOS developer, you can download it using:
$ export CVS_RSH=ssh $ cvs -z3 -d:ext:developername@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co \
-P tinyos-1.x/contrib/wustl
See Tutorial 1 for more details on how to install Agilla.
Demo Releases
* IPSN SPOTS 2005 - NesC, Java
Remote Injection using RMI
RMI is used to remotely inject agents into the sensor network. To do this, you need to install this java policy file in /opt/tinyos-1.x/contrib/wustl/tools/java. See the tutorial on how to remote inject agents via RMI.
Useful Text Editing Tools
For Windows users, I recommend using TextPad to edit NesC and Mobile Agent files. Here are the color-syntax configurations for NesC and Agilla Agent files:
* NesC * Mobile Agent
Install them in <Program Files>\TextPad 4\system. If you are using Linux, I recommend gEdit. Here are the syntax files:
* NesC * Mobile Agent
Install them in /usr/share/gtksourceview-1.0/language-specs/