2009-03-26 12:51:56 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<simconf>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
2012-05-29 14:46:53 +00:00
|
|
|
<delaytime>-2147483648</delaytime>
|
2009-06-24 14:42:50 +00:00
|
|
|
<randomseed>generated</randomseed>
|
|
|
|
<motedelay_us>1000000</motedelay_us>
|
2009-03-26 12:51:56 +00:00
|
|
|
<radiomedium>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.radiomediums.UDGM
|
2009-03-26 12:51:56 +00:00
|
|
|
<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>
|
2009-11-14 11:52:03 +00:00
|
|
|
<events>
|
|
|
|
<logoutput>40000</logoutput>
|
|
|
|
</events>
|
2009-03-26 12:51:56 +00:00
|
|
|
<motetype>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.mspmote.SkyMoteType
|
2009-03-26 12:51:56 +00:00
|
|
|
<identifier>sky1</identifier>
|
|
|
|
<description>Sky Mote Type #sky1</description>
|
2012-01-31 11:58:07 +00:00
|
|
|
<source EXPORT="discard">[CONTIKI_DIR]/examples/sky-shell-exec/sky-shell-exec.c</source>
|
|
|
|
<commands EXPORT="discard">echo CLEANING
|
2012-05-29 14:46:53 +00:00
|
|
|
make TARGET=sky clean CLEAN=symbols.?
|
2009-03-26 12:51:56 +00:00
|
|
|
|
2009-06-24 14:42:50 +00:00
|
|
|
echo COMPILING FIRMWARE WITH CORE
|
2012-05-29 14:46:53 +00:00
|
|
|
make sky-shell-exec.sky TARGET=sky SMALL=0
|
|
|
|
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky SMALL=0
|
|
|
|
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky SMALL=0
|
|
|
|
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky SMALL=0
|
|
|
|
make sky-shell-exec.sky CORE=sky-shell-exec.sky TARGET=sky SMALL=0
|
|
|
|
|
|
|
|
echo COMPILING CONTIKI EXECUTABLE
|
|
|
|
make hello-world.ce TARGET=sky SMALL=0</commands>
|
2012-01-31 11:58:07 +00:00
|
|
|
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/sky-shell-exec/sky-shell-exec.sky</firmware>
|
2013-11-19 11:17:37 +00:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</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.SkyCoffeeFilesystem</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
|
2009-03-26 12:51:56 +00:00
|
|
|
</motetype>
|
|
|
|
<mote>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-26 12:51:56 +00:00
|
|
|
<interface_config>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2009-03-26 12:51:56 +00:00
|
|
|
<x>56.18151486126417</x>
|
|
|
|
<y>93.20004013966208</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
2009-03-26 12:51:56 +00:00
|
|
|
<id>1</id>
|
|
|
|
</interface_config>
|
2012-01-31 11:58:07 +00:00
|
|
|
<interface_config>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.mspmote.interfaces.MspSerial
|
2012-05-29 14:46:53 +00:00
|
|
|
<history>ls~;~K~;ls~;read hello-world.b64~;ls~;~K~;ls~;</history>
|
2012-01-31 11:58:07 +00:00
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-03-26 12:51:56 +00:00
|
|
|
</mote>
|
|
|
|
</simulation>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.SimControl
|
2012-05-29 14:46:53 +00:00
|
|
|
<width>255</width>
|
|
|
|
<z>5</z>
|
2009-03-26 12:51:56 +00:00
|
|
|
<height>200</height>
|
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>0</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.MoteInterfaceViewer
|
2009-03-26 12:51:56 +00:00
|
|
|
<mote_arg>0</mote_arg>
|
|
|
|
<plugin_config>
|
|
|
|
<interface>Serial port</interface>
|
|
|
|
<scrollpos>0,0</scrollpos>
|
|
|
|
</plugin_config>
|
2012-05-29 14:46:53 +00:00
|
|
|
<width>656</width>
|
2009-06-24 14:42:50 +00:00
|
|
|
<z>1</z>
|
2012-05-29 14:46:53 +00:00
|
|
|
<height>295</height>
|
|
|
|
<location_x>9</location_x>
|
|
|
|
<location_y>674</location_y>
|
2009-06-24 14:42:50 +00:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.ScriptRunner
|
2009-06-24 14:42:50 +00:00
|
|
|
<plugin_config>
|
|
|
|
<script>TIMEOUT(50000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
|
|
|
|
|
2012-12-08 21:20:11 +00:00
|
|
|
helloworld = new java.io.File("../../examples/sky-shell-exec/hello-world.ce");
|
2009-06-24 14:42:50 +00:00
|
|
|
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");
|
|
|
|
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 < hello-world.ce";
|
2009-06-26 13:26:48 +00:00
|
|
|
sb = new java.lang.StringBuilder();
|
2009-06-24 14:42:50 +00:00
|
|
|
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) {
|
2009-11-14 11:52:03 +00:00
|
|
|
write(mote, line);
|
2009-06-26 13:26:48 +00:00
|
|
|
sb.append(line);
|
2009-06-24 14:42:50 +00:00
|
|
|
|
|
|
|
YIELD();
|
|
|
|
|
|
|
|
if (msg.startsWith(line)) {
|
2009-06-26 13:26:48 +00:00
|
|
|
log.log("UPLOADED: " + msg + "\n");
|
2009-06-24 14:42:50 +00:00
|
|
|
} 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"));
|
|
|
|
|
2009-06-26 13:26:48 +00:00
|
|
|
log.log("Reading and verifying hello-world.b64 from flash\n");
|
|
|
|
write(mote, "read hello-world.b64");
|
|
|
|
YIELD();
|
|
|
|
while (!msg.contains("Contiki>")) {
|
|
|
|
if (!sb.toString().startsWith(msg.trim())) {
|
|
|
|
log.log("Verify failed: '" + msg + "' does not start '" + sb.toString() + "'\n");
|
|
|
|
log.testFailed();
|
|
|
|
} else {
|
|
|
|
log.log("VERIFIED: " + msg + "\n");
|
2012-01-31 11:58:07 +00:00
|
|
|
sb.replace(0, msg.trim().length(), new String(""));
|
2009-06-26 13:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
YIELD();
|
|
|
|
}
|
|
|
|
if (sb.length()>0) {
|
|
|
|
log.log("Verify failed: remaining buffer: " + sb);
|
|
|
|
log.testFailed();
|
|
|
|
}
|
|
|
|
GENERATE_MSG(500, "continue");
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
|
|
|
|
|
|
|
|
|
2009-06-24 14:42:50 +00:00
|
|
|
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");
|
2009-06-26 11:30:36 +00:00
|
|
|
while (true) {
|
|
|
|
YIELD();
|
2012-05-29 14:46:53 +00:00
|
|
|
log.log("> " + msg + "\n");
|
2009-06-26 11:30:36 +00:00
|
|
|
if (msg.contains("OK")) {
|
|
|
|
log.log("> ELF loader returned OK\n");
|
|
|
|
}
|
|
|
|
if (msg.contains("Hello, world")) {
|
|
|
|
log.log("> Hello world process started\n");
|
|
|
|
log.testOK();
|
|
|
|
}
|
2012-01-31 11:58:07 +00:00
|
|
|
}</script>
|
2009-06-24 14:42:50 +00:00
|
|
|
<active>true</active>
|
|
|
|
</plugin_config>
|
|
|
|
<width>600</width>
|
2012-05-29 14:46:53 +00:00
|
|
|
<z>2</z>
|
|
|
|
<height>966</height>
|
|
|
|
<location_x>670</location_x>
|
|
|
|
<location_y>8</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.LogListener
|
2012-05-29 14:46:53 +00:00
|
|
|
<plugin_config>
|
|
|
|
<filter />
|
|
|
|
<coloring />
|
|
|
|
</plugin_config>
|
|
|
|
<width>659</width>
|
|
|
|
<z>4</z>
|
|
|
|
<height>250</height>
|
|
|
|
<location_x>7</location_x>
|
|
|
|
<location_y>419</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.Visualizer
|
2012-05-29 14:46:53 +00:00
|
|
|
<plugin_config>
|
2013-11-19 11:17:37 +00:00
|
|
|
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
|
2012-05-29 14:46:53 +00:00
|
|
|
<viewport>0.9090909090909091 0.0 0.0 0.9090909090909091 52.925895580668964 -30.727309217874634</viewport>
|
|
|
|
</plugin_config>
|
|
|
|
<width>211</width>
|
|
|
|
<z>3</z>
|
|
|
|
<height>164</height>
|
|
|
|
<location_x>16</location_x>
|
|
|
|
<location_y>239</location_y>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 11:17:37 +00:00
|
|
|
org.contikios.cooja.plugins.MoteInterfaceViewer
|
2012-05-29 14:46:53 +00:00
|
|
|
<mote_arg>0</mote_arg>
|
|
|
|
<plugin_config>
|
|
|
|
<interface>Coffee Filesystem</interface>
|
|
|
|
<scrollpos>0,0</scrollpos>
|
|
|
|
</plugin_config>
|
|
|
|
<width>397</width>
|
2009-06-24 14:42:50 +00:00
|
|
|
<z>0</z>
|
2012-05-29 14:46:53 +00:00
|
|
|
<height>395</height>
|
|
|
|
<location_x>263</location_x>
|
|
|
|
<location_y>13</location_y>
|
2009-03-26 12:51:56 +00:00
|
|
|
</plugin>
|
|
|
|
</simconf>
|
|
|
|
|