Deploying TinyOS-2.x Code PDF Print E-mail
Written by martcon   
Friday, 21 November 2008 14:36

The most popular operating system that Sensor Motes run on is TinyOS. There are two versions of TinyOS - Version 1.0 (TinyOS-1.x) and Version 2.0 (TinyOS-2.x). Vertoda has been developed with Sensor Motes developed using TinyOS-1.x and TinyOS-2.x. TinyOS-2.x a clean slate redesign of the operating system and is not backward compatible with TinyOS-1.x. The architecture and design of TinyOS-2.x is undoubtedly superior but there is a learning curve if you are used to Version 1.0. The following is an overview of what needs to be done to deploy a Sensor Mote using TinyOS-2.x:

  • Open cygwin. For details of installing cygwin and TinyOS refer to the TinyOS Website (http://www.tinyos.net).
  • Export the following environment variables.   
    export JAVA_HOME=/cygdrive/c/Program\ Files/Java/jdk1.6.0_01
    export TOSROOT=/opt/tinyos-2.x
    export TOSDIR=$TOSROOT/tos
    export CLASSPATH=`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar`
    export CLASSPATH2=`cygpath -w $TOSROOT/support/sdk/java`
    export CLASSPATH="$CLASSPATH;.;$CLASSPATH2"
    export MAKERULES=$TOSROOT/support/make/Makerules
    export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
                                                                                                                     
  • The above was sourced from the Berkley Millennium archive so thanks to them for publishing these settings.
  • The make command for TinyOS-2.x differs from that on TinyOS-1.x.
  • For a mica2 mote that is connected to a serial port with an ID of COM6 the command is:

           make mica2 reinstall,1 mib510,/dev/tty5

  • Note the format /dev/tty5 denotes our use of COM6. If we were using the COM1 port we would use the syntax /dev/tty0, COM2 would be /dev/tty1 etc.
  • If you are using mica2 motes note that their radio frequency (900MHz) differs from the TinyOS-2.x setting.
  • Specifically, you should set the CFLAGS environmental variable when uploading your code:

 CFLAGS=-DCC1K_DEFAULT_FREQ=CC1K_915_998_MHZ make mica2 reinstall,1 mib510,/dev/tty5

 

 

 
RocketTheme Joomla Templates