2009-04-23 12:43:16 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<simconf>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
2010-03-31 11:35:01 +02:00
|
|
|
<delaytime>-2147483648</delaytime>
|
2009-06-24 16:42:50 +02:00
|
|
|
<randomseed>generated</randomseed>
|
|
|
|
<motedelay_us>1000000</motedelay_us>
|
2009-04-23 12:43:16 +02:00
|
|
|
<radiomedium>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.radiomediums.UDGM
|
2010-03-31 11:35:01 +02:00
|
|
|
<transmitting_range>25.0</transmitting_range>
|
|
|
|
<interference_range>0.0</interference_range>
|
2009-04-23 12:43:16 +02:00
|
|
|
<success_ratio_tx>1.0</success_ratio_tx>
|
|
|
|
<success_ratio_rx>1.0</success_ratio_rx>
|
|
|
|
</radiomedium>
|
2010-03-31 11:35:01 +02:00
|
|
|
<events>
|
|
|
|
<logoutput>40000</logoutput>
|
|
|
|
</events>
|
2009-04-23 12:43:16 +02:00
|
|
|
<motetype>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.ContikiMoteType
|
2012-05-29 11:55:24 +02:00
|
|
|
<identifier>mtype696</identifier>
|
|
|
|
<description>Telnet server example</description>
|
|
|
|
<source>[CONTIKI_DIR]/examples/telnet-server/telnet-server.c</source>
|
2010-03-10 13:29:24 +01:00
|
|
|
<commands>make telnet-server.cooja TARGET=cooja</commands>
|
2013-11-19 12:17:37 +01:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
2009-04-23 12:43:16 +02:00
|
|
|
<symbols>false</symbols>
|
|
|
|
</motetype>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2010-03-31 11:35:01 +02:00
|
|
|
<x>0.0</x>
|
|
|
|
<y>0.0</y>
|
2009-04-23 12:43:16 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
2010-03-31 11:35:01 +02:00
|
|
|
<id>1</id>
|
|
|
|
</interface_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<motetype_identifier>mtype696</motetype_identifier>
|
2010-03-31 11:35:01 +02:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2010-03-31 11:35:01 +02:00
|
|
|
<x>20.0</x>
|
|
|
|
<y>0.0</y>
|
|
|
|
<z>0.0</z>
|
2009-04-23 12:43:16 +02:00
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
2010-03-31 11:35:01 +02:00
|
|
|
<id>2</id>
|
2009-04-23 12:43:16 +02:00
|
|
|
</interface_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<motetype_identifier>mtype696</motetype_identifier>
|
2010-03-31 11:35:01 +02:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2010-03-31 11:35:01 +02:00
|
|
|
<x>40.0</x>
|
|
|
|
<y>0.0</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
2010-03-31 11:35:01 +02:00
|
|
|
<id>3</id>
|
|
|
|
</interface_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<motetype_identifier>mtype696</motetype_identifier>
|
2010-03-31 11:35:01 +02:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2010-03-31 11:35:01 +02:00
|
|
|
<x>60.0</x>
|
|
|
|
<y>0.0</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
2010-03-31 11:35:01 +02:00
|
|
|
<id>4</id>
|
|
|
|
</interface_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<motetype_identifier>mtype696</motetype_identifier>
|
2010-03-31 11:35:01 +02:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2010-03-31 11:35:01 +02:00
|
|
|
<x>80.0</x>
|
|
|
|
<y>0.0</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
2010-03-31 11:35:01 +02:00
|
|
|
<id>5</id>
|
|
|
|
</interface_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<motetype_identifier>mtype696</motetype_identifier>
|
2009-04-23 12:43:16 +02:00
|
|
|
</mote>
|
|
|
|
</simulation>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.SimControl
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>273</width>
|
2010-03-31 11:35:01 +02:00
|
|
|
<z>5</z>
|
2012-05-29 11:55:24 +02:00
|
|
|
<height>201</height>
|
2010-03-31 11:35:01 +02:00
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>0</location_y>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.Visualizer
|
2009-04-23 12:43:16 +02:00
|
|
|
<plugin_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
<skin>org.contikios.cooja.plugins.skins.AddressVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.LEDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.TrafficVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
|
2012-05-29 11:55:24 +02:00
|
|
|
<viewport>3.9267917714869 0.0 0.0 3.9267917714869 52.173676425591204 89.17520347194386</viewport>
|
2010-03-31 11:35:01 +02:00
|
|
|
<hidden />
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>443</width>
|
|
|
|
<z>2</z>
|
|
|
|
<height>203</height>
|
|
|
|
<location_x>271</location_x>
|
|
|
|
<location_y>0</location_y>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.ScriptRunner
|
2009-04-23 12:43:16 +02:00
|
|
|
<plugin_config>
|
2012-06-01 16:44:42 +02:00
|
|
|
<script>TIMEOUT(900000);
|
2009-06-24 16:42:50 +02:00
|
|
|
|
|
|
|
/* conf */
|
2010-03-31 11:35:01 +02:00
|
|
|
NR_MOTES = 5;
|
|
|
|
NR_PINGS = 20;
|
|
|
|
NR_PINGS_MIN = 10;
|
2009-06-24 16:42:50 +02:00
|
|
|
osName = java.lang.System.getProperty("os.name").toLowerCase();
|
|
|
|
if (osName.startsWith("win")) {
|
2012-06-01 16:44:42 +02:00
|
|
|
pingCmd = "ping -w 10000 -n " + NR_PINGS + " "; /* + ip */
|
2009-06-24 16:42:50 +02:00
|
|
|
} else {
|
2012-06-01 16:44:42 +02:00
|
|
|
pingCmd = "ping -i 4 -c " + NR_PINGS + " "; /* + ip */
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
2010-03-31 11:35:01 +02:00
|
|
|
var nrReplies = new Array();
|
|
|
|
replyMsg = "from "; /* + ip */
|
2009-06-24 16:42:50 +02:00
|
|
|
|
2010-03-31 11:35:01 +02:00
|
|
|
/* wait for all motes to boot */
|
|
|
|
currentMote = 1;
|
|
|
|
while (currentMote <= NR_MOTES) {
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.contains('Telnet server'));
|
|
|
|
log.log("Mote " + id + " booted\n");
|
2009-06-24 16:42:50 +02:00
|
|
|
|
2010-03-31 11:35:01 +02:00
|
|
|
currentMote++;
|
|
|
|
}
|
2009-06-24 16:42:50 +02:00
|
|
|
|
2010-03-31 11:35:01 +02:00
|
|
|
GENERATE_MSG(1000, "continue");
|
2009-11-14 11:58:28 +01:00
|
|
|
WAIT_UNTIL(msg.equals("continue"));
|
|
|
|
|
2012-06-04 16:14:05 +02:00
|
|
|
/* override simulation speed limit to realtime */
|
|
|
|
mote.getSimulation().setSpeedLimit(1.0);
|
2009-06-24 16:42:50 +02:00
|
|
|
|
2010-03-31 11:35:01 +02:00
|
|
|
/* ping motes */
|
|
|
|
currentMote = 1;
|
|
|
|
while (currentMote <= NR_MOTES) {
|
|
|
|
nrReplies[currentMote] = 0;
|
|
|
|
ip = mote.getSimulation().getMoteWithID(currentMote).getInterfaces().getIPAddress().getIPString();
|
|
|
|
log.log("Pinging mote " + currentMote + "\n");
|
|
|
|
motePingCmd = pingCmd + ip;
|
|
|
|
log.log("> " + motePingCmd + "\n");
|
|
|
|
|
|
|
|
/* ping process */
|
|
|
|
var pingRunnable = new Object();
|
|
|
|
pingRunnable.run = function() {
|
|
|
|
pingProcess = new java.lang.Runtime.getRuntime().exec(motePingCmd);
|
|
|
|
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
|
|
|
|
while ((line = stdIn.readLine()) != null) {
|
|
|
|
if (line != null && !line.trim().equals("")) {
|
|
|
|
log.log("< " + line + "\n");
|
|
|
|
}
|
|
|
|
if (line.contains(replyMsg + ip)) {
|
|
|
|
nrReplies[currentMote]++;
|
|
|
|
}
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
2010-03-31 11:35:01 +02:00
|
|
|
pingProcess.destroy();
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
2010-03-31 11:35:01 +02:00
|
|
|
var thread = new java.lang.Thread(new java.lang.Runnable(pingRunnable));
|
|
|
|
thread.start();
|
2009-06-24 16:42:50 +02:00
|
|
|
|
2010-03-31 11:35:01 +02:00
|
|
|
while (thread.isAlive()) {
|
|
|
|
GENERATE_MSG(500, "continue");
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
2010-03-31 11:35:01 +02:00
|
|
|
|
|
|
|
currentMote++;
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
2010-03-31 11:35:01 +02:00
|
|
|
|
|
|
|
log.log("\nTEST SUMMARY:\n")
|
|
|
|
testOK = 1;
|
|
|
|
currentMote = 1;
|
|
|
|
while (currentMote <= NR_MOTES) {
|
|
|
|
log.log("Ping replies from mote " + currentMote + ": " + nrReplies[currentMote] + "/" + NR_PINGS + "\n")
|
|
|
|
if (nrReplies[currentMote] < NR_PINGS_MIN) {
|
|
|
|
testOK = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
currentMote++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (testOK == 1) {
|
|
|
|
log.testOK();
|
|
|
|
}
|
|
|
|
log.testFailed();</script>
|
2009-06-24 16:42:50 +02:00
|
|
|
<active>true</active>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>565</width>
|
|
|
|
<z>0</z>
|
|
|
|
<height>517</height>
|
|
|
|
<location_x>715</location_x>
|
2009-06-24 16:42:50 +02:00
|
|
|
<location_y>1</location_y>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin>
|
2010-03-31 11:35:01 +02:00
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.LogListener
|
2010-03-31 11:35:01 +02:00
|
|
|
<plugin_config>
|
|
|
|
<filter />
|
2012-05-29 11:55:24 +02:00
|
|
|
<coloring />
|
2010-03-31 11:35:01 +02:00
|
|
|
</plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>1280</width>
|
|
|
|
<z>4</z>
|
|
|
|
<height>310</height>
|
2010-03-31 11:35:01 +02:00
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>519</location_y>
|
|
|
|
</plugin>
|
2009-04-23 12:43:16 +02:00
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.NativeIPGateway
|
2009-04-23 12:43:16 +02:00
|
|
|
<mote_arg>0</mote_arg>
|
|
|
|
<plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<network_interface>lo</network_interface>
|
2009-06-24 16:42:50 +02:00
|
|
|
<register_routes>true</register_routes>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin_config>
|
|
|
|
<width>388</width>
|
2012-05-29 11:55:24 +02:00
|
|
|
<z>3</z>
|
2010-03-31 11:35:01 +02:00
|
|
|
<height>321</height>
|
|
|
|
<location_x>1</location_x>
|
|
|
|
<location_y>200</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.RadioLogger
|
2010-03-31 11:35:01 +02:00
|
|
|
<plugin_config>
|
|
|
|
<split>150</split>
|
|
|
|
</plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>324</width>
|
|
|
|
<z>6</z>
|
2010-03-31 11:35:01 +02:00
|
|
|
<height>321</height>
|
|
|
|
<location_x>389</location_x>
|
|
|
|
<location_y>200</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.TimeLine
|
2010-03-31 11:35:01 +02:00
|
|
|
<plugin_config>
|
|
|
|
<mote>0</mote>
|
|
|
|
<mote>1</mote>
|
|
|
|
<mote>2</mote>
|
|
|
|
<mote>3</mote>
|
|
|
|
<mote>4</mote>
|
|
|
|
<showRadioRXTX />
|
2012-05-29 11:55:24 +02:00
|
|
|
<split>26</split>
|
|
|
|
<zoomfactor>16662.274975375385</zoomfactor>
|
2010-03-31 11:35:01 +02:00
|
|
|
</plugin_config>
|
2012-05-29 11:55:24 +02:00
|
|
|
<width>1278</width>
|
|
|
|
<z>1</z>
|
|
|
|
<height>149</height>
|
|
|
|
<location_x>1</location_x>
|
|
|
|
<location_y>831</location_y>
|
2009-04-23 12:43:16 +02:00
|
|
|
</plugin>
|
|
|
|
</simconf>
|
|
|
|
|