Discussion:
[Contiki-developers] Cooja no-gui test
Richard Figura
2009-02-27 15:03:05 UTC
Permalink
Hello,

I try to start a saved test via bash without using the gui (or even better
without the appearance of the gui).
I am very new to contiki and cooja, so perhaps I made a basic mistake.

I have created a new cooja-plugin that implements "plugin" and that has the
PluginType:
@PluginType(PluginType.COOJA_STANDARD_PLUGIN)

In the Plugin-Constructor I call:
gui.doLoadConfig(false, true, file);

As a result I get the following error:

run:
[java] INFO [AWT-EventQueue-0] (GUI.java:2824) - Loading external tools
user settings from: /external_tools_linux_64.config
[java] INFO [AWT-EventQueue-0] (Simulation.java:354) - Simulation random
seed: 123456
[java] INFO [AWT-EventQueue-0] (AutostarterPlugin.java:115) - Plugin
getGui
[java] Exception in thread "AWT-EventQueue-0"
java.util.ConcurrentModificationException
[java] at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
[java] at java.util.AbstractList$Itr.next(AbstractList.java:343)
[java] at se.sics.cooja.GUI.<init>(GUI.java:408)
[java] at se.sics.cooja.GUI$21.run(GUI.java:3433)
[java] at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
[java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
[java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
[java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
[java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Of course the plugin is added to the cooja_default.config, cooja is
recompiled and the file exists.

Can anybody help me with this?
Is this the right way for non-gui testing?

Thanks,
Richard Figura
Fredrik Österlind
2009-02-27 16:17:58 UTC
Permalink
Hi Richard,

The recommended way for non-GUI simulation is creating so called
"Contiki test scripts".
It is also possible to create - like you did - a gui standard plugin
which controls a simulation, however, this is significantly more difficult.

Contiki test scripts consists of a simulation config and a test script
(currently in JavaScript).

To try it out:
* Start Cooja with GUI (ant run)
* Start the plugin "Contiki Test Editor" plugin, and click "Import
Contiki test"
* Import any of the tests listed, for example the cooja_helloworld test
* The simulation config is now loaded (includes Contiki compilation -
may time some time), and the test script is shown in the upper frame
* To run the test, activate the script and start the simulation: Click
"Activate" in the plugin, and start the simulation as usual (Control Panel)
* Observe test output in the lower window

Non-GUI test:
* The same test can be started without GUI by the following command:
/tools/cooja/contiki_tests > bash RUN_TEST cooja_helloworld
* cooja_helloworld.log contains the test output

The Contiki tests operate on mote output, so to create your own test the
simulated nodes must print information that the test script can understand.

Hope this helps,
Fredrik
Post by Richard Figura
Hello,
I try to start a saved test via bash without using the gui (or even better
without the appearance of the gui).
I am very new to contiki and cooja, so perhaps I made a basic mistake.
I have created a new cooja-plugin that implements "plugin" and that has the
@PluginType(PluginType.COOJA_STANDARD_PLUGIN)
gui.doLoadConfig(false, true, file);
[java] INFO [AWT-EventQueue-0] (GUI.java:2824) - Loading external tools
user settings from: /external_tools_linux_64.config
[java] INFO [AWT-EventQueue-0] (Simulation.java:354) - Simulation random
seed: 123456
[java] INFO [AWT-EventQueue-0] (AutostarterPlugin.java:115) - Plugin
getGui
[java] Exception in thread "AWT-EventQueue-0"
java.util.ConcurrentModificationException
[java] at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
[java] at java.util.AbstractList$Itr.next(AbstractList.java:343)
[java] at se.sics.cooja.GUI.<init>(GUI.java:408)
[java] at se.sics.cooja.GUI$21.run(GUI.java:3433)
[java] at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
[java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
[java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
[java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
[java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Of course the plugin is added to the cooja_default.config, cooja is
recompiled and the file exists.
Can anybody help me with this?
Is this the right way for non-gui testing?
Thanks,
Richard Figura
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Richard Figura
2009-03-01 09:47:48 UTC
Permalink
Hi Fredrik,

thank you very much!
This helps me a lot :-)

Richard
Post by Fredrik Österlind
Hi Richard,
The recommended way for non-GUI simulation is creating so called
"Contiki test scripts".
It is also possible to create - like you did - a gui standard plugin
which controls a simulation, however, this is significantly more difficult.
Contiki test scripts consists of a simulation config and a test script
(currently in JavaScript).
* Start Cooja with GUI (ant run)
* Start the plugin "Contiki Test Editor" plugin, and click "Import
Contiki test"
* Import any of the tests listed, for example the cooja_helloworld test
* The simulation config is now loaded (includes Contiki compilation -
may time some time), and the test script is shown in the upper frame
* To run the test, activate the script and start the simulation: Click
"Activate" in the plugin, and start the simulation as usual (Control Panel)
* Observe test output in the lower window
/tools/cooja/contiki_tests > bash RUN_TEST cooja_helloworld
* cooja_helloworld.log contains the test output
The Contiki tests operate on mote output, so to create your own test the
simulated nodes must print information that the test script can understand.
Hope this helps,
Fredrik
Post by Richard Figura
Hello,
I try to start a saved test via bash without using the gui (or even
better without the appearance of the gui).
I am very new to contiki and cooja, so perhaps I made a basic mistake.
I have created a new cooja-plugin that implements "plugin" and that has
@PluginType(PluginType.COOJA_STANDARD_PLUGIN)
gui.doLoadConfig(false, true, file);
[java] INFO [AWT-EventQueue-0] (GUI.java:2824) - Loading external
tools user settings from: /external_tools_linux_64.config
[java] INFO [AWT-EventQueue-0] (Simulation.java:354) - Simulation
random seed: 123456
[java] INFO [AWT-EventQueue-0] (AutostarterPlugin.java:115) -
Plugin getGui
[java] Exception in thread "AWT-EventQueue-0"
java.util.ConcurrentModificationException
[java] at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
[java] at java.util.AbstractList$Itr.next(AbstractList.java:343)
[java] at se.sics.cooja.GUI.<init>(GUI.java:408)
[java] at se.sics.cooja.GUI$21.run(GUI.java:3433)
[java] at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
[java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
[java] at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.j
ava:269) [java] at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java
:184) [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.j
ava:174) [java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
[java] at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
[java] at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Of course the plugin is added to the cooja_default.config, cooja is
recompiled and the file exists.
Can anybody help me with this?
Is this the right way for non-gui testing?
Thanks,
Richard Figura
-------------------------------------------------------------------------
----- Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA -OSBC tackles the biggest issue in open source: Open
Sourcing the Enterprise -Strategies to boost innovation and cut costs
with open source participation -Receive a $600 discount off the
registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
---------------------------------------------------------------------------
--- Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing
the Enterprise -Strategies to boost innovation and cut costs with open
source participation -Receive a $600 discount off the registration fee with
the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Contiki-developers mailing list
https://lists.sourceforge.net/lists/listinfo/contiki-developers
Loading...