Lesson 1: Agilla Installation

Last Updated on October 18, 2006 6:33 AM .

Note: As of 11/03/2005, the latest version of Agilla is distributed through TinyOS's CVS repository. For instructions on how to install previous versions, click here.

  1. Install TinyOS. I recommend using the CVS version of TinyOS and have posted installation instructions here. If you already have TinyOS, be sure to grab washu.sh and put it in /etc/profile.d/. This script adds important aliases and environment variables used by Agilla.
  2. Download Agilla according to the instructions here.
  3. Create a Makefile.Agilla file containing local settings within $TOSROOT/contrib/wustl/apps/Agilla. Simply copy the example file included 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 Makefile.Agilla.
  4. 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);.
  5. Download Makelocal to $TOSROOT/tools/make. Customize it to your liking, e.g., choose the appropriate radio frequency and group id.
  6. Install Agilla onto every mote including the basestation. Be sure that every mote has a unique TinyOS address.

    cd $TOSROOT/contrib/wustl/apps/Agilla/
    make [platform]
    make [platform] reinstall.[id][programming board],[port]

    For example, the following command will install Agilla on a TelosB mote on COM5 with TinyOS address 0:

    cd $TOSROOT/contrib/wustl/apps/Agilla/
    make telosb
    make telosb reinstall.0 bsl,4

    As another example, the following command will install Agilla on a Mica2 mote on COM1 with TinyOS address 1:

    cd $TOSROOT/contrib/wustl/apps/Agilla/
    make mica2
    make mica2 reinstall.1 mib510,/dev/ttyS0
  7. Agilla's AgentInjector is a Java program that allows users to inject mobile agents in to a wireless sensor network. It is located in $TOSROOT/contrib/wustl/tools/java/. The main class is edu.wustl.mobilab.agilla.AgentInjector.

    Before compiling the AgentInjector, make sure the directory /opt/tinyos-1.x/contrib/wustl/tools/java is in the classpath. If you have washu.sh installed in /etc/profile.d, it will run /opt/tinyos-1.x/contrib/wustl/tools/java/javapath which will ensure the above directory is in your classpath. You can view your classpath by typing the following command:

    echo $CLASSPATH

    Once the classpath is set, go into $TOSROOT/contrib/wustl/tools/java/edu/wustl/mobilab/agilla and copy the file "Example Makefile.Agilla" into "Makefile.Agilla".
    cd $TOSROOT/contrib/wustl/tools/java/edu/wustl/mobilab/agilla
    cp Example\ Makefile.Agilla Makefile.Agilla
    make
    Finally, compile the AgentInjector:
    make
    This will generate all of Agilla's messages using mig and compile the AgentInjector.
  8. Create an agilla.properties file that contains local settings for the AgentInjector:
    cd $TOSROOT/contrib/wustl/tools/java/
    cp Example\ agilla.properties agilla.properties
    This will tell the AgentInjector to by default open the 3Blink mobile agent that simply blinks all 3 LEDs three times and then dies.
  9. If you want to use RMI to remotely inject mobile agents, download java.policy and install it in $TOSROOT/tools/java.
  10. Test the installation by launching the AgentInjector. Attach a mote to the PC and launch the AgentInjector using the appropriate COM port:


    cd $TOSROOT/contrib/wustl/tools/java
    java -Djava.security.policy=java.policy edu.wustl.mobilab.agilla.AgentInjector \
      -comm COM1:57600 -d &

    You should see the following GUI:



    Type Ctrl+r while looking at the motes. They should all turn on all 3 LEDs on for 1 second indicating that they are resetting. If this does not occur, ensure that a mote is correctly attached to the PC. Refer to the troubleshooting section if you continue to have problems injecting agents.

    Type the address of the mote attached to the PC in the TOS Address box, and then click on the Inject Agent!! button. The 3Blink agent will then be compiled and injected into the network. Watch the mote attached to the PC. It should blink its LEDs 3 times each time you inject this agent.

    You are now ready to inject mobile agents into the sensor network!

This work is supported by the ONR MURI Project CONTESSA and the NSF under grant number CCR-9970939.