Troubleshooting Agilla

From Cyber-Physical Systems Laboratory
Revision as of 22:17, 11 December 2007 by Liangfok (talk | contribs)
Jump to navigationJump to search

Here's a collection of tips on how to get around potential problems when using Agilla. If you are encountering a problem cannot find the solution here, check the Agilla Forum or e-mail liangfok (at) wustl (dot) edu.

Failed Injections

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.


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.


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:

     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

Compilation Errors

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:
         * Windows: nesc-1.1.2b-1.cygwin.i386.rpm
         * Linux: nesc-1.1.2b-1.i386.rpm
     Install the RPM using:
     $ rpm -Uvh --ignoreos --force nesc-1.1.2b*

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.

Run-Time Errors

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. To install it, copy comm.jar into $JAVA_HOME/jre/lib/ext, javax.comm.properties into $JAVA_HOME/jre/lib, and win32comm.dll into $JAVA_HOME/jre/bin.

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.

SerialForwarder

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.

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