2015-10-22 13:18:31 +00: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]/powertracker</project>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
|
|
|
<randomseed>123456</randomseed>
|
|
|
|
<motedelay_us>1000000</motedelay_us>
|
|
|
|
<radiomedium>
|
|
|
|
org.contikios.cooja.radiomediums.UDGM
|
|
|
|
<transmitting_range>50.0</transmitting_range>
|
|
|
|
<interference_range>50.0</interference_range>
|
|
|
|
<success_ratio_tx>1.0</success_ratio_tx>
|
|
|
|
<success_ratio_rx>1.0</success_ratio_rx>
|
|
|
|
</radiomedium>
|
|
|
|
<events>
|
|
|
|
<logoutput>40000</logoutput>
|
|
|
|
</events>
|
|
|
|
<motetype>
|
|
|
|
org.contikios.cooja.contikimote.ContikiMoteType
|
2017-06-10 12:35:39 +00:00
|
|
|
<identifier>mtype190</identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
<description>Sender</description>
|
2017-06-10 12:35:39 +00:00
|
|
|
<source>[CONFIG_DIR]/code/sender-node.c</source>
|
|
|
|
<commands>make clean TARGET=cooja
|
2017-11-18 20:02:23 +00:00
|
|
|
make -j sender-node.cooja TARGET=cooja</commands>
|
2015-10-22 13:18:31 +00:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
|
|
<symbols>false</symbols>
|
|
|
|
</motetype>
|
|
|
|
<motetype>
|
|
|
|
org.contikios.cooja.contikimote.ContikiMoteType
|
2017-06-10 12:35:39 +00:00
|
|
|
<identifier>mtype481</identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
<description>RPL root</description>
|
2017-06-10 12:35:39 +00:00
|
|
|
<source>[CONFIG_DIR]/code/root-node.c</source>
|
|
|
|
<commands>make clean TARGET=cooja
|
2017-11-18 20:02:23 +00:00
|
|
|
make -j root-node.cooja TARGET=cooja</commands>
|
2015-10-22 13:18:31 +00:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
|
|
<symbols>false</symbols>
|
|
|
|
</motetype>
|
|
|
|
<motetype>
|
|
|
|
org.contikios.cooja.contikimote.ContikiMoteType
|
2017-06-10 12:35:39 +00:00
|
|
|
<identifier>mtype692</identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
<description>Receiver</description>
|
2017-06-10 12:35:39 +00:00
|
|
|
<source>[CONFIG_DIR]/code/receiver-node.c</source>
|
|
|
|
<commands>make clean TARGET=cooja
|
2017-11-18 20:02:23 +00:00
|
|
|
make -j receiver-node.cooja TARGET=cooja</commands>
|
2015-10-22 13:18:31 +00:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
|
|
<symbols>false</symbols>
|
|
|
|
</motetype>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2017-06-10 12:35:39 +00:00
|
|
|
<x>8.0</x>
|
|
|
|
<y>2.0</y>
|
2015-10-22 13:18:31 +00:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
|
|
<id>1</id>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
|
|
<bitrate>250.0</bitrate>
|
|
|
|
</interface_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<motetype_identifier>mtype481</motetype_identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2017-06-10 12:35:39 +00:00
|
|
|
<x>-7.19071602882406</x>
|
|
|
|
<y>34.96668248624779</y>
|
2015-10-22 13:18:31 +00:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
|
|
<id>2</id>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
|
|
<bitrate>250.0</bitrate>
|
|
|
|
</interface_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<motetype_identifier>mtype190</motetype_identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.interfaces.Position
|
2017-06-10 12:35:39 +00:00
|
|
|
<x>-17.870288882812428</x>
|
|
|
|
<y>4.581754854333804</y>
|
2015-10-22 13:18:31 +00:00
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
|
|
<id>3</id>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
|
|
<bitrate>250.0</bitrate>
|
|
|
|
</interface_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<motetype_identifier>mtype692</motetype_identifier>
|
2015-10-22 13:18:31 +00:00
|
|
|
</mote>
|
|
|
|
</simulation>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.SimControl
|
|
|
|
<width>280</width>
|
2017-06-10 12:35:39 +00:00
|
|
|
<z>2</z>
|
2015-10-22 13:18:31 +00:00
|
|
|
<height>160</height>
|
|
|
|
<location_x>400</location_x>
|
|
|
|
<location_y>0</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.Visualizer
|
|
|
|
<plugin_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<moterelations>true</moterelations>
|
2015-10-22 13:18:31 +00:00
|
|
|
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
|
2017-06-10 12:35:39 +00:00
|
|
|
<viewport>2.494541140753371 0.0 0.0 2.494541140753371 168.25302383129448 116.2254386098645</viewport>
|
2015-10-22 13:18:31 +00:00
|
|
|
</plugin_config>
|
|
|
|
<width>400</width>
|
2017-06-10 12:35:39 +00:00
|
|
|
<z>3</z>
|
2015-10-22 13:18:31 +00:00
|
|
|
<height>400</height>
|
|
|
|
<location_x>1</location_x>
|
|
|
|
<location_y>1</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.LogListener
|
|
|
|
<plugin_config>
|
|
|
|
<filter />
|
|
|
|
<formatted_time />
|
|
|
|
<coloring />
|
|
|
|
</plugin_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<width>597</width>
|
|
|
|
<z>0</z>
|
|
|
|
<height>428</height>
|
2015-10-22 13:18:31 +00:00
|
|
|
<location_x>402</location_x>
|
|
|
|
<location_y>162</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.Notes
|
|
|
|
<plugin_config>
|
|
|
|
<notes>Enter notes here</notes>
|
|
|
|
<decorations>true</decorations>
|
|
|
|
</plugin_config>
|
|
|
|
<width>904</width>
|
|
|
|
<z>4</z>
|
|
|
|
<height>160</height>
|
|
|
|
<location_x>680</location_x>
|
|
|
|
<location_y>0</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
org.contikios.cooja.plugins.ScriptRunner
|
|
|
|
<plugin_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<script>GENERATE_MSG(1000000, "moving root 2 hops away");
|
|
|
|
GENERATE_MSG(1500000, "moving root back");
|
2015-10-22 13:18:31 +00:00
|
|
|

|
|
|
|
lostMsgs = 0;
|
|
|
|

|
2017-06-29 14:08:06 +00:00
|
|
|
TIMEOUT(10000000, if(lastMsg != -1 && lastMsgHops == 1 && lostMsgs <= 2 && num > 20) { log.testOK(); } );
|
2015-10-22 13:18:31 +00:00
|
|
|

|
|
|
|
lastMsg = -1;
|
|
|
|
packets = "_________";
|
|
|
|
hops = 0;
|
2017-06-10 12:35:39 +00:00
|
|
|
lastMsgHops = -1;
|
2015-10-22 13:18:31 +00:00
|
|
|

|
|
|
|
while(true) {
|
|
|
|
YIELD();
|
2017-06-10 12:35:39 +00:00
|
|
|
if(msg.equals("moving root 2 hops away")) {
|
|
|
|
var root = sim.getMoteWithID(1);
|
|
|
|
root.getInterfaces().getPosition().setCoordinates(5, -20, 0);
|
|
|
|
log.log("moving root 2 hops away\n");
|
|
|
|
} else if(msg.equals("moving root back")) {
|
|
|
|
var root = sim.getMoteWithID(1);
|
|
|
|
root.getInterfaces().getPosition().setCoordinates(8, 2, 0);
|
|
|
|
log.log("moving root back\n");
|
2015-10-22 13:18:31 +00:00
|
|
|
} else if(msg.startsWith("Sending")) {
|
|
|
|
hops = 0;
|
|
|
|
} else if(msg.startsWith("#L") && msg.endsWith("1; red")) {
|
|
|
|
hops++;
|
|
|
|
} else if(msg.startsWith("Data")) {
|
|
|
|
data = msg.split(" ");
|
|
|
|
num = parseInt(data[14]);
|
|
|
|
if(lastMsg != -1) {
|
|
|
|
if(num != lastMsg + 1) {
|
|
|
|
numMissed = num - lastMsg - 1;
|
2016-04-22 23:10:00 +00:00
|
|
|
lostMsgs += numMissed; 
|
2015-10-22 13:18:31 +00:00
|
|
|
log.log("Missed messages " + numMissed + " before " + num + "\n"); 
|
|
|
|
for(i = 0; i < numMissed; i++) {
|
2016-05-02 16:18:12 +00:00
|
|
|
packets = packets.substr(0, lastMsg + i + 1).concat("_"); 
|
2015-10-22 13:18:31 +00:00
|
|
|
}
|
|
|
|
} 
|
|
|
|
}
|
2017-06-10 12:35:39 +00:00
|
|
|
lastMsgHops = hops;
|
2016-05-02 16:18:12 +00:00
|
|
|
packets = packets.substr(0, num).concat("*");
|
2016-04-22 23:10:00 +00:00
|
|
|
log.log("" + hops + " " + packets + "\n");
|
2015-10-22 13:18:31 +00:00
|
|
|
lastMsg = num;
|
|
|
|
}
|
|
|
|
}</script>
|
|
|
|
<active>true</active>
|
|
|
|
</plugin_config>
|
2017-06-10 12:35:39 +00:00
|
|
|
<width>605</width>
|
2015-10-22 13:18:31 +00:00
|
|
|
<z>1</z>
|
2017-06-10 12:35:39 +00:00
|
|
|
<height>684</height>
|
|
|
|
<location_x>604</location_x>
|
|
|
|
<location_y>14</location_y>
|
2015-10-22 13:18:31 +00:00
|
|
|
</plugin>
|
|
|
|
</simconf>
|