Cooja crosslevel communication test:

tests radio communication between emulated nodes (ESB + Sky) and Cooja Contiki nodes
This commit is contained in:
fros4943 2008-11-03 14:05:30 +00:00
parent 2df1f699aa
commit 6095919463
3 changed files with 325 additions and 0 deletions

View File

@ -0,0 +1,290 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<ticktime>1</ticktime>
<randomseed>123456</randomseed>
<motedelay>5000</motedelay>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>100.0</transmitting_range>
<interference_range>100.0</interference_range>
<success_ratio_tx>0.5</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 #1</description>
<source>../../../examples/rime/example-abc.c</source>
<command>make example-abc.sky TARGET=sky</command>
</motetype>
<motetype>
se.sics.cooja.mspmote.ESBMoteType
<identifier>esb1</identifier>
<description>ESB Mote Type #1</description>
<source>../../../examples/rime/example-abc.c</source>
<command>make example-abc.esb TARGET=esb</command>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype9</identifier>
<description>Contiki Mote #1</description>
<contikibasedir>../../..</contikibasedir>
<contikicoredir>../../../platform/cooja</contikicoredir>
<projectdir>../../../examples/rime</projectdir>
<compilefile>../apps/mrm</compilefile>
<compilefile>../apps/mspsim</compilefile>
<compilefile>../../../examples/rime</compilefile>
<compilefile>../../../examples/rime</compilefile>
<compilefile>../../../examples/rime/example-abc.c</compilefile>
<process>example_abc_process</process>
<sensor>button_sensor</sensor>
<sensor>pir_sensor</sensor>
<sensor>radio_sensor</sensor>
<sensor>vib_sensor</sensor>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<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>
<coreinterface>cfs_interface</coreinterface>
<coreinterface>beep_interface</coreinterface>
<coreinterface>button_interface</coreinterface>
<coreinterface>radio_interface</coreinterface>
<coreinterface>ip_interface</coreinterface>
<coreinterface>leds_interface</coreinterface>
<coreinterface>moteid_interface</coreinterface>
<coreinterface>pir_interface</coreinterface>
<coreinterface>rs232_interface</coreinterface>
<coreinterface>vib_interface</coreinterface>
<coreinterface>clock_interface</coreinterface>
<coreinterface>simlog_interface</coreinterface>
<symbols>false</symbols>
<commstack>Rime</commstack>
</motetype>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype9</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-562.9265350779835</x>
<y>-7.4313537667545635</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.interfaces.Battery
<infinite>false</infinite>
</interface_config>
<interface_config>
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>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype9</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-569.1395123422226</x>
<y>60.488781312375885</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.interfaces.Battery
<infinite>false</infinite>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.19.16</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>49.28753151734429</x>
<y>-6.801705242882613</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>
<interface_config>
se.sics.cooja.interfaces.Position
<x>45.29008348613149</x>
<y>58.80514675336113</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.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>574.2943627832708</x>
<y>-6.801705242882613</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>5</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>574.2943627832708</x>
<y>59.941038287544195</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>6</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype9</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>981.0053840033577</x>
<y>-7.979024087557906</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.interfaces.Battery
<infinite>false</infinite>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>7</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.3.18</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.contikimote.ContikiMote
<motetype_identifier>mtype9</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>1346.8489601454312</x>
<y>-8.540235607229494</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.interfaces.Battery
<infinite>false</infinite>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiIPAddress
<ipv4address>10.10.18.15</ipv4address>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>989.572289405294</x>
<y>59.94103828754419</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>9</id>
</interface_config>
</mote>
<mote>
se.sics.cooja.mspmote.ESBMote
<motetype_identifier>esb1</motetype_identifier>
<interface_config>
se.sics.cooja.interfaces.Position
<x>1349.1941112745471</x>
<y>58.873154391057355</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>10</id>
</interface_config>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>265</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>884</width>
<z>2</z>
<height>211</height>
<location_x>277</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter>received</filter>
<history>256</history>
</plugin_config>
<width>1161</width>
<z>4</z>
<height>370</height>
<location_x>0</location_x>
<location_y>458</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.radiomediums.UDGM$VisUDGM
<width>997</width>
<z>3</z>
<height>266</height>
<location_x>189</location_x>
<location_y>185</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View File

@ -0,0 +1 @@
Cross-level communication. Cooja+Sky+ESB running Rime example-abc.

View File

@ -0,0 +1,34 @@
/* Only handle receive messages */
if (!msg.contains('received')) {
return;
}
/* Log receiver */
count = global.get("count_" + id);
if (count == null) {
count = 0;
}
count++;
global.put("count_" + id, count);
log.log("Node " + id + " received message: " + count + "\n");
/* Did all nodes (1-10) receive a message? */
for (i = 1; i <= 10; i++) {
result = global.get("count_" + i);
if (result == null || result == 0) {
log.log("Node " + i + " did not yet receive a message\n");
return;
}
}
/* Report test info */
log.log("TEST INFO: ");
for (i = 1; i <= 10; i++) {
result = global.get("count_" + i);
log.log(java.lang.Integer.toString(result) + " ");
}
log.log("\n");
log.log("TEST OK\n"); /* Report test success */
mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/