]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/deluge/Blink/burn-net
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / apps / tests / deluge / Blink / burn-net
index 64a19a17ff1c3d48794f76d3b62a92d38cf70f5f..36f1f4cbe17ad6046b4cffb14ea51b329bd72e15 100755 (executable)
@@ -5,17 +5,31 @@ if [[ ! -x ${TOS_DELUGE} ]] ; then
     TOS_DELUGE=../../../../tools/tinyos/misc/tos-deluge
 fi 
 
+$TOS_DELUGE > /dev/null
+
+if [[ $? != 0 ]]
+then
+  echo "Unable to locate tos-deluge."
+  exit 2
+fi
+
 if [ $# -ne 2 ]; then
   echo "Usage: $0 <platform> <number of motes>"
-  echo "<platform>         \"micaz\", \"telosb\""
-  echo "<number of motes>  how many motes will be used in the test"
+  echo "  <platform>         micaz, telosb, iris or mulle"
+  echo "  <number of motes>  how many motes will be used in the test"
   exit 2
 fi
 
 PLATFORM=$1
 NO_MOTES=$2
 
-if [ ${PLATFORM} != 'micaz' -a ${PLATFORM} != 'telosb' ]; then
+if [ ${PLATFORM} != 'micaz' -a \
+     ${PLATFORM} != 'telosb' -a \
+     ${PLATFORM} != 'iris' \
+     ${PLATFORM} != 'iris' -a \
+     ${PLATFORM} != 'mulle' -a \
+     ${PLATFORM} != 'epic' ]
+then
   echo "\"${PLAFTORM}\" is not a supported platform"
   exit 2
 fi
@@ -28,29 +42,25 @@ fi
 
 echo ================================ Compile Blink =================================
 make clean
-CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM}
 ID=0
 
 function burn_one() {
     ID=`expr $ID + 1`
-    echo -n ">>> Please plug mote $ID and type the port to continue: "
+    echo -n ">>> Please plug mote $ID and type the programming sorce (bsl,PORT | mib510,PORT | eprb,HOST): "
     read PORT
 
-    if [ ${PLATFORM} == 'micaz' ]
-    then
-       CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} reinstall,$ID mib510,${PORT}
-    elif [ ${PLATFORM} == 'telosb' ]
-    then
-       CFLAGS=-DDELUGE_BASESTATION make ${PLATFORM} reinstall,$ID bsl,${PORT}
-    fi
-    
+    CFLAGS=$1 make ${PLATFORM} install,$ID ${PORT}
 }
 
-while [[ ${NO_MOTES} > 0 ]]
+while [[ ${NO_MOTES} > 1 ]]
 do
-  burn_one
+  burn_one -DDELUGE_LIGHT_BASESTATION
   NO_MOTES=`expr ${NO_MOTES} - 1`
 done
+echo ">>> Note: this last mote will be the basestation! <<<"
+burn_one -DDELUGE_BASESTATION
+echo -n ">>> Please plug mote $ID and type the communication sorce (serial@PORT:SPEED | network@HOST:PORT) to continue: "
+read CPORT
 
 echo '   +------------------------------------------------------------------------+'
 echo '   |                                                                        |'
@@ -62,10 +72,10 @@ echo '   +----------------------------------------------------------------------
 read
 
 echo ============================= Compile a new Blink ==============================
-CFLAGS=-DBLINK_REVERSE\ -DDELUGE_BASESTATION make ${PLATFORM} 
+CFLAGS=-DBLINK_REVERSE\ -DDELUGE_LIGHT_BASESTATION make ${PLATFORM} 
 
 echo ========= Upload the new image to the external flash of the last mote ==========
-${TOS_DELUGE} ${PORT} ${PLATFORM} -i 0 build/${PLATFORM}/tos_image.xml
+${TOS_DELUGE} ${CPORT} -i 1 build/${PLATFORM}/tos_image.xml
 
 echo '            +-----------------------------------------------------+'
 echo '            |                                                     |'
@@ -76,34 +86,26 @@ echo '            |                                                     |'
 echo '            |              Press ENTER to continue...             |'
 echo '            |                                                     |'
 echo '            +-----------------------------------------------------+'
-
 read
 
 echo ============================= Start dissemination ==============================
-${TOS_DELUGE} ${PORT} ${PLATFORM} -d 0
+${TOS_DELUGE} ${CPORT} -dr 1
 
 echo '         +------------------------------------------------------------+'
 echo '         |                                                            |'
 echo '         | The dissemination is completed when the second and third   |'
 echo '         | led from all the motes except the last one stops blinking. |'
 echo '         |                                                            |'
-echo '         | In the next step the motes will be rebooted to allow the   |'
-echo '         | reprogramming to take place.                               |'
+echo '         | After a mote gets the whole image he will reboot and       |'
+echo '         | reprogram itself. If the new image contains Deluge he will |'
+echo '         | continue participating in dissemination.                   |'
 echo '         |                                                            |'
-echo '         |                 Press ENTER to continue...                 |'
+echo '         | In the next step all the motes except the basestation will |'
+echo '         | be rebooted to allow the reprogramming to take place.      |'
+echo '         |                                                            |'
+echo '         | After reboot the motes should start blinking the 3rd led   |'
+echo '         | (blue/yellow).                                             |'
 echo '         |                                                            |'
 echo '         +------------------------------------------------------------+'
-read
 
-echo ===================== Trigger the reboot in the new image ======================
-${TOS_DELUGE} ${PORT} ${PLATFORM} -r 0
-
-echo '        +-------------------------------------------------------------+'
-echo '        |                                                             |'
-echo '        | All the motes except the last one should reboot, reprogram  |'
-echo '        | the internal flash with the new image and start running it. |'
-echo '        | The end result should be that the last led (blue/yellow)    |'
-echo '        | from all the motes except the last one is blinking.         |'
-echo '        |                                                             |'
-echo '        +-------------------------------------------------------------+'