2015-10-22 15:18:31 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<simconf>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/mrm</project>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/avrora</project>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
|
|
|
|
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
|
|
|
<randomseed>generated</randomseed>
|
2016-04-21 13:24:16 +02:00
|
|
|
<motedelay_us>10000000</motedelay_us>
|
2015-10-22 15:18:31 +02:00
|
|
|
<radiomedium>
|
|
|
|
org.contikios.cooja.radiomediums.UDGM
|
2016-04-21 13:24:16 +02:00
|
|
|
<transmitting_range>30.0</transmitting_range>
|
|
|
|
<interference_range>40.0</interference_range>
|
|
|
|
<success_ratio_tx>0.9</success_ratio_tx>
|
|
|
|
<success_ratio_rx>0.9</success_ratio_rx>
|
2015-10-22 15:18:31 +02:00
|
|
|
</radiomedium>
|
|
|
|
<events>
|
|
|
|
<logoutput>40000</logoutput>
|
|
|
|
</events>
|
|
|
|
<motetype>
|
|
|
|
org.contikios.cooja.mspmote.SkyMoteType
|
|
|
|
<identifier>sky1</identifier>
|
|
|
|
<description>Sky Mote Type #1</description>
|
2016-04-21 13:24:16 +02:00
|
|
|
<source EXPORT="discard">[CONTIKI_DIR]/examples/sky/sky-collect.c</source>
|
2015-10-22 15:18:31 +02:00
|
|
|
<commands EXPORT="discard">make clean TARGET=sky
|
2016-04-21 13:24:16 +02:00
|
|
|
make sky-collect.sky TARGET=sky</commands>
|
|
|
|
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/sky/sky-collect.sky</firmware>
|
2015-10-22 15:18:31 +02:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyFlash</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.Msp802154Radio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
|
|
|
</motetype>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>9.333811152651393</x>
|
|
|
|
<y>89.28114548870677</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>1</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>33.040227185226826</x>
|
|
|
|
<y>54.184283361563054</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>2</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>-2.2559922410521516</x>
|
|
|
|
<y>50.71648775308175</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>3</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>12.959353575718179</x>
|
|
|
|
<y>43.874396471224806</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>4</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>15.917348901177405</x>
|
|
|
|
<y>66.93526904376517</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>5</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>26.735174243053933</x>
|
|
|
|
<y>35.939375910459084</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>6</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<breakpoints />
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2016-04-21 13:24:16 +02:00
|
|
|
<x>41.5254792748469</x>
|
|
|
|
<y>28.370611308140152</y>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>7</id>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
|
|
|
</mote>
|
|
|
|
</simulation>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.SimControl
|
2016-04-21 13:24:16 +02:00
|
|
|
<width>265</width>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>3</z>
|
2016-04-21 13:24:16 +02:00
|
|
|
<height>200</height>
|
|
|
|
<location_x>0</location_x>
|
2015-10-22 15:18:31 +02:00
|
|
|
<location_y>0</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2016-04-21 13:24:16 +02:00
|
|
|
org.contikios.cooja.plugins.Visualizer
|
2015-10-22 15:18:31 +02:00
|
|
|
<plugin_config>
|
2016-04-21 13:24:16 +02:00
|
|
|
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
|
|
|
<viewport>1.9551775516837413 0.0 0.0 1.9551775516837413 87.61059024269439 -50.01503690267507</viewport>
|
2015-10-22 15:18:31 +02:00
|
|
|
</plugin_config>
|
2016-04-21 13:24:16 +02:00
|
|
|
<width>264</width>
|
2015-10-22 15:18:31 +02:00
|
|
|
<z>1</z>
|
2016-04-21 13:24:16 +02:00
|
|
|
<height>185</height>
|
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>200</location_y>
|
2015-10-22 15:18:31 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.ScriptRunner
|
|
|
|
<plugin_config>
|
2016-04-21 13:24:16 +02:00
|
|
|
<script>TIMEOUT(300000, log.log("received/node: " + count[1] + " " + count[2] + " " + count[3] + " " + count[4] + " " + count[5] + " " + count[6] + " " + count[7] + "\n"));
|
2015-10-22 15:18:31 +02:00
|
|
|
|
2016-04-21 13:24:16 +02:00
|
|
|
/* Conf. */
|
|
|
|
booted = new Array();
|
|
|
|
count = new Array();
|
|
|
|
nrNodes = 7;
|
|
|
|
nodes_starting = true;
|
|
|
|
for (i = 1; i <= nrNodes; i++) {
|
|
|
|
booted[i] = false;
|
|
|
|
count[i] = 0;
|
2015-10-22 15:18:31 +02:00
|
|
|
}
|
|
|
|
|
2016-04-21 13:24:16 +02:00
|
|
|
/* 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");
|
2015-10-22 15:18:31 +02:00
|
|
|
mote.getInterfaces().getButton().clickButton()
|
|
|
|
|
|
|
|
while (true) {
|
2016-04-21 13:24:16 +02:00
|
|
|
YIELD();
|
2015-10-22 15:18:31 +02:00
|
|
|
|
2016-04-21 13:24:16 +02:00
|
|
|
/* Count sensor data packets */
|
|
|
|
source = msg.split(" ")[0];
|
|
|
|
count[source]++;
|
|
|
|
log.log("Got data from node " + source + ": tot=" + count[source] + "\n");
|
2015-10-22 15:18:31 +02:00
|
|
|
|
2016-04-21 13:24:16 +02:00
|
|
|
/* 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! */
|
|
|
|
}
|
2015-10-22 15:18:31 +02:00
|
|
|
}
|
2016-04-21 13:24:16 +02:00
|
|
|
|
|
|
|
/* 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();
|
|
|
|
}
|
|
|
|
|
2015-10-22 15:18:31 +02:00
|
|
|
}</script>
|
|
|
|
<active>true</active>
|
|
|
|
</plugin_config>
|
|
|
|
<width>600</width>
|
2016-04-21 13:24:16 +02:00
|
|
|
<z>2</z>
|
|
|
|
<height>385</height>
|
|
|
|
<location_x>266</location_x>
|
2015-10-22 15:18:31 +02:00
|
|
|
<location_y>0</location_y>
|
|
|
|
</plugin>
|
2016-04-21 13:24:16 +02:00
|
|
|
<plugin>
|
|
|
|
org.contikios.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 />
|
|
|
|
<zoomfactor>500.0</zoomfactor>
|
|
|
|
</plugin_config>
|
|
|
|
<width>866</width>
|
|
|
|
<z>0</z>
|
|
|
|
<height>152</height>
|
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>384</location_y>
|
|
|
|
</plugin>
|
2015-10-22 15:18:31 +02:00
|
|
|
</simconf>
|
|
|
|
|