Troubleshooting Agilla

Here's a collection of tips on how to get around potential problems.

  1. Problem: Sometimes injecting an agent into a simulated network fails with the AgentInjector asserting a "TIMEOUT". The operating system is Debian Linux.

    Solution: Increase the value of DAGILLA_RCVR_ABORT_TIMER within $TOSROOT/contrib/wustl/apps/Agilla/Makefile.Agilla to 1500.
  2. Problem: When an agent migrates from a simulated node to the uart, the simulation prints "SendStateM: Ack_Timer.fired(): TIMED OUT! (# = 1)" and the AgentInjector receives duplicate State messages.

    Solution: Increase the value of DAGILLA_SNDR_RXMIT_TIMER within $TOSROOT/contrib/wustl/apps/Agilla/Makefile.Agilla to 280.
  3. Problem: You fail to inject an agent into the network. You sometimes get errors saying that the acknowledgement messages contain the wrong message number. The execution trace of an agent trying to migrate onto the base station looks like:
  4. 0: ReceiveStateM: Rcv_State.receive: Received STATE for agent id = 3.
    0: ReceiveStateM: Rcv_State.receive: Sending ACCEPT STATE ACK back to 3.
    0: ReceiveCodeM: Rcv_Code.receive: Received CODE message 1 of 3 for agent 3.
    0: ReceiveCodeM: Rcv_Code.receive: Sending ACCEPT CODE ACK (0) back to node 126.
    0: ReceiveCodeM: Rcv_Code.receive: Resuming ABORT timer for agent 3.
    0: ReceiveCodeM: Rcv_Code.receive: Received CODE message 2 of 3 for agent 3.
    0: ReceiveCodeM: Rcv_Code.receive: Sending ACCEPT CODE ACK (1) back to node 126.
    0: ReceiveCodeM: Rcv_Code.receive: Resuming ABORT timer for agent 3.
    0: ReceiverCoordinatorM: rTimeout(0): agent timed out while arriving.
    0: AgentMgrI.reset(): Resetting agent 3...
    0: AgentMgrI.reset(): Done resetting agent.

    Solution: You need to switch the MIG message format to generate TinyOS messages compatible with TOSSIM. Open $TOSROOT/contrib/wustl/tools/java/edu/wustl/mobilab/agilla/Makefile.Agilla and ensure it contains the following:

    MIG = mig -target=pc java
  5. Problem: When compiling the AgentInjector, you get the following error:
    $ make
    ... /opt/tinyos-1.x/contrib/wustl/tools/java/edu/wustl/mobilab/agilla
    mig java -java-classname=edu.wustl.mobilab.agilla.messages.AgillaAddressAckMsg /
    opt/tinyos-1.x/contrib/wustl/apps/Agilla/types/Agilla.h AgillaAddressAckMsg -o m
    essages/AgillaAddressAckMsg.java
    nesc1: failed to create temporary file
    failed to parse message file /opt/tinyos-1.x/contrib/wustl/apps/Agilla/types/Agi
    lla.h
    make: *** [AgillaAddressAckMsg.java] Error 1
    Solution: You need to update your version of NesC. Download the RPM off of TinyOS's website: Install the RPM using:
    $ rpm -Uvh --ignoreos --force nesc-1.1.2b*
  6. Problem: When compiling the AgentInjector, you get the following error:
    Agent.java:47: package edu.wustl.mobilab.agilla.messages does not exist
    import edu.wustl.mobilab.agilla.messages.*;
    ^
    Solution: Add the directory containing the AgentInjector package to the CLASSPATH. For example, most Windows users would add C:\tinyos\cygwin\opt\tinyos-1.x\contrib\wustl\tools\java.
  7. Problem: When launching the AgentInjector, you get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/SerialPortEventListener
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at net.tinyos.packet.BuildSource.makeSerial(BuildSource.java:360)
            at net.tinyos.packet.BuildSource.makeArgsSerial(BuildSource.java:349)
            at edu.wustl.mobilab.agilla.AgentInjector.connect(AgentInjector.java:157)
            at edu.wustl.mobilab.agilla.AgentInjector.(AgentInjector.java:132)
            at edu.wustl.mobilab.agilla.AgentInjector.main(AgentInjector.java:532)
    Solution 1: You need to install JavaCOMM. Follow the instruction here to install it.

    Solution 2 (Eclipse-Specific): Sometimes Eclipse's settings get screwed up. You can reset it by removing and re-configuring the JRE used by Eclipse. Go into Window, Preferences, Java, Installed JREs. Select the current JRE you are using, and hit "Remove," then OK. Now, go back into the same window, select "Add" and re-configure your JRE.
  8. Problem: When you run the SerialForwarder, you get the following error:
    Couldn't instantiate tossim packet source
      Did you compile tossim?
    Solution: Ensure tinyos-1.x/tools/java is in the classpath. Then recompile the source files by typing make from within tinyos-1.x/tools/java.
  9. Problem: When compiling Agilla's NesC for MicaZ, you run into the following problem:

    /opt/tinyos-1.x/tos/system/ResetC.nc:44: failed to preprocess /opt/tinyos-1.x/to
    s/system/Reset.h
    In component `ResetC':
    /opt/tinyos-1.x/tos/system/ResetC.nc: In function `Reset.reset':
    /opt/tinyos-1.x/tos/system/ResetC.nc:54: implicit declaration of function `reset
    Mote'
    make: *** [exe0] Error 1
    
        

    Solution: This is caused by a bug in $TOSROOT/tos/system/Reset.h. Open this file and change line 47 to be:
    #if defined(PLATFORM_MICA) || defined(PLATFORM_MICA2) || defined(PLATFORM_MICA2DOT) 
      || defined(PLATFORM_MICAZ)

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