moved test scripts into simulation config (.csc)

This commit is contained in:
fros4943 2009-06-24 14:42:50 +00:00
parent 28a9b815b5
commit 2a5781566f
52 changed files with 2285 additions and 2072 deletions

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -18,7 +18,7 @@
</radiomedium>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype4</identifier>
<identifier>mtype82</identifier>
<description>Contiki Mote Type #1</description>
<contikiapp>../../../examples/hello-world/hello-world.c</contikiapp>
<commands>make hello-world.cooja TARGET=cooja</commands>
@ -34,15 +34,15 @@
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLog</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<symbols>false</symbols>
<commstack>Rime</commstack>
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype4</motetype_identifier>
<motetype_identifier>mtype82</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>69.64867743029201</x>
@ -57,41 +57,56 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.4.7</ipv4address>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Log output: printf()'s</skin>
</plugin_config>
<width>259</width>
<z>1</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>2</z>
<height>300</height>
<location_x>600</location_x>
<location_y>0</location_y>
<height>198</height>
<location_x>2</location_x>
<location_y>203</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>900</width>
<width>259</width>
<z>2</z>
<height>217</height>
<location_x>2</location_x>
<location_y>403</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.SimControl
<width>259</width>
<z>3</z>
<height>200</height>
<location_x>2</location_x>
<location_y>3</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>592</width>
<z>0</z>
<height>209</height>
<location_x>0</location_x>
<location_y>591</location_y>
<height>618</height>
<location_x>264</location_x>
<location_y>3</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,4 +0,0 @@
TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK();

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -15,7 +18,7 @@
</radiomedium>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype17</identifier>
<identifier>mtype232</identifier>
<description>Receiver</description>
<contikiapp>../../../examples/udp-receiver-ipv6/example-udp-receiver.c</contikiapp>
<commands>make example-udp-receiver.cooja TARGET=cooja DEFINES=WITH_UIP6=1,UIP_CONF_IPV6=1,UDP_ADDR_A=0xfe80,UDP_ADDR_B=0,UDP_ADDR_C=0,UDP_ADDR_D=0,UDP_ADDR_E=0x2,UDP_ADDR_F=0x2ff,UDP_ADDR_G=0xfe02,UDP_ADDR_H=0x0202</commands>
@ -38,7 +41,7 @@
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype18</identifier>
<identifier>mtype330</identifier>
<description>Sender</description>
<contikiapp>../../../examples/udp-sender-ipv6/example-udp-sender.c</contikiapp>
<commands>make example-udp-sender.cooja TARGET=cooja DEFINES=WITH_UIP6=1,UIP_CONF_IPV6=1,UDP_ADDR_A=0xfe80,UDP_ADDR_B=0,UDP_ADDR_C=0,UDP_ADDR_D=0,UDP_ADDR_E=0x301,UDP_ADDR_F=0x1ff,UDP_ADDR_G=0xfe01,UDP_ADDR_H=0x101</commands>
@ -61,7 +64,7 @@
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype17</motetype_identifier>
<motetype_identifier>mtype232</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>98.76075470611741</x>
@ -76,14 +79,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ip>fe80.0000.0000.0000.0301.01ff.fe01.0101</ip>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype18</motetype_identifier>
<motetype_identifier>mtype330</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>58.59043340181549</x>
@ -98,65 +97,81 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ip>fe80.0000.0000.0000.0002.02ff.fe02.0202</ip>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>5</z>
<z>4</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>300</width>
<z>3</z>
<height>300</height>
<location_x>714</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter>ID:1</filter>
<history>256</history>
</plugin_config>
<width>1014</width>
<z>1</z>
<height>284</height>
<location_x>0</location_x>
<location_y>564</location_y>
<width>249</width>
<z>2</z>
<height>181</height>
<location_x>1</location_x>
<location_y>521</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>printf()'s + LEDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>300</width>
<z>4</z>
<height>300</height>
<location_x>414</location_x>
<location_y>1</location_y>
<width>246</width>
<z>3</z>
<height>121</height>
<location_x>1</location_x>
<location_y>201</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>1014</width>
<z>2</z>
<height>261</height>
<width>246</width>
<z>1</z>
<height>198</height>
<location_x>0</location_x>
<location_y>301</location_y>
<location_y>323</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(msg.contains("Created connection"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Created connection"));
log.log("Both nodes booted\n");
count = 0;
while (count++ &lt; 5) {
/* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver received"));
log.log(count + ": Sender -&gt; Receiver OK\n");
/* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender received"));
log.log(count + ": Receiver -&gt; Sender OK\n");
}
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>700</height>
<location_x>250</location_x>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,21 +0,0 @@
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(msg.contains("Created connection"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Created connection"));
log.log("Both nodes booted\n");
count = 0;
while (count++ < 5) {
/* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver received"));
log.log(count + ": Sender -> Receiver OK\n");
/* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender received"));
log.log(count + ": Receiver -> Sender OK\n");
}
log.testOK(); /* Report test success and quit */

View file

@ -4,11 +4,10 @@
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<project>C:/home/nes/contiki/checkpointing-demo</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<randomseed>123456</randomseed>
<randomseed>generated</randomseed>
<motedelay_us>5000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
@ -54,7 +53,7 @@
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype2</identifier>
<identifier>mtype914</identifier>
<description>Contiki Mote Type #1</description>
<contikiapp>../../../examples/rime/example-abc.c</contikiapp>
<commands>make example-abc.cooja TARGET=cooja</commands>
@ -77,7 +76,7 @@
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype2</motetype_identifier>
<motetype_identifier>mtype914</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
@ -95,7 +94,7 @@
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype2</motetype_identifier>
<motetype_identifier>mtype914</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
@ -114,6 +113,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>100.0</x>
@ -128,6 +128,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>100.0</x>
@ -142,6 +143,7 @@
<mote>
se.sics.cooja.mspmote.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>200.0</x>
@ -156,6 +158,7 @@
<mote>
se.sics.cooja.mspmote.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>200.0</x>
@ -169,7 +172,7 @@
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype2</motetype_identifier>
<motetype_identifier>mtype914</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>300.0</x>
@ -188,6 +191,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>300.0</x>
@ -201,7 +205,7 @@
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype2</motetype_identifier>
<motetype_identifier>mtype914</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>400.0</x>
@ -220,6 +224,7 @@
<mote>
se.sics.cooja.mspmote.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>400.0</x>
@ -235,7 +240,7 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>265</width>
<z>1</z>
<z>4</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
@ -244,14 +249,13 @@
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
<filter>rec</filter>
</plugin_config>
<width>632</width>
<width>265</width>
<z>3</z>
<height>143</height>
<location_x>-2</location_x>
<location_y>650</location_y>
<height>169</height>
<location_x>0</location_x>
<location_y>402</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -261,21 +265,64 @@
<skin>Radio environment (UDGM)</skin>
<skin>Addresses: IP or Rime</skin>
</plugin_config>
<width>364</width>
<z>0</z>
<height>200</height>
<location_x>265</location_x>
<location_y>0</location_y>
<width>267</width>
<z>2</z>
<height>177</height>
<location_x>-1</location_x>
<location_y>570</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>631</width>
<z>4</z>
<height>452</height>
<width>265</width>
<z>0</z>
<height>203</height>
<location_x>0</location_x>
<location_y>199</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(120000);
var nr_packets = new Array();
for (i=1; i &lt;= 10; i++) {
nr_packets[i] = 0;
}
while (true) {
/* Listen for receive notifications */
if (msg.contains('abc message received')) {
/* Log receiving node */
nr_packets[id] ++;
log.log("Node " + id + " received message: " + nr_packets[id] + "\n");
log.log("TEST STATUS: ");
for (i = 1; i &lt;= 10; i++) {
log.log(nr_packets[i] + " ");
}
log.log("\n");
}
/* Did all nodes (1-10) receive at least one message? */
for (i = 1; i &lt;= 10; i++) {
if (nr_packets[i] &lt; 1) break;
if (i == 10) log.testOK();
}
YIELD();
}</script>
<active>true</active>
</plugin_config>
<width>596</width>
<z>1</z>
<height>744</height>
<location_x>267</location_x>
<location_y>3</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,31 +0,0 @@
TIMEOUT(120000);
var nr_packets = new Array();
for (i=1; i <= 10; i++) {
nr_packets[i] = 0;
}
while (true) {
/* Listen for receive notifications */
if (msg.contains('abc message received')) {
/* Log receiving node */
nr_packets[id] ++;
log.log("Node " + id + " received message: " + nr_packets[id] + "\n");
log.log("TEST STATUS: ");
for (i = 1; i <= 10; i++) {
log.log(nr_packets[i] + " ");
}
log.log("\n");
}
/* Did all nodes (1-10) receive at least one message? */
for (i = 1; i <= 10; i++) {
if (nr_packets[i] < 1) break;
if (i == 10) log.testOK();
}
YIELD();
}

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>1</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -15,7 +18,7 @@
</radiomedium>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype1</identifier>
<identifier>mtype511</identifier>
<description>Contiki Mote Type #1</description>
<contikiapp>../../../examples/telnet-server/telnet-server.c</contikiapp>
<commands>make telnet-server.cooja TARGET=cooja DEFINES=WITH_UIP=1</commands>
@ -39,7 +42,7 @@
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype511</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>44.40540999693696</x>
@ -59,7 +62,7 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>4</z>
<z>1</z>
<height>200</height>
<location_x>2</location_x>
<location_y>2</location_y>
@ -73,39 +76,81 @@
<skin>Radio environment (UDGM)</skin>
<skin>LEDs</skin>
</plugin_config>
<width>300</width>
<width>247</width>
<z>3</z>
<height>110</height>
<location_x>723</location_x>
<location_y>0</location_y>
<location_x>3</location_x>
<location_y>203</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(30000);
/* conf */
nrReplies = 0;
ipAddress = "172.16.0.1";
osName = java.lang.System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win")) {
pingCmd = "ping -n 10 " + ipAddress;
} else {
pingCmd = "ping -c 10 " + ipAddress;
}
replyMsg = "from " + ipAddress;
/* mote startup */
WAIT_UNTIL(msg.contains('Telnet server'));
/* override simulation delay, test times out is too fast otherwise */
mote.getSimulation().setDelayTime(1);
/* start ping process */
var runnableObj = new Object();
runnableObj.run = function() {
pingProcess = new java.lang.Runtime.getRuntime().exec(pingCmd);
log.log("cmd&gt; " + pingCmd + "\n");
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
while ((line = stdIn.readLine()) != null) {
log.log("&gt; " + line + "\n");
if (line.contains(replyMsg)) {
nrReplies++;
//log.log("reply #" + nrReplies + "\n");
}
}
pingProcess.destroy();
if (nrReplies &gt; 5) {
log.testOK(); /* Report test success and quit */
} else {
log.log("Only " + nrReplies + "/10 ping replies was received\n");
log.testFailed();
}
}
var thread = new java.lang.Thread(new java.lang.Runnable(runnableObj));
thread.start();</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>700</height>
<location_x>251</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.NativeIPGateway
<mote_arg>0</mote_arg>
<plugin_config>
<network_interface>\Device\NPF_{53CBA059-40AA-4822-BB53-7A5B9AFE77D6}</network_interface>
<network_interface>\Device\NPF_{6AE59250-8082-40D4-B2F4-89EC57DD3321}</network_interface>
<register_routes>true</register_routes>
</plugin_config>
<width>388</width>
<z>2</z>
<height>331</height>
<location_x>635</location_x>
<location_y>109</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.MoteInterfaceViewer
<mote_arg>0</mote_arg>
<plugin_config>
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>388</width>
<z>1</z>
<height>234</height>
<location_x>635</location_x>
<location_y>420</location_y>
<location_x>0</location_x>
<location_y>313</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,44 +0,0 @@
TIMEOUT(30000);
/* conf */
nrReplies = 0;
ipAddress = "172.16.0.1";
osName = java.lang.System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win")) {
pingCmd = "ping -n 10 " + ipAddress;
} else {
pingCmd = "ping -c 10 " + ipAddress;
}
replyMsg = "from " + ipAddress;
/* mote startup */
WAIT_UNTIL(msg.contains('Telnet server'));
/* override simulation delay, test times out is too fast otherwise */
mote.getSimulation().setDelayTime(1);
/* start ping process */
var runnableObj = new Object();
runnableObj.run = function() {
pingProcess = new java.lang.Runtime.getRuntime().exec(pingCmd);
log.log("cmd> " + pingCmd + "\n");
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
while ((line = stdIn.readLine()) != null) {
log.log("> " + line + "\n");
if (line.contains(replyMsg)) {
nrReplies++;
//log.log("reply #" + nrReplies + "\n");
}
}
pingProcess.destroy();
if (nrReplies > 5) {
log.testOK(); /* Report test success and quit */
} else {
log.log("Only " + nrReplies + "/10 ping replies was received\n");
log.testFailed();
}
}
var thread = new java.lang.Thread(new java.lang.Runnable(runnableObj));
thread.start();

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<delaytime>1</delaytime>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -34,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>86.60672552430381</x>
@ -64,9 +68,9 @@
</plugin_config>
<width>388</width>
<z>2</z>
<height>331</height>
<location_x>627</location_x>
<location_y>107</location_y>
<height>332</height>
<location_x>2</location_x>
<location_y>401</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -78,9 +82,9 @@
</plugin_config>
<width>385</width>
<z>1</z>
<height>234</height>
<location_x>629</location_x>
<location_y>420</location_y>
<height>239</height>
<location_x>2</location_x>
<location_y>201</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -90,11 +94,75 @@
<skin>Addresses: IP or Rime</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>300</width>
<width>140</width>
<z>3</z>
<height>107</height>
<location_x>714</location_x>
<location_y>1</location_y>
<height>201</height>
<location_x>249</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(30000);
/* conf */
nrReplies = 0;
ipAddress = "172.16.1.0";
osName = java.lang.System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win")) {
pingOnceCmd = "ping -n 1 " + ipAddress;
pingCmd = "ping -n 10 " + ipAddress;
} else {
pingOnceCmd = "ping -c 1 " + ipAddress;
pingCmd = "ping -c 10 " + ipAddress;
}
replyMsg = "from " + ipAddress;
/* wait for mote startup */
WAIT_UNTIL(msg.contains('Sky telnet process'));
/* make gateway */
pingOnceProcess = new java.lang.Runtime.getRuntime().exec(pingOnceCmd);
GENERATE_MSG(5000, "continue");
WAIT_UNTIL(msg.equals("continue"));
log.log("cont\n");
/* override simulation delay, test will time out is too fast otherwise */
mote.getSimulation().setDelayTime(1);
/* start ping process */
var runnableObj = new Object();
runnableObj.run = function() {
pingProcess = new java.lang.Runtime.getRuntime().exec(pingCmd);
log.log("cmd&gt; " + pingCmd + "\n");
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
while ((line = stdIn.readLine()) != null) {
log.log("&gt; " + line + "\n");
if (line.contains(replyMsg)) {
nrReplies++;
//log.log("reply #" + nrReplies + "\n");
}
}
pingProcess.destroy();
if (nrReplies &gt; 5) {
log.testOK(); /* Report test success and quit */
} else {
log.log("Only " + nrReplies + "/10 ping replies was received\n");
log.testFailed();
}
}
var thread = new java.lang.Thread(new java.lang.Runnable(runnableObj));
thread.start();</script>
<active>true</active>
</plugin_config>
<width>603</width>
<z>0</z>
<height>732</height>
<location_x>389</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,52 +0,0 @@
TIMEOUT(30000);
/* conf */
nrReplies = 0;
ipAddress = "172.16.1.0";
osName = java.lang.System.getProperty("os.name").toLowerCase();
if (osName.startsWith("win")) {
pingOnceCmd = "ping -n 1 " + ipAddress;
pingCmd = "ping -n 10 " + ipAddress;
} else {
pingOnceCmd = "ping -c 1 " + ipAddress;
pingCmd = "ping -c 10 " + ipAddress;
}
replyMsg = "from " + ipAddress;
/* wait for mote startup */
WAIT_UNTIL(msg.contains('Sky telnet process'));
/* make gateway */
pingOnceProcess = new java.lang.Runtime.getRuntime().exec(pingOnceCmd);
GENERATE_MSG(5000, "continue");
WAIT_UNTIL(msg.equals("continue"));
log.log("cont\n");
/* override simulation delay, test will time out is too fast otherwise */
mote.getSimulation().setDelayTime(1);
/* start ping process */
var runnableObj = new Object();
runnableObj.run = function() {
pingProcess = new java.lang.Runtime.getRuntime().exec(pingCmd);
log.log("cmd> " + pingCmd + "\n");
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
while ((line = stdIn.readLine()) != null) {
log.log("> " + line + "\n");
if (line.contains(replyMsg)) {
nrReplies++;
//log.log("reply #" + nrReplies + "\n");
}
}
pingProcess.destroy();
if (nrReplies > 5) {
log.testOK(); /* Report test success and quit */
} else {
log.log("Only " + nrReplies + "/10 ping replies was received\n");
log.testFailed();
}
}
var thread = new java.lang.Thread(new java.lang.Runnable(runnableObj));
thread.start();

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-shell-webserver.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell-webserver/sky-shell-webserver.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>16.08449565170202</x>
@ -51,10 +52,11 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>38.40617555763694</x>
<y>38.97825356716085</y>
<x>42.81612608990057</x>
<y>41.95359330906976</y>
<z>0.0</z>
</interface_config>
<interface_config>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>70.00470747576063</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>99.0932428018975</x>
@ -94,19 +98,24 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>2</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>435</width>
<z>0</z>
<height>195</height>
<location_x>255</location_x>
<location_y>6</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Addresses: IP or Rime</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>305</width>
<z>2</z>
<height>201</height>
<location_x>248</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -114,12 +123,13 @@
<mote_arg>3</mote_arg>
<plugin_config>
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>684</width>
<z>3</z>
<height>324</height>
<location_x>10</location_x>
<location_y>547</location_y>
<width>551</width>
<z>4</z>
<height>258</height>
<location_x>2</location_x>
<location_y>471</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -127,12 +137,83 @@
<mote_arg>0</mote_arg>
<plugin_config>
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>682</width>
<width>553</width>
<z>1</z>
<height>334</height>
<location_x>10</location_x>
<location_y>207</location_y>
<height>272</height>
<location_x>1</location_x>
<location_y>200</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(90000, log.log("last message: " + msg + "\n"));
mote1 = null;
mote4 = null;
nr_boot = 0;
/* Wait until all nodes have booted */
while (true) {
if (msg.contains('Starting')) {
nr_boot++;
if (id == 1) mote1 = mote;
if (id == 4) mote4 = mote;
}
if (nr_boot == 4) break;
YIELD();
}
log.log("All motes booted\n");
/* Wait one second */
GENERATE_MSG(1000, "continue");
WAIT_UNTIL(msg.equals("continue"));
/* Create file on node 1 */
log.log("Node 1 creating data... ");
write(mote1, "echo FROM1 FROM1 | write node1file.txt\n");
log.log("done!\n");
/* Wait one second */
GENERATE_MSG(1000, "continue2");
WAIT_UNTIL(msg.equals("continue2"));
/* Download node1file.txt to node 4 */
log.log("Node 4 downloading from node 1... ");
write(mote4, "wget 172.16.1.0/node1file.txt | write node4file.txt\n");
WAIT_UNTIL(id == 4 &amp;&amp; msg.contains("FROM1"));
log.log("done!\n");
/* Wait one second */
GENERATE_MSG(1000, "continue3");
WAIT_UNTIL(msg.equals("continue3"));
/* Extend data */
log.log("Node 4 appending data... ");
write(mote4, "echo FROM4 FROM4 | append node4file.txt\n");
log.log("done!\n");
/* Wait one second */
GENERATE_MSG(1000, "continue4");
WAIT_UNTIL(msg.equals("continue4"));
/* Download node4file.txt at node 1 */
log.log("Node 1 downloading from node 4..");
write(mote1, "wget 172.16.4.0/node4file.txt\n");
WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("FROM1"));
WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("FROM4"));
log.log("done!\n");
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>610</width>
<z>0</z>
<height>730</height>
<location_x>552</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,46 +0,0 @@
TIMEOUT(90000, log.log("last message: " + msg + "\n"));
mote1 = null;
mote4 = null;
nr_boot = 0;
/* Wait until all nodes have booted */
while (true) {
if (msg.contains('Starting')) {
nr_boot++;
if (id == 1) mote1 = mote;
if (id == 4) mote4 = mote;
}
if (nr_boot == 4) break;
YIELD();
}
log.log("All motes booted\n");
/* Wait one second */
GENERATE_MSG(1000, "continue");
WAIT_UNTIL(msg.equals("continue"));
/* Create file on node 1 */
log.log("Node 1 creating data\n");
write(mote1, "echo FROM1 | write node1file.txt\n");
/* Download node1file.txt to node 4 */
log.log("Node 4 downloading from node 1\n");
write(mote4, "wget 172.16.1.0/node1file.txt | write node4file.txt\n");
WAIT_UNTIL(id == 4 && msg.contains("FROM1"));
/* Wait one second */
GENERATE_MSG(1000, "continue");
WAIT_UNTIL(msg.equals("continue"));
/* Extend data */
log.log("Node 4 appending data\n");
write(mote4, "echo FROM4 | append node4file.txt\n");
/* Download node2file.txt at node 1 */
log.log("Node 1 downloading from node 4\n");
write(mote1, "wget 172.16.4.0/node4file.txt\n");
WAIT_UNTIL(id == 1 && msg.contains("FROM4"));
log.testOK();

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make multi-threading.sky TARGET=sky</commands>
<firmware>../../../examples/multi-threading/multi-threading.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>83.20518861404864</x>
@ -52,32 +53,81 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>265</width>
<z>1</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>0</z>
<height>300</height>
<location_x>638</location_x>
<location_y>0</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config />
<width>263</width>
<z>2</z>
<height>292</height>
<location_x>1</location_x>
<location_y>202</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>938</width>
<z>2</z>
<width>865</width>
<z>0</z>
<height>209</height>
<location_x>1</location_x>
<location_y>746</location_y>
<location_x>3</location_x>
<location_y>701</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(60000, log.log("nrLowAlpha: " + nrLowAlpha + "\nnrHighAlpha: " + nrHighAlpha + "\nnrLowCount: " + nrLowCount + "\nnrHighCount: " + nrHighCount + "\n"));
lowAlpha = "BA";
highAlpha = "JIHGFEDCBA";
lowCount = "10";
highCount = "9876543210";
nrLowAlpha = 0;
nrHighAlpha = 0;
nrLowCount = 0;
nrHighCount = 0;
while (true) {
if (msg.equals(lowCount)) {
//log.log("Count is low\n");
nrLowCount++;
} else if (msg.equals(lowAlpha)) {
//log.log("Alpha is low\n");
nrLowAlpha++;
} else if (msg.equals(highCount)) {
//log.log("Count is high\n");
nrHighCount++;
} else if (msg.equals(highAlpha)) {
//log.log("Alpha is high\n");
nrHighAlpha++;
}
if (nrLowCount &gt;= 5 &amp;&amp;
nrLowAlpha &gt;= 5 &amp;&amp;
nrLowCount &gt;= 5 &amp;&amp;
nrHighCount &gt;= 5 &amp;&amp;
nrHighAlpha &gt;= 5) {
log.testOK();
}
YIELD();
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>1</z>
<height>700</height>
<location_x>267</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,38 +0,0 @@
TIMEOUT(60000, log.log("nrLowAlpha: " + nrLowAlpha + "\nnrHighAlpha: " + nrHighAlpha + "\nnrLowCount: " + nrLowCount + "\nnrHighCount: " + nrHighCount + "\n"));
lowAlpha = "BA";
highAlpha = "JIHGFEDCBA";
lowCount = "10";
highCount = "9876543210";
nrLowAlpha = 0;
nrHighAlpha = 0;
nrLowCount = 0;
nrHighCount = 0;
while (true) {
if (msg.equals(lowCount)) {
//log.log("Count is low\n");
nrLowCount++;
} else if (msg.equals(lowAlpha)) {
//log.log("Alpha is low\n");
nrLowAlpha++;
} else if (msg.equals(highCount)) {
//log.log("Count is high\n");
nrHighCount++;
} else if (msg.equals(highAlpha)) {
//log.log("Alpha is high\n");
nrHighAlpha++;
}
if (nrLowCount >= 5 &&
nrLowAlpha >= 5 &&
nrLowCount >= 5 &&
nrHighCount >= 5 &&
nrHighAlpha >= 5) {
log.testOK();
}
YIELD();
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>5000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>5000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make example-abc.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-abc.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>33.53152221759984</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>54.67966631314053</x>
@ -66,32 +68,67 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>313</width>
<z>2</z>
<z>3</z>
<height>199</height>
<location_x>30</location_x>
<location_y>30</location_y>
<location_x>-1</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>300</width>
<z>1</z>
<height>122</height>
<location_x>367</location_x>
<location_y>23</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>312</width>
<z>2</z>
<height>123</height>
<location_x>0</location_x>
<location_y>198</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>573</width>
<width>311</width>
<z>0</z>
<height>242</height>
<location_x>23</location_x>
<location_y>235</location_y>
<height>377</height>
<location_x>1</location_x>
<location_y>320</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(100000, log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n"));
nr_packets = new Array();
nr_packets[1] = 0;
nr_packets[2] = 0;
while (true) {
/* Only handle receive messages */
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
/* Count received packets */
nr_packets[id]++;
//log.log("Node " + id + " received " + nr_packets[id] + " messages\n");
if (nr_packets[1] &gt;= 10 &amp;&amp; nr_packets[2] &gt;= 10) {
log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n");
log.testOK(); /* Report test success */
}
}</script>
<active>true</active>
</plugin_config>
<width>601</width>
<z>1</z>
<height>697</height>
<location_x>312</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,22 +0,0 @@
TIMEOUT(100000, log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n"));
nr_packets = new Array();
nr_packets[1] = 0;
nr_packets[2] = 0;
while (true) {
/* Only handle receive messages */
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
/* Count received packets */
nr_packets[id]++;
//log.log("Node " + id + " received " + nr_packets[id] + " messages\n");
if (nr_packets[1] >= 30 && nr_packets[2] >= 30) {
log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n");
log.testOK(); /* Report test success */
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>Rime collect test</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -18,7 +18,7 @@
</radiomedium>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype1</identifier>
<identifier>mtype528</identifier>
<description>Contiki Mote Type #1</description>
<contikiapp>../../../examples/rime/example-collect.c</contikiapp>
<commands>make example-collect.cooja TARGET=cooja</commands>
@ -34,7 +34,6 @@
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLog</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<symbols>false</symbols>
@ -42,7 +41,7 @@
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>50.829139451170256</x>
@ -57,14 +56,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.9.16</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>66.70779372167401</x>
@ -79,14 +74,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.10.16</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>41.129223698257974</x>
@ -101,14 +92,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.16.4</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>3.896453344832884</x>
@ -123,14 +110,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>4</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.17.2</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>66.34456950462831</x>
@ -145,14 +128,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>5</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.8.8</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>70.88189625059834</x>
@ -167,14 +146,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.16.12</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>19.09803704982651</x>
@ -189,14 +164,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>7</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.8.4</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>89.63745297998314</x>
@ -211,14 +182,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.3.6</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>13.348832186584092</x>
@ -233,14 +200,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>9</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.15.15</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.674784139064478</x>
@ -255,14 +218,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>10</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.4.19</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>47.87142051729898</x>
@ -277,14 +236,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>11</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.5.7</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>26.88271893793631</x>
@ -299,14 +254,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>12</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.17.17</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>56.02971812708909</x>
@ -321,14 +272,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>13</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.13.11</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>95.69470045280002</x>
@ -343,14 +290,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>14</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.14.17</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>31.731698652367335</x>
@ -365,14 +308,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>15</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.16.19</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>2.8792353689463424</x>
@ -387,14 +326,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>16</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.2.4</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>51.07177717821779</x>
@ -409,14 +344,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>17</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.8.9</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>43.42318694224158</x>
@ -431,14 +362,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>18</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.16.4</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>87.22205782780289</x>
@ -453,14 +380,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>19</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.6.15</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype528</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.6332448872152683</x>
@ -475,27 +398,28 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>20</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.18.5</ipv4address>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>223</width>
<z>1</z>
<z>3</z>
<height>227</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Addresses: IP or Rime</skin>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>200</width>
<z>0</z>
<height>300</height>
<location_x>723</location_x>
<height>225</height>
<location_x>222</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
@ -503,13 +427,155 @@
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1023</width>
<width>420</width>
<z>2</z>
<height>207</height>
<height>489</height>
<location_x>0</location_x>
<location_y>461</location_y>
<location_y>225</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
nodes_starting = true;
for(i = 1; i &lt;= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i &lt;= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while(true) {
YIELD();
/* Count sensor data packets */
if(msg.startsWith("Sink")) {
node_text = msg.split(" ")[4];
seqno_text = msg.split(" ")[6];
hops_text = msg.split(" ")[8];
if(node_text) {
source = parseInt(node_text);
seqno = parseInt(seqno_text);
hop = parseInt(hops_text);
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i &lt;= nrNodes; i++) {
if(count[i] &gt; 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from every node */
for(i = 1; i &lt;= nrNodes; i++) {
if(count[i] &lt; 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
print_stats();
}
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>1</z>
<height>714</height>
<location_x>420</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,131 +0,0 @@
TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i <= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i <= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i <= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i <= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i <= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
nodes_starting = true;
for(i = 1; i <= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i <= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while(true) {
YIELD();
/* Count sensor data packets */
if(msg.startsWith("Sink")) {
node_text = msg.split(" ")[4];
seqno_text = msg.split(" ")[6];
hops_text = msg.split(" ")[8];
if(node_text) {
source = parseInt(node_text);
seqno = parseInt(seqno_text);
hop = parseInt(hops_text);
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i <= nrNodes; i++) {
if(count[i] > 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from every node */
for(i = 1; i <= nrNodes; i++) {
if(count[i] < 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
print_stats();
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make example-collect.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-collect.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>87.29845932913939</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>94.30809966340686</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>82.40423567500785</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>26.185019854469438</x>
@ -93,6 +97,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.9530156130507015</x>
@ -107,6 +112,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>48.35216700543414</x>
@ -121,6 +127,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>24.825985087266833</x>
@ -135,6 +142,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>8.356165164293616</x>
@ -149,6 +157,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>45.11740613004886</x>
@ -163,6 +172,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>68.9908548386292</x>
@ -177,6 +187,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>13.181122543889046</x>
@ -191,6 +202,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>2.1749985906538427</x>
@ -205,6 +217,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>37.79795217518357</x>
@ -219,6 +232,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>64.4595177394984</x>
@ -233,6 +247,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>81.85663737096085</x>
@ -247,6 +262,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>44.74952276297882</x>
@ -261,6 +277,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>96.11333426285873</x>
@ -275,6 +292,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>21.651464136783527</x>
@ -289,6 +307,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>83.6006916200628</x>
@ -303,6 +322,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.3446070721664705</x>
@ -317,33 +337,179 @@
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>223</width>
<z>1</z>
<width>247</width>
<z>3</z>
<height>227</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>0</z>
<height>300</height>
<location_x>390</location_x>
<location_y>0</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>224</width>
<z>1</z>
<height>225</height>
<location_x>247</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>690</width>
<width>469</width>
<z>2</z>
<height>207</height>
<height>473</height>
<location_x>0</location_x>
<location_y>439</location_y>
<location_y>226</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
nodes_starting = true;
for(i = 1; i &lt;= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i &lt;= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while(true) {
YIELD();
/* Count sensor data packets */
if(msg.startsWith("Sink")) {
node_text = msg.split(" ")[4];
seqno_text = msg.split(" ")[6];
hops_text = msg.split(" ")[8];
if(node_text) {
source = parseInt(node_text);
seqno = parseInt(seqno_text);
hop = parseInt(hops_text);
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i &lt;= nrNodes; i++) {
if(count[i] &gt; 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from every node */
for(i = 1; i &lt;= nrNodes; i++) {
if(count[i] &lt; 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
print_stats();
}
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>700</height>
<location_x>469</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,131 +0,0 @@
TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i <= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i <= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i <= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i <= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i <= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
nodes_starting = true;
for(i = 1; i <= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i <= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while(true) {
YIELD();
/* Count sensor data packets */
if(msg.startsWith("Sink")) {
node_text = msg.split(" ")[4];
seqno_text = msg.split(" ")[6];
hops_text = msg.split(" ")[8];
if(node_text) {
source = parseInt(node_text);
seqno = parseInt(seqno_text);
hop = parseInt(hops_text);
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i <= nrNodes; i++) {
if(count[i] > 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from every node */
for(i = 1; i <= nrNodes; i++) {
if(count[i] < 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
print_stats();
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>25.0</transmitting_range>
@ -18,7 +18,7 @@
</radiomedium>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype1</identifier>
<identifier>mtype296</identifier>
<description>Contiki Mote #1</description>
<contikiapp>../../../examples/rime/example-rucb.c</contikiapp>
<commands>make example-rucb.cooja TARGET=cooja</commands>
@ -34,7 +34,6 @@
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLog</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<symbols>false</symbols>
@ -42,7 +41,7 @@
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype296</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
@ -57,14 +56,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>51</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.17.20</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype296</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>14.102564102564104</x>
@ -79,14 +74,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>52</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.1.11</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype296</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-32.16814655285737</x>
@ -101,14 +92,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>53</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.18.13</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype296</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-1.5917258339289355</x>
@ -123,14 +110,10 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>54</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.5.21</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype1</motetype_identifier>
<motetype_identifier>mtype296</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>26.334899854939632</x>
@ -145,10 +128,6 @@
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>55</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.11.6</ipv4address>
</interface_config>
</mote>
</simulation>
<plugin>
@ -164,40 +143,41 @@
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>692</width>
<width>798</width>
<z>2</z>
<height>209</height>
<height>289</height>
<location_x>0</location_x>
<location_y>434</location_y>
<location_y>354</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>216</width>
<z>4</z>
<height>197</height>
<location_x>477</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisTraffic
<width>208</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>265</width>
<z>0</z>
<height>203</height>
<location_x>266</location_x>
<location_y>-2</location_y>
<height>155</height>
<location_x>0</location_x>
<location_y>200</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>687</width>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(120000);
WAIT_UNTIL(msg.startsWith('Completion time'));
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>534</width>
<z>1</z>
<height>233</height>
<location_x>3</location_x>
<location_y>201</location_y>
<height>354</height>
<location_x>264</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,4 +0,0 @@
TIMEOUT(120000);
WAIT_UNTIL(msg.startsWith('Completion time'));
log.testOK();

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>10000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>10000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make example-runicast.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-runicast.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>3.0783332685337617</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.1986251808192212</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>34.432838059195255</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>150.85510197745134</x>
@ -94,7 +98,7 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>265</width>
<z>3</z>
<z>4</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
@ -104,19 +108,22 @@
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter>received</filter>
<history>256</history>
</plugin_config>
<width>692</width>
<z>2</z>
<height>209</height>
<width>539</width>
<z>0</z>
<height>319</height>
<location_x>0</location_x>
<location_y>434</location_y>
<location_y>325</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>263</width>
<z>1</z>
<z>2</z>
<height>125</height>
<location_x>1</location_x>
<location_y>200</location_y>
@ -124,20 +131,76 @@
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>427</width>
<z>4</z>
<height>432</height>
<width>276</width>
<z>1</z>
<height>324</height>
<location_x>264</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisTraffic
<width>263</width>
<z>0</z>
<height>110</height>
<location_x>1</location_x>
<location_y>324</location_y>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(240000);
nr_recv = 0;
nr_timedout = 0;
nr_sent = 0;
while (nr_sent &lt; 10) {
/* Count received packets */
if (msg.contains('received') &amp;&amp; !msg.contains('DUPLICATE')) {
nr_recv++;
log.log("RECV=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
}
/* Count timed out packets */
else if (msg.contains('timed out')) {
nr_timedout++;
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", TIMEDOUT=" + nr_timedout + "\n");
}
/* Count sent packets */
else if (msg.contains('sent to')) {
nr_sent++;
log.log("recv=" + nr_recv + ", SENT=" + nr_sent + ", timedout=" + nr_timedout + "\n");
}
YIELD();
}
/* Make sure received counter matches sent counter */
if (nr_recv &lt; nr_sent-3) {
log.log("Error: Received &lt;&lt; Sent!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
else if (nr_recv &gt; nr_sent+3) {
log.log("Error: Received &gt;&gt; Sent!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
/* Make sure some packets timed out (all from node 4) */
else if (nr_timedout &lt; 2) {
log.log("Error: Too few packets timed out!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
else {
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testOK();
}</script>
<active>true</active>
</plugin_config>
<width>503</width>
<z>3</z>
<height>643</height>
<location_x>539</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,53 +0,0 @@
TIMEOUT(240000);
nr_recv = 0;
nr_timedout = 0;
nr_sent = 0;
while (nr_sent < 10) {
/* Count received packets */
if (msg.contains('received') && !msg.contains('DUPLICATE')) {
nr_recv++;
log.log("RECV=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
}
/* Count timed out packets */
else if (msg.contains('timed out')) {
nr_timedout++;
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", TIMEDOUT=" + nr_timedout + "\n");
}
/* Count sent packets */
else if (msg.contains('sent to')) {
nr_sent++;
log.log("recv=" + nr_recv + ", SENT=" + nr_sent + ", timedout=" + nr_timedout + "\n");
}
YIELD();
}
/* Make sure received counter matches sent counter */
if (nr_recv < nr_sent-3) {
log.log("Error: Received << Sent!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
else if (nr_recv > nr_sent+3) {
log.log("Error: Received >> Sent!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
/* Make sure some packets timed out (all from node 4) */
else if (nr_timedout < 2) {
log.log("Error: Too few packets timed out!\n");
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testFailed();
}
else {
log.log("recv=" + nr_recv + ", sent=" + nr_sent + ", timedout=" + nr_timedout + "\n");
log.testOK();
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>41.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make example-trickle.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-trickle.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>21.25615651441164</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>29.258648178869528</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>53.58390840870132</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>4.089137066756255</x>
@ -93,6 +97,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>84.2311285004563</x>
@ -107,6 +112,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>40.97868508483131</x>
@ -121,6 +127,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>34.348646576361716</x>
@ -135,6 +142,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>76.46661251540715</x>
@ -149,6 +157,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>87.91615665417679</x>
@ -163,6 +172,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>25.396991214895582</x>
@ -176,34 +186,74 @@
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>300</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>310</width>
<z>2</z>
<height>300</height>
<location_x>14</location_x>
<location_y>206</location_y>
<height>169</height>
<location_x>2</location_x>
<location_y>199</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.SimControl
<width>313</width>
<z>0</z>
<z>3</z>
<height>199</height>
<location_x>14</location_x>
<location_y>5</location_y>
<location_x>1</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>573</width>
<width>310</width>
<z>1</z>
<height>349</height>
<location_x>339</location_x>
<location_y>8</location_y>
<height>331</height>
<location_x>3</location_x>
<location_y>368</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(120000, log.log(nr_packets[1] + ", " + nr_packets[2] + ", " + nr_packets[3] + ", " + nr_packets[4] + ", " + nr_packets[5] + ", " + nr_packets[6] + ", " + nr_packets[7] + ", " + nr_packets[8] + ", " + nr_packets[9] + ", " + nr_packets[10] + "\n"));
nr_packets = new Array();
for (i=1; i &lt;= 10; i++) {
nr_packets[i] = 0;
}
WAIT_UNTIL(id == 1 &amp;&amp; msg.contains('Starting'));
log.log("Node 1 started. Clicking node button.\n");
mote.getInterfaces().getButton().clickButton()
while (true) {
/* Only handle receive messages */
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
/* Remember receiving node */
log.log(id + " received a message\n");
nr_packets[id]++;
/* Did all nodes (2-10) receive a message? */
for (i = 2; i &lt;= 10; i++) {
if (nr_packets[i] &lt; 1) break;
if (i == 10) log.testOK(); /* Report test success */
}
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>700</height>
<location_x>314</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,25 +0,0 @@
TIMEOUT(120000, log.log(nr_packets[1] + ", " + nr_packets[2] + ", " + nr_packets[3] + ", " + nr_packets[4] + ", " + nr_packets[5] + ", " + nr_packets[6] + ", " + nr_packets[7] + ", " + nr_packets[8] + ", " + nr_packets[9] + ", " + nr_packets[10] + "\n"));
nr_packets = new Array();
for (i=1; i <= 10; i++) {
nr_packets[i] = 0;
}
WAIT_UNTIL(id == 1 && msg.contains('Starting'));
log.log("Node 1 started. Clicking node button.\n");
mote.getInterfaces().getButton().clickButton()
while (true) {
/* Only handle receive messages */
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
/* Remember receiving node */
log.log(id + " received a message\n");
nr_packets[id]++;
/* Did all nodes (2-10) receive a message? */
for (i = 2; i <= 10; i++) {
if (nr_packets[i] < 1) break;
if (i == 10) log.testOK(); /* Report test success */
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-checkpoint.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-checkpoint.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>3.537694077190867</x>
@ -59,38 +60,135 @@
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>246</width>
<z>2</z>
<height>300</height>
<location_x>724</location_x>
<location_y>0</location_y>
<height>210</height>
<location_x>2</location_x>
<location_y>199</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1024</width>
<z>0</z>
<height>209</height>
<width>849</width>
<z>1</z>
<height>246</height>
<location_x>0</location_x>
<location_y>446</location_y>
<location_y>409</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.MoteInterfaceViewer
<mote_arg>0</mote_arg>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<interface>Serial port</interface>
<script>TIMEOUT(120000, log.log("timeout at phase " + phase + ". last message: " + msg + "\n"));
phase=0;
/* Wait until node has booted */
WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Shell started\n");
phase++;
/* 1. BACKGROUND PROCESS - NO CHECKPOINTING */
write(mote, "repeat 10 1 echo bg process &amp;\n");
log.log("Starting background process without checkpointing\n");
expected=10;
while (expected &gt; 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process without checkpointing done\n\n");
phase++;
/* 2. BACKGROUND PROCESS - CHECKPOINTING EVERY SECOND */
write(mote, "repeat 10 1 echo bg process &amp;\n");
log.log("Starting background process with periodic checkpointing\n");
expected=10;
while (expected &gt; 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
write(mote, "checkpoint file" + expected + "\n");
log.log("&gt; checkpoint file" + expected + "\n");
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process with periodic checkpointing done\n\n");
phase++;
/* 3. LIST ALL FILES */
write(mote, "ls");
YIELD_THEN_WAIT_UNTIL(msg.contains('file9'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file8'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file7'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file6'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file5'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file4'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file3'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file2'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file1'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file0'));
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.contains('continue'));
log.log("All checkpoints are stored in the filesystem\n\n");
phase++;
/* 4. ROLLBACK TO RESTORE BACKGROUND PROCESS */
write(mote, "rollback file7");
log.log("Rolling back background process at count 7\n");
expected=7;
while (expected &gt; 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process was rolled back successfully\n\n");
phase++;
log.testOK(); /* We are done! */</script>
<active>true</active>
</plugin_config>
<width>424</width>
<z>1</z>
<height>502</height>
<location_x>579</location_x>
<location_y>27</location_y>
<width>604</width>
<z>0</z>
<height>409</height>
<location_x>246</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,94 +0,0 @@
TIMEOUT(120000, log.log("timeout at phase " + phase + ". last message: " + msg + "\n"));
phase=0;
/* Wait until node has booted */
WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Shell started\n");
phase++;
/* 1. BACKGROUND PROCESS - NO CHECKPOINTING */
node.write("repeat 10 1 echo bg process &");
log.log("Starting background process without checkpointing\n");
expected=10;
while (expected > 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process without checkpointing done\n\n");
phase++;
/* 2. BACKGROUND PROCESS - CHECKPOINTING EVERY SECOND */
node.write("repeat 10 1 echo bg process &");
log.log("Starting background process with periodic checkpointing\n");
expected=10;
while (expected > 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
node.write("checkpoint file" + expected);
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process with periodic checkpointing done\n\n");
phase++;
/* 3. LIST ALL FILES */
node.write("ls");
YIELD_THEN_WAIT_UNTIL(msg.contains('file9'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file8'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file7'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file6'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file5'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file4'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file3'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file2'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file1'));
YIELD_THEN_WAIT_UNTIL(msg.contains('file0'));
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.contains('continue'));
log.log("All checkpoints are stored in the filesystem\n\n");
phase++;
/* 4. ROLLBACK TO RESTORE BACKGROUND PROCESS */
node.write("rollback file7");
log.log("Rollingt back background process at count 7\n");
expected=7;
while (expected > 0) {
YIELD_THEN_WAIT_UNTIL(msg.contains('bg process'));
expected--;
}
/* Make sure background process has exited */
GENERATE_MSG(3000, "continue");
while (!msg.contains('continue')) {
YIELD();
if (msg.contains('bg process')) {
log.log("Too many bg messages at phase: " + phase + "\n");
log.testFailed(); /* We are done! */
while (true) YIELD();
}
}
log.log("Background process was rolled back successfully\n\n");
phase++;
log.testOK(); /* We are done! */

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>test</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>0</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>0</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make test-coffee.sky TARGET=sky</commands>
<firmware>../../../examples/sky/test-coffee.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>97.11078411573273</x>
@ -52,32 +53,78 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>2</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>1</z>
<height>300</height>
<location_x>1239</location_x>
<location_y>0</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Log output: printf()'s</skin>
</plugin_config>
<width>246</width>
<z>2</z>
<height>170</height>
<location_x>1</location_x>
<location_y>200</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1539</width>
<z>0</z>
<width>846</width>
<z>1</z>
<height>209</height>
<location_x>0</location_x>
<location_y>945</location_y>
<location_x>2</location_x>
<location_y>370</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(60000);
fileOK = null;
gcOK = null;
while (fileOK == null || gcOK == null) {
YIELD();
if (msg.startsWith('Coffee file test: 0')) {
fileOK = true;
} else if (msg.startsWith('Coffee file test')) {
fileOK = false;
} else if (msg.startsWith('Coffee garbage collection test: 0')) {
gcOK = true;
} else if (msg.startsWith('Coffee garbage collection test')) {
gcOK = false;
}
}
if (gcOK == false) {
log.log("coffee garbage collection failed\n");
}
if (fileOK == false) {
log.log("coffee file test failed\n");
}
if (!fileOK || !gcOK) {
log.testFailed();
} else {
log.testOK();
}</script>
<active>true</active>
</plugin_config>
<width>601</width>
<z>0</z>
<height>370</height>
<location_x>247</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,31 +0,0 @@
TIMEOUT(60000);
fileOK = null;
gcOK = null;
while (fileOK == null || gcOK == null) {
YIELD();
if (msg.startsWith('Coffee file test: 0')) {
fileOK = true;
} else if (msg.startsWith('Coffee file test')) {
fileOK = false;
} else if (msg.startsWith('Coffee garbage collection test: 0')) {
gcOK = true;
} else if (msg.startsWith('Coffee garbage collection test')) {
gcOK = false;
}
}
if (gcOK == false) {
log.log("coffee garbage collection failed\n");
}
if (fileOK == false) {
log.log("coffee file test failed\n");
}
if (!fileOK || !gcOK) {
log.testFailed();
} else {
log.testOK();
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>10000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>10000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>30.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-collect.sky TARGET=sky</commands>
<firmware>../../../examples/sky/sky-collect.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>9.333811152651393</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>33.040227185226826</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>-2.2559922410521516</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>12.959353575718179</x>
@ -93,6 +97,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>15.917348901177405</x>
@ -107,6 +112,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>26.735174243053933</x>
@ -121,6 +127,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>41.5254792748469</x>
@ -136,41 +143,108 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>265</width>
<z>2</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
se.sics.cooja.plugins.Visualizer
<plugin_config>
<filter />
<history>256</history>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>1168</width>
<z>0</z>
<height>240</height>
<location_x>-1</location_x>
<location_y>618</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>300</width>
<width>264</width>
<z>1</z>
<height>300</height>
<location_x>31</location_x>
<location_y>287</location_y>
<height>185</height>
<location_x>0</location_x>
<location_y>200</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>424</width>
<z>3</z>
<height>595</height>
<location_x>988</location_x>
<location_y>13</location_y>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(300000, log.log("received/node: " + count[1] + " " + count[2] + " " + count[3] + " " + count[4] + " " + count[5] + " " + count[6] + " " + count[7] + "\n"));
/* Conf. */
booted = new Array();
count = new Array();
nrNodes = 7;
nodes_starting = true;
for (i = 1; i &lt;= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
}
/* Wait until all nodes have started */
while (nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for (i = 1; i &lt;= nrNodes; i++) {
if (!booted[i]) break;
if (i == nrNodes) nodes_starting = false;
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while (true) {
YIELD();
/* Count sensor data packets */
source = msg.split(" ")[0];
count[source]++;
log.log("Got data from node " + source + ": tot=" + count[source] + "\n");
/* Fail if any node has transmitted more than 20 packets */
for (i = 1; i &lt;= nrNodes; i++) {
if (count[i] &gt; 20) {
log.log("received/node: " + count[1] + " " + count[2] + " " + count[3] + " " + count[4] + " " + count[5] + " " + count[6] + " " + count[7] + "\n");
log.testFailed(); /* We are done! */
}
}
/* Wait until we have received data from all nodes */
for (i = 1; i &lt;= nrNodes; i++) {
if (count[i] &lt; 5) break;
if (i == nrNodes) log.testOK();
}
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>2</z>
<height>385</height>
<location_x>266</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.TimeLine
<plugin_config>
<mote>0</mote>
<mote>1</mote>
<mote>2</mote>
<mote>3</mote>
<mote>4</mote>
<mote>5</mote>
<mote>6</mote>
<showRadioRXTX />
<split>109</split>
<zoom>9</zoom>
</plugin_config>
<width>866</width>
<z>0</z>
<height>152</height>
<location_x>0</location_x>
<location_y>384</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,52 +0,0 @@
TIMEOUT(300000, log.log("received/node: " + count[1] + " " + count[2] + " " + count[3] + " " + count[4] + " " + count[5] + " " + count[6] + " " + count[7] + "\n"));
/* Conf. */
booted = new Array();
count = new Array();
nrNodes = 7;
nodes_starting = true;
for (i = 1; i <= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
}
/* Wait until all nodes have started */
while (nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for (i = 1; i <= nrNodes; i++) {
if (!booted[i]) break;
if (i == nrNodes) nodes_starting = false;
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
mote.getInterfaces().getButton().clickButton()
while (true) {
YIELD();
/* Count sensor data packets */
source = msg.split(" ")[0];
count[source]++;
log.log("Got data from node " + source + ": tot=" + count[source] + "\n");
/* Fail if any node has transmitted more than 20 packets */
for (i = 1; i <= nrNodes; i++) {
if (count[i] > 20) {
log.log("received/node: " + count[1] + " " + count[2] + " " + count[3] + " " + count[4] + " " + count[5] + " " + count[6] + " " + count[7] + "\n");
log.testFailed(); /* We are done! */
}
}
/* Wait until we have received data from all nodes */
for (i = 1; i <= nrNodes; i++) {
if (count[i] < 5) break;
if (i == nrNodes) log.testOK();
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>Deluge</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make APPS=deluge test-deluge.sky TARGET=sky</commands>
<firmware>../../../examples/sky/test-deluge.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>22.464792491653174</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>16.167564578306468</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>63.42409596590043</x>
@ -80,32 +83,73 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>282</width>
<z>2</z>
<height>187</height>
<z>4</z>
<height>212</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>0</z>
<height>300</height>
<location_x>390</location_x>
<location_y>0</location_y>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>283</width>
<z>2</z>
<height>144</height>
<location_x>-1</location_x>
<location_y>212</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(id == 3 &amp;&amp; msg.contains("version 1"));
log.log("Node 3 got version 1\n");
WAIT_UNTIL(id == 5 &amp;&amp; msg.contains("version 1"));
log.log("Node 5 got version 1\n");
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>1</z>
<height>357</height>
<location_x>281</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.TimeLine
<plugin_config>
<mote>0</mote>
<mote>1</mote>
<mote>2</mote>
<showRadioRXTX />
<split>109</split>
<zoom>9</zoom>
</plugin_config>
<width>882</width>
<z>3</z>
<height>149</height>
<location_x>-1</location_x>
<location_y>357</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter>version</filter>
<history>256</history>
<filter />
</plugin_config>
<width>690</width>
<z>1</z>
<height>328</height>
<location_x>0</location_x>
<location_y>319</location_y>
<width>882</width>
<z>0</z>
<height>195</height>
<location_x>-1</location_x>
<location_y>504</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,9 +0,0 @@
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(id == 3 && msg.contains("version 1"));
log.log("Node 3 got version 1\n");
WAIT_UNTIL(id == 5 && msg.contains("version 1"));
log.log("Node 5 got version 1\n");
log.testOK(); /* Report test success and quit */

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>Hello World (Sky)</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>0</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make hello-world.sky TARGET=sky</commands>
<firmware>../../../examples/hello-world/hello-world.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>64.11203103628397</x>
@ -52,32 +53,26 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>2</z>
<z>1</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>1</z>
<height>300</height>
<location_x>1239</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<filter />
<history>256</history>
<script>TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>1539</width>
<width>541</width>
<z>0</z>
<height>209</height>
<location_x>0</location_x>
<location_y>945</location_y>
<height>448</height>
<location_x>248</location_x>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,4 +0,0 @@
TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK();

View file

@ -1,178 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<simulation>
<title>IPv6 UDP multi-hop</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>100.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<motetype>
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #server</description>
<source>../../../examples/udp-ipv6/udp-server.c</source>
<commands>make udp-server.sky TARGET=sky DEFINES=WITH_NULLMAC,WITH_UIP6</commands>
<firmware>../../../examples/udp-ipv6/udp-server.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype>
<motetype>
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky2</identifier>
<description>Sky Mote Type #client</description>
<source>../../../examples/udp-ipv6/udp-client.c</source>
<commands>make udp-client.sky TARGET=sky DEFINES=WITH_NULLMAC,WITH_UIP6</commands>
<firmware>../../../examples/udp-ipv6/udp-client.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>4.429858922161034</x>
<y>67.09174884241352</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip>fe80.0000.0000.0000.0212.7401.0001.0101</ip>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky2</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>11.713143611799719</x>
<y>95.89136566345172</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip>fe80.0000.0000.0000.0212.7402.0002.0202</ip>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>24.363059125382698</x>
<y>41.714385769558</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip>fe80.0000.0000.0000.0212.7403.0003.0303</ip>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>3</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>96.42924447549179</x>
<y>57.78187718095034</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip>fe80.0000.0000.0000.0212.7404.0004.0404</ip>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>4</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>58.387304457658814</x>
<y>39.38419308594967</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip>fe80.0000.0000.0000.0212.7405.0005.0505</ip>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>5</id>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>282</width>
<z>1</z>
<height>187</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>300</width>
<z>3</z>
<height>300</height>
<location_x>503</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1021</width>
<z>2</z>
<height>190</height>
<location_x>-7</location_x>
<location_y>276</location_y>
<minimized>false</minimized>
</plugin>
</simconf>
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>IPv6 UDP multi-hop</title>
<delaytime>0</delaytime>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>100.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<motetype>
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #server</description>
<source>../../../examples/udp-ipv6/udp-server.c</source>
<commands>make udp-server.sky TARGET=sky DEFINES=WITH_NULLMAC,WITH_UIP6</commands>
<firmware>../../../examples/udp-ipv6/udp-server.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype>
<motetype>
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky2</identifier>
<description>Sky Mote Type #client</description>
<source>../../../examples/udp-ipv6/udp-client.c</source>
<commands>make udp-client.sky TARGET=sky DEFINES=WITH_NULLMAC,WITH_UIP6</commands>
<firmware>../../../examples/udp-ipv6/udp-client.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>4.429858922161034</x>
<y>67.09174884241352</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky2</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>11.713143611799719</x>
<y>95.89136566345172</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>24.363059125382698</x>
<y>41.714385769558</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>3</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>96.42924447549179</x>
<y>57.78187718095034</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>4</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>58.387304457658814</x>
<y>39.38419308594967</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>5</id>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>282</width>
<z>4</z>
<height>204</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Radio environment (UDGM)</skin>
<skin>Mote IDs</skin>
<skin>Addresses: IP or Rime</skin>
</plugin_config>
<width>800</width>
<z>2</z>
<height>183</height>
<location_x>221</location_x>
<location_y>426</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
</plugin_config>
<width>1019</width>
<z>3</z>
<height>190</height>
<location_x>3</location_x>
<location_y>610</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>/* Make test automatically fail (timeout) after 100 simulated seconds */
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
log.log("waiting for server response at mote 2\n");
WAIT_UNTIL(id == 2 &amp;&amp; msg.startsWith("Response from the server"));
log.log("ok, reporting success now\n");
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>738</width>
<z>0</z>
<height>425</height>
<location_x>282</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>500</width>
<z>1</z>
<height>406</height>
<location_x>2</location_x>
<location_y>204</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,8 +0,0 @@
/* Make test automatically fail (timeout) after 100 simulated seconds */
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
log.log("waiting for server response at mote 2\n");
WAIT_UNTIL(id == 2 && msg.startsWith("Response from the server"));
log.log("ok, reporting success now\n");
log.testOK(); /* Report test success and quit */

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123457</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make example-udp-sender.sky TARGET=sky DEFINES=WITH_UIP6,WITH_NULLMAC,UDP_ADDR_A=0xfe80,UDP_ADDR_B=0,UDP_ADDR_C=0,UDP_ADDR_D=0,UDP_ADDR_E=0x0212,UDP_ADDR_F=0x7402,UDP_ADDR_G=0x02,UDP_ADDR_H=0x202</commands>
<firmware>../../../examples/udp-sender-ipv6/example-udp-sender.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -42,7 +42,7 @@
<commands>make example-udp-receiver.sky TARGET=sky DEFINES=WITH_UIP6,WITH_NULLMAC,UDP_ADDR_A=0xfe80,UDP_ADDR_B=0,UDP_ADDR_C=0,UDP_ADDR_D=0,UDP_ADDR_E=0x0212,UDP_ADDR_F=0x7401,UDP_ADDR_G=0x01,UDP_ADDR_H=0x101</commands>
<firmware>../../../examples/udp-receiver-ipv6/example-udp-receiver.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -55,6 +55,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>65.934608127183</x>
@ -69,6 +70,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky2</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>67.66105781539623</x>
@ -84,7 +86,7 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>2</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
@ -94,31 +96,59 @@
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1067</width>
<width>816</width>
<z>1</z>
<height>300</height>
<location_x>0</location_x>
<location_y>523</location_y>
<height>333</height>
<location_x>1</location_x>
<location_y>365</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>1062</width>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Addresses: IP or Rime</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>246</width>
<z>0</z>
<height>309</height>
<location_x>6</location_x>
<location_y>207</location_y>
<height>167</height>
<location_x>0</location_x>
<location_y>198</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisUDGM
<width>300</width>
<z>3</z>
<height>108</height>
<location_x>766</location_x>
<location_y>11</location_y>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(msg.contains("Created connection"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Created connection"));
log.log("Both nodes booted\n");
count = 0;
while (count++ &lt; 5) {
/* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver received"));
log.log(count + ": Sender -&gt; Receiver OK\n");
/* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender received"));
log.log(count + ": Receiver -&gt; Sender OK\n");
}
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>572</width>
<z>2</z>
<height>700</height>
<location_x>246</location_x>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,21 +0,0 @@
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
WAIT_UNTIL(msg.contains("Created connection"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Created connection"));
log.log("Both nodes booted\n");
count = 0;
while (count++ < 5) {
/* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver received"));
log.log(count + ": Sender -> Receiver OK\n");
/* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Receiver sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Sender received"));
log.log(count + ": Receiver -> Sender OK\n");
}
log.testOK(); /* Report test success and quit */

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-shell.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-shell.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>62.86427076032819</x>
@ -52,33 +53,54 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>302</width>
<z>1</z>
<height>187</height>
<z>2</z>
<height>205</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>0</z>
<height>300</height>
<location_x>390</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>690</width>
<z>2</z>
<z>1</z>
<height>190</height>
<location_x>0</location_x>
<location_y>457</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(3000, log.log("last message: " + msg + "\n"));
/* Wait until node has booted */
WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Shell started\n");
/* Test command: ps */
log.log("&gt; ps\n");
write(mote, "ps");
WAIT_UNTIL(msg.startsWith('Event timer'));
WAIT_UNTIL(msg.contains('Contiki&gt;'));
/* Test command: help */
log.log("&gt; help\n");
write(mote, "help");
WAIT_UNTIL(msg.startsWith('write &lt;filename&gt;'));
WAIT_UNTIL(msg.contains('Contiki&gt;'));
log.testOK(); /* We are done! */</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>648</height>
<location_x>303</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,15 +0,0 @@
TIMEOUT(2000, log.log("last message: " + msg + "\n"));
/* Wait until node has booted */
WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Shell started\n");
/* Test command: ps */
node.write("ps");
WAIT_UNTIL(msg.startsWith('Event timer'));
/* Test command: help */
node.write("help");
WAIT_UNTIL(msg.startsWith('write <filename>'));
log.testOK(); /* We are done! */

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-shell.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-shell.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>87.29845932913939</x>
@ -51,6 +52,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>94.30809966340686</x>
@ -65,6 +67,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>82.40423567500785</x>
@ -79,6 +82,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>26.185019854469438</x>
@ -93,6 +97,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.9530156130507015</x>
@ -107,6 +112,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>48.35216700543414</x>
@ -121,6 +127,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>24.825985087266833</x>
@ -135,6 +142,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>8.356165164293616</x>
@ -149,6 +157,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>45.11740613004886</x>
@ -163,6 +172,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>68.9908548386292</x>
@ -177,6 +187,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>13.181122543889046</x>
@ -191,6 +202,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>2.1749985906538427</x>
@ -205,6 +217,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>37.79795217518357</x>
@ -219,6 +232,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>64.4595177394984</x>
@ -233,6 +247,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>81.85663737096085</x>
@ -247,6 +262,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>44.74952276297882</x>
@ -261,6 +277,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>96.11333426285873</x>
@ -275,6 +292,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>21.651464136783527</x>
@ -289,6 +307,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>83.6006916200628</x>
@ -303,6 +322,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.3446070721664705</x>
@ -316,25 +336,232 @@
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>223</width>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
</plugin_config>
<width>690</width>
<z>1</z>
<height>227</height>
<height>207</height>
<location_x>0</location_x>
<location_y>493</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i &lt;= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
log.log("Stats: cpu " + 100 * total_cpu / (total_cpu + total_lpm) +
"% lpm " + 100 * total_lpm / (total_cpu + total_lpm) +
"% rx " + 100 * total_listen / (total_cpu + total_lpm) +
"% tx " + 100 * total_transmit / (total_cpu + total_lpm) +
"% average latency " + total_latency / (4096 * total_received) +
" ms \n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
total_cpu = total_lpm = total_listen = total_transmit = 0;
total_latency = 0;
nodes_starting = true;
for(i = 1; i &lt;= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i &lt;= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
sink = id;
/* Wait for prompt */
YIELD_THEN_WAIT_UNTIL(id == sink);
/*mote.getInterfaces().getButton().clickButton()*/
log.log("Writing netcmd\n");
node.write("netcmd { repeat 0 20 { randwait 20 sky-alldata | blink | send } }");
YIELD_THEN_WAIT_UNTIL(id == sink);
log.log("Writing collect command\n");
node.write("collect | timestamp | blink | binprint &amp;");
while(true) {
YIELD();
/* Count sensor data packets */
data = msg.split(" ");
if(data[24]) {
len = parseInt(data[0]);
timestamp1 = parseInt(data[1]);
timestamp2 = parseInt(data[2]);
timesynched_timestamp = parseInt(data[3]);
node_id = parseInt(data[4]);
seqno = parseInt(data[5]);
hop = parseInt(data[6]);
latency = parseInt(data[7]);
data_len2 = parseInt(data[8]);
clock = parseInt(data[9]);
timesyncedtime = parseInt(data[10]);
light1 = parseInt(data[11]);
light2 = parseInt(data[12]);
temperature = parseInt(data[13]);
humidity = parseInt(data[14]);
rssi = parseInt(data[15]);
time_cpu = parseInt(data[16]);
time_lpm = parseInt(data[17]);
time_transmit = parseInt(data[18]);
time_listen = parseInt(data[19]);
best_neighbor = parseInt(data[20]);
best_neighbor_etx = parseInt(data[21]);
best_neighbor_rtmetrix = parseInt(data[22]);
battery_voltage = parseInt(data[23]);
battery_indicator = parseInt(data[24]);
total_cpu += time_cpu;
total_lpm += time_lpm;
total_transmit += time_transmit;
total_listen += time_listen;
total_latency += latency;
source = node_id;
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i &lt;= nrNodes; i++) {
if(i != sink &amp;&amp; count[i] &gt; 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from
every node, except the sink, which doesn't send packets. */
for(i = 1; i &lt;= nrNodes; i++) {
if(i != sink) {
if(count[i] &lt; 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
}
}</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>2</z>
<height>700</height>
<location_x>259</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>690</width>
<z>0</z>
<height>207</height>
se.sics.cooja.plugins.SimControl
<width>259</width>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>439</location_y>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>Mote IDs</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>260</width>
<z>0</z>
<height>296</height>
<location_x>0</location_x>
<location_y>197</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,183 +0,0 @@
TIMEOUT(300000, log.log("Timeout\n"));
function
print_stats()
{
log.log("Received " + total_received + " messages, " +
(total_received / nrNodes) + " messages/node, " +
total_lost + " lost, " +
(total_lost / nrNodes) + " lost/node, " +
total_dups + " dups, " +
(total_dups / nrNodes) + " dups/node, " +
(total_hops / total_received) + " hops/message\n");
log.log("Seqnos: ");
for(i = 1; i <= nrNodes; i++) {
log.log(seqnos[i] + " ");
}
log.log("\n");
log.log("Lost: ");
for(i = 1; i <= nrNodes; i++) {
log.log(lost[i] + " ");
}
log.log("\n");
log.log("Dups: ");
for(i = 1; i <= nrNodes; i++) {
log.log(dups[i] + " ");
}
log.log("\n");
log.log("Hops: ");
for(i = 1; i <= nrNodes; i++) {
log.log(hops[i] + " ");
}
log.log("\n");
log.log("Received: ");
for(i = 1; i <= nrNodes; i++) {
log.log(count[i] + " ");
}
log.log("\n");
log.log("Stats: cpu " + 100 * total_cpu / (total_cpu + total_lpm) +
"% lpm " + 100 * total_lpm / (total_cpu + total_lpm) +
"% rx " + 100 * total_listen / (total_cpu + total_lpm) +
"% tx " + 100 * total_transmit / (total_cpu + total_lpm) +
"% average latency " + total_latency / (4096 * total_received) +
" ms \n");
}
/* Conf. */
booted = new Array();
count = new Array();
hops = new Array();
seqnos = new Array();
lost = new Array();
dups = new Array();
nrNodes = 20;
total_received = 0;
total_lost = 0;
total_hops = 0;
total_dups = 0;
total_cpu = total_lpm = total_listen = total_transmit = 0;
total_latency = 0;
nodes_starting = true;
for(i = 1; i <= nrNodes; i++) {
booted[i] = false;
count[i] = 0;
hops[i] = 0;
seqnos[i] = -1;
lost[i] = 0;
dups[i] = 0;
}
/* Wait until all nodes have started */
while(nodes_starting) {
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Node " + id + " booted\n");
booted[id] = true;
for(i = 1; i <= nrNodes; i++) {
if(!booted[i]) {
break;
}
if(i == nrNodes) {
nodes_starting = false;
}
}
}
/* Create sink */
log.log("All nodes booted, creating sink at node " + id + "\n");
sink = id;
/* Wait for prompt */
YIELD_THEN_WAIT_UNTIL(id == sink);
/*mote.getInterfaces().getButton().clickButton()*/
log.log("Writing netcmd\n");
node.write("netcmd { repeat 0 20 { randwait 20 sky-alldata | blink | send } }");
YIELD_THEN_WAIT_UNTIL(id == sink);
log.log("Writing collect command\n");
node.write("collect | timestamp | blink | binprint &");
while(true) {
YIELD();
/* Count sensor data packets */
data = msg.split(" ");
if(data[24]) {
len = parseInt(data[0]);
timestamp1 = parseInt(data[1]);
timestamp2 = parseInt(data[2]);
timesynched_timestamp = parseInt(data[3]);
node_id = parseInt(data[4]);
seqno = parseInt(data[5]);
hop = parseInt(data[6]);
latency = parseInt(data[7]);
data_len2 = parseInt(data[8]);
clock = parseInt(data[9]);
timesyncedtime = parseInt(data[10]);
light1 = parseInt(data[11]);
light2 = parseInt(data[12]);
temperature = parseInt(data[13]);
humidity = parseInt(data[14]);
rssi = parseInt(data[15]);
time_cpu = parseInt(data[16]);
time_lpm = parseInt(data[17]);
time_transmit = parseInt(data[18]);
time_listen = parseInt(data[19]);
best_neighbor = parseInt(data[20]);
best_neighbor_etx = parseInt(data[21]);
best_neighbor_rtmetrix = parseInt(data[22]);
battery_voltage = parseInt(data[23]);
battery_indicator = parseInt(data[24]);
total_cpu += time_cpu;
total_lpm += time_lpm;
total_transmit += time_transmit;
total_listen += time_listen;
total_latency += latency;
source = node_id;
count[source]++;
hops[source] = hop;
seqno_gap = seqno - seqnos[source];
seqnos[source] = seqno;
total_received++;
total_hops += hop;
if(seqno_gap == 2) {
total_lost += seqno_gap - 1;
lost[source] += seqno_gap - 1;
} else if(seqno_gap == 0) {
total_dups += 1;
dups[source] += 1;
}
}
/* Fail if the sink has received more than 10 messages from any node. */
for(i = 1; i <= nrNodes; i++) {
if(i != sink && count[i] > 10) {
print_stats();
log.testFailed(); /* We are done! */
}
}
/* Wait until the sink have received at least two messages from
every node, except the sink, which doesn't send packets. */
for(i = 1; i <= nrNodes; i++) {
if(i != sink) {
if(count[i] < 2) {
break;
}
if(i == nrNodes) {
print_stats();
log.testOK();
}
}
}
}

View file

@ -2,13 +2,13 @@
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -24,7 +24,7 @@
<commands>make sky-shell.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-shell.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -37,6 +37,7 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>62.86427076032819</x>
@ -52,18 +53,9 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>302</width>
<z>1</z>
<height>187</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.VisState
<width>300</width>
<z>0</z>
<height>300</height>
<location_x>390</location_x>
<height>204</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
@ -71,7 +63,6 @@
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>690</width>
<z>2</z>
@ -80,5 +71,21 @@
<location_y>457</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.startsWith('Contiki'));
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>1</z>
<height>458</height>
<location_x>300</location_x>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,4 +0,0 @@
TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.startsWith('Contiki'));
log.testOK();

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>generated</randomseed>
<motedelay>1000</motedelay>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>100.0</transmitting_range>
@ -21,7 +24,7 @@
<commands>make sky-checkpoint.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-checkpoint.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -34,16 +37,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>-16.136777727943556</x>
<y>85.85963282955879</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id>
@ -52,16 +52,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>11.712359274594053</x>
<y>84.42239042889724</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id>
@ -70,11 +67,11 @@
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<width>268</width>
<z>4</z>
<height>200</height>
<location_x>375</location_x>
<location_y>0</location_y>
<height>201</height>
<location_x>0</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -84,11 +81,11 @@
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>372</width>
<z>5</z>
<height>482</height>
<location_x>0</location_x>
<location_y>173</location_y>
<width>359</width>
<z>3</z>
<height>485</height>
<location_x>2</location_x>
<location_y>201</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -98,11 +95,11 @@
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>399</width>
<z>3</z>
<height>483</height>
<location_x>625</location_x>
<location_y>172</location_y>
<width>384</width>
<z>2</z>
<height>488</height>
<location_x>390</location_x>
<location_y>199</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
@ -111,19 +108,96 @@
<skin>Radio environment (UDGM)</skin>
<skin>Mote IDs</skin>
</plugin_config>
<width>400</width>
<width>126</width>
<z>1</z>
<height>171</height>
<location_x>624</location_x>
<location_y>0</location_y>
<height>198</height>
<location_x>649</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.RadioLogger
<width>376</width>
<z>2</z>
<height>172</height>
<location_x>-1</location_x>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(150000); /* print last msg at timeout */
/* Wait for nodes to boot */
mote1 = null;
mote2 = null;
while (mote1 == null || mote2 == null) {
if (id == 1) {
mote1 = mote;
}
if (id == 2) {
mote2 = mote;
}
YIELD();
}
GENERATE_MSG(2000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Generate initial file */
fileID = 1;
command = "echo *mote1data" + fileID + " | write file" + fileID + ".txt\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
/* Download and append files */
while (fileID &lt; 20) {
/* Mote 1 -&gt; Mote 2 */
srcFile = "file" + fileID + ".txt";
fileID++;
dstFile = "file" + fileID + ".txt";
command = "download 1.0 " + srcFile + " | write " + dstFile + " | null\n";
log.log("mote2&gt; " + command);
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
command = "echo *mote2data" + fileID + " | append " + dstFile + " | null\n";
log.log("mote2&gt; " + command);
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("Contiki&gt;"));
/* Mote 2 -&gt; Mote 1 */
srcFile = "file" + fileID + ".txt";
fileID++;
dstFile = "file" + fileID + ".txt";
command = "download 2.0 " + srcFile + " | write " + dstFile + " | null\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
command = "echo *mote1data" + fileID + " | append " + dstFile + " | null\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
}
/* List files, verify contents */
/* XXX Beware of strange line breaks! (generated by shell's read command) */
log.log("Locating file21.txt on mote 1\n");
write(mote1, "ls\n");
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("file21.txt"));
if (!msg.contains("264 ")) {
log.log("Bad file size, should be 264 bytes: " + msg + "\n");
log.testFailed();
}
YIELD_THEN_WAIT_UNTIL(id == 1 &amp;&amp; msg.contains("Contiki&gt;"));
log.log("Verifying file21.txt contents on mote 1\n");
write(mote1, "read file21.txt\n");
YIELD_THEN_WAIT_UNTIL(msg.contains("mote1data1"));
YIELD_THEN_WAIT_UNTIL(msg.contains("mote2data2"));
// ..
YIELD_THEN_WAIT_UNTIL(msg.contains("mote2data16") || msg.contains("mote2data18"));
YIELD_THEN_WAIT_UNTIL(msg.contains("mote1data19") || msg.contains("mote1data21"));
log.log("Test finished at time: " + mote.getSimulation().getSimulationTime() + "\n");
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>573</width>
<z>0</z>
<height>688</height>
<location_x>80</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>

View file

@ -1,76 +0,0 @@
TIMEOUT(150000); /* print last msg at timeout */
log.log("Random seed: " + mote.getSimulation().getRandomSeed() + "\n");
/* Wait for nodes to boot */
mote1 = null;
mote2 = null;
while (mote1 == null || mote2 == null) {
if (id == 1) {
mote1 = mote;
}
if (id == 2) {
mote2 = mote;
}
YIELD();
}
GENERATE_MSG(2000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Generate initial file */
fileID = 1;
command = "echo *mote1data" + fileID + " | write file" + fileID + ".txt\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 && msg.contains("Contiki>"));
/* Download and append files */
while (fileID < 20) {
/* Mote 1 -> Mote 2 */
srcFile = "file" + fileID + ".txt";
fileID++;
dstFile = "file" + fileID + ".txt";
command = "download 1.0 " + srcFile + " | write " + dstFile + " | null\n";
log.log("mote2> " + command);
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 && msg.contains("Contiki>"));
command = "echo *mote2data" + fileID + " | append " + dstFile + " | null\n";
log.log("mote2> " + command);
write(mote2, command);
YIELD_THEN_WAIT_UNTIL(id == 2 && msg.contains("Contiki>"));
/* Mote 2 -> Mote 1 */
srcFile = "file" + fileID + ".txt";
fileID++;
dstFile = "file" + fileID + ".txt";
command = "download 2.0 " + srcFile + " | write " + dstFile + " | null\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 && msg.contains("Contiki>"));
command = "echo *mote1data" + fileID + " | append " + dstFile + " | null\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 1 && msg.contains("Contiki>"));
}
/* List files, verify contents */
/* XXX Beware of strange line breaks! (generated by shell's read command) */
log.log("Locating file21.txt on mote 1\n");
write(mote1, "ls\n");
YIELD_THEN_WAIT_UNTIL(id == 1 && msg.contains("file21.txt"));
if (!msg.contains("264 ")) {
log.log("Bad file size, should be 264 bytes: " + msg + "\n");
log.testFailed();
}
YIELD_THEN_WAIT_UNTIL(id == 1 && msg.contains("Contiki>"));
log.log("Verifying file21.txt contents on mote 1\n");
write(mote1, "read file21.txt\n");
YIELD_THEN_WAIT_UNTIL(msg.contains("mote1data1"));
YIELD_THEN_WAIT_UNTIL(msg.contains("mote2data2"));
// ..
YIELD_THEN_WAIT_UNTIL(msg.contains("mote2data16") || msg.contains("mote2data18"));
YIELD_THEN_WAIT_UNTIL(msg.contains("mote1data19") || msg.contains("mote1data21"));
log.log("Test finished at time: " + mote.getSimulation().getSimulationTime() + "\n");
log.testOK(); /* Report test success and quit */

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -18,14 +21,16 @@
<identifier>sky1</identifier>
<description>Sky Mote Type #sky1</description>
<source>../../../examples/sky-shell-exec/sky-shell-exec.c</source>
<commands>make hello-world.ce TARGET=sky
<commands>echo COMPILING CONTIKI EXECUTABLE
make hello-world.ce TARGET=sky
echo COMPILING FIRMWARE WITH CORE
make sky-shell-exec.sky TARGET=sky
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell-exec/sky-shell-exec.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -38,6 +43,7 @@ make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky</commands>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>56.18151486126417</x>
@ -53,37 +59,12 @@ make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky</commands>
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>5</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>printf()'s + LEDs</skin>
</plugin_config>
<width>300</width>
<z>4</z>
<height>300</height>
<location_x>1020</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1347</width>
<z>1</z>
<height>675</height>
<location_x>0</location_x>
<location_y>337</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.MoteInterfaceViewer
<mote_arg>0</mote_arg>
@ -91,21 +72,96 @@ make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky</commands>
<interface>Serial port</interface>
<scrollpos>0,0</scrollpos>
</plugin_config>
<width>845</width>
<z>2</z>
<width>545</width>
<z>1</z>
<height>551</height>
<location_x>11</location_x>
<location_y>249</location_y>
<location_x>3</location_x>
<location_y>347</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.mspmote.plugins.MspStackWatcher
<mote_arg>0</mote_arg>
<width>613</width>
<z>3</z>
<height>300</height>
<width>566</width>
<z>2</z>
<height>201</height>
<location_x>247</location_x>
<location_y>12</location_y>
<location_y>-1</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(50000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
helloworld = new java.io.File("../../../examples/sky-shell-exec/hello-world.ce");
log.log("Running test on: " + helloworld.getAbsolutePath() + "\n");
if (!helloworld.exists()) {
log.log("hello-world.ce does not exist\n");
log.testFailed();
}
log.log("Waiting for node startup\n");
WAIT_UNTIL(msg.contains('1.0: Contiki&gt;'));
log.log("Preparing node for incoming data\n");
write(mote, "write hello-world.b64");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Uploading hello-world.b64:\n");
cmdarr = "sh -c xxx".split(" ");
cmdarr[2] = "../../tools/base64-encode &lt; hello-world.ce";
process = new java.lang.Runtime.getRuntime().exec(cmdarr, null, helloworld.getParentFile());
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()));
while ((line = stdIn.readLine()) != null) {
write(mote, line + "\n");
YIELD();
if (msg.startsWith(line)) {
log.log("UPLOADED: " + line + "\n");
} else {
log.log("Serial port upload failed:\n" + line + "\n" + msg + "\n");
log.testFailed();
}
}
process.destroy();
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
write(mote, "~K\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Converting base64 to binary hello-world.ce\n");
write(mote, "read hello-world.b64 | dec64 | write hello-world.ce | null");
GENERATE_MSG(3000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Listing filesystem to make sure hello-world.ce exists\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
write(mote, "ls\n");
WAIT_UNTIL(msg.contains("hello-world.ce"));
log.log("Starting hello world\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
write(mote, "exec hello-world.ce\n");
WAIT_UNTIL(msg.contains("OK"));
log.log("&gt; ELF loader returned OK\n");
WAIT_UNTIL(msg.contains("Hello, world"));
log.log("&gt; Hello world process started\n");
log.log("Finished!\n");
log.testOK();</script>
<active>true</active>
</plugin_config>
<width>600</width>
<z>0</z>
<height>700</height>
<location_x>215</location_x>
<location_y>199</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,63 +0,0 @@
TIMEOUT(50000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
helloworld = new java.io.File("../../../examples/sky-shell-exec/hello-world.ce");
log.log("Running test on: " + helloworld.getAbsolutePath() + "\n");
if (!helloworld.exists()) {
log.log("hello-world.ce does not exist\n");
log.testFailed();
}
log.log("Waiting for node startup\n");
WAIT_UNTIL(msg.contains('1.0: Contiki>'));
log.log("Preparing node for incoming data\n");
node.write("write hello-world.b64");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Uploading hello-world.b64:\n");
cmdarr = "sh -c xxx".split(" ");
cmdarr[2] = "../../tools/base64-encode < hello-world.ce";
process = new java.lang.Runtime.getRuntime().exec(cmdarr, null, helloworld.getParentFile());
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()));
while ((line = stdIn.readLine()) != null) {
node.write(line + "\n");
YIELD();
if (msg.startsWith(line)) {
log.log("UPLOADED: " + line + "\n");
} else {
log.log("Serial port upload failed:\n" + line + "\n" + msg + "\n");
log.testFailed();
}
}
process.destroy();
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
node.write("~K\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Converting base64 to binary hello-world.ce\n");
node.write("read hello-world.b64 | dec64 | write hello-world.ce | null");
GENERATE_MSG(3000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Listing filesystem to make sure hello-world.ce exists\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
node.write("ls\n");
WAIT_UNTIL(msg.contains("hello-world.ce"));
log.log("Starting hello world\n");
GENERATE_MSG(500, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
node.write("exec hello-world.ce\n");
WAIT_UNTIL(msg.contains("OK"));
log.log("> ELF loader returned OK\n");
WAIT_UNTIL(msg.contains("Hello, world"));
log.log("> Hello world process started\n");
log.log("Finished!\n");
log.testOK();

View file

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>1000</motedelay>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
@ -21,7 +24,7 @@
<commands>make sky-checkpoint.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-checkpoint.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspIPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
@ -34,16 +37,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>85.95630230780736</x>
<y>-3.1198604890271326</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id>
@ -52,16 +52,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>49.907666469432186</x>
<y>13.102030707681678</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id>
@ -70,16 +67,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>63.205651488651284</x>
<y>29.26179327208891</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>3</id>
@ -88,16 +82,13 @@
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
<x>30.60420340759257</x>
<y>44.54754287360952</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspIPAddress
<ip />
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>4</id>
@ -107,7 +98,7 @@
<plugin>
se.sics.cooja.plugins.SimControl
<width>248</width>
<z>2</z>
<z>3</z>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
@ -120,18 +111,17 @@
<skin>Log output: printf()'s</skin>
<skin>Radio environment (UDGM)</skin>
</plugin_config>
<width>300</width>
<z>3</z>
<height>300</height>
<location_x>724</location_x>
<location_y>0</location_y>
<width>246</width>
<z>2</z>
<height>243</height>
<location_x>1</location_x>
<location_y>202</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<history>256</history>
</plugin_config>
<width>1024</width>
<z>1</z>
@ -140,5 +130,59 @@
<location_y>446</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>TIMEOUT(150000);
/* Wait for nodes to boot */
mote1 = null;
while (mote1 == null) {
if (id == 1) {
mote1 = mote;
}
YIELD();
}
GENERATE_MSG(2000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -&gt; mote 2*/
command = "sendcmd 2.0 echo hello\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("hello"));
log.log("mote2: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -&gt; mote 2*/
command = "sendcmd 2.0 {echo hello again}\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 2 &amp;&amp; msg.contains("hello again"));
log.log("mote2: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -&gt; mote 2 -&gt; mote 3 -&gt; mote 4 */
command = "sendcmd 2.0 {sendcmd 3.0 {sendcmd 4.0 echo multihop}}\n";
log.log("mote1&gt; " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 4 &amp;&amp; msg.contains("multihop"));
log.log("mote4: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Test finished at time: " + mote.getSimulation().getSimulationTime() + "\n");
log.testOK(); /* Report test success and quit */</script>
<active>true</active>
</plugin_config>
<width>775</width>
<z>0</z>
<height>656</height>
<location_x>246</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -1,44 +0,0 @@
TIMEOUT(150000);
log.log("Random seed: " + mote.getSimulation().getRandomSeed() + "\n");
/* Wait for nodes to boot */
mote1 = null;
while (mote1 == null) {
if (id == 1) {
mote1 = mote;
}
YIELD();
}
GENERATE_MSG(2000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -> mote 2*/
command = "sendcmd 2.0 echo hello\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 2 && msg.contains("hello"));
log.log("mote2: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -> mote 2*/
command = "sendcmd 2.0 {echo hello again}\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 2 && msg.contains("hello again"));
log.log("mote2: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Send command: mote 1 -> mote 2 -> mote 3 -> mote 4 */
command = "sendcmd 2.0 {sendcmd 3.0 {sendcmd 4.0 echo multihop}}\n";
log.log("mote1> " + command);
write(mote1, command);
YIELD_THEN_WAIT_UNTIL(id == 4 && msg.contains("multihop"));
log.log("mote4: " + msg + "\n");
GENERATE_MSG(1000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("Test finished at time: " + mote.getSimulation().getSimulationTime() + "\n");
log.testOK(); /* Report test success and quit */