<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rtime.felk.cvut.cz/hw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Indy</id>
	<title>HW wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rtime.felk.cvut.cz/hw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Indy"/>
	<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php/Special:Contributions/Indy"/>
	<updated>2026-05-22T18:24:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3010</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3010"/>
		<updated>2007-07-09T13:20:04Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Ubuntu packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;subversion&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;autoconf&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;automake (&amp;gt;= 1.9)&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;python-dev&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;graphviz&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;g++4.0&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;g++3.4&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;gcc-avr&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;uisp&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;swig&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, &#039;&#039;&#039;comment&#039;&#039;&#039; the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &#039;&#039;&#039;uncomment&#039;&#039;&#039; the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3009</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3009"/>
		<updated>2007-07-09T13:14:48Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* TOSComm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, &#039;&#039;&#039;comment&#039;&#039;&#039; the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &#039;&#039;&#039;uncomment&#039;&#039;&#039; the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3008</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3008"/>
		<updated>2007-07-09T13:11:54Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* TinyOS Java Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, &#039;&#039;&#039;comment&#039;&#039;&#039; the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &#039;&#039;&#039;uncomment&#039;&#039;&#039; the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3007</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3007"/>
		<updated>2007-07-09T12:55:36Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* nesC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3006</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3006"/>
		<updated>2007-07-09T12:44:00Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Linux Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3005</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3005"/>
		<updated>2007-07-09T12:43:29Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Linux Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3004</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3004"/>
		<updated>2007-07-09T12:41:27Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* MoteList */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note!&#039;&#039;&#039; If you are making the link with superuser, replace &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; with the appropriate path. &lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3003</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3003"/>
		<updated>2007-07-09T12:31:56Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* MoteList */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connect the TMote Sky to your usb port and run:&amp;lt;br&amp;gt;&lt;br /&gt;
 &amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
try &#039;&#039;&#039;&#039;&#039;motelist -h&#039;&#039;&#039;&#039;&#039; for additional options.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3002</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3002"/>
		<updated>2007-07-09T11:05:44Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* MSPGCC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler and its supporting tools are necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For both versions, you&#039;ll have to figure out a way to let users read the &#039;&#039;/proc/tty/driver/usbserial&#039;&#039; file. I&#039;ve had success configuring sudo to give all/some users nopassword access to a script that just cats it: NEEDS UPDATE!!!&lt;br /&gt;
Run it with &amp;quot;motelist&amp;quot;; try &amp;quot;motelist -h&amp;quot; for additional options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3001</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3001"/>
		<updated>2007-07-09T10:05:33Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Java for PowerPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Discard this line)&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler its supporting tools is necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For both versions, you&#039;ll have to figure out a way to let users read the &#039;&#039;/proc/tty/driver/usbserial&#039;&#039; file. I&#039;ve had success configuring sudo to give all/some users nopassword access to a script that just cats it: NEEDS UPDATE!!!&lt;br /&gt;
Run it with &amp;quot;motelist&amp;quot;; try &amp;quot;motelist -h&amp;quot; for additional options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3000</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=3000"/>
		<updated>2007-07-09T10:02:58Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Java for PowerPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK.&lt;br /&gt;
&amp;lt;br&amp;gt;Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler its supporting tools is necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For both versions, you&#039;ll have to figure out a way to let users read the &#039;&#039;/proc/tty/driver/usbserial&#039;&#039; file. I&#039;ve had success configuring sudo to give all/some users nopassword access to a script that just cats it: NEEDS UPDATE!!!&lt;br /&gt;
Run it with &amp;quot;motelist&amp;quot;; try &amp;quot;motelist -h&amp;quot; for additional options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=2999</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=2999"/>
		<updated>2007-07-09T10:02:36Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Java for PowerPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; &#039;&#039;&#039;AND&#039;&#039;&#039; the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;Note&#039;&#039;&#039;!:&#039;&#039; You don&#039;t need the JRE package because it is included in the SDK. Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler its supporting tools is necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For both versions, you&#039;ll have to figure out a way to let users read the &#039;&#039;/proc/tty/driver/usbserial&#039;&#039; file. I&#039;ve had success configuring sudo to give all/some users nopassword access to a script that just cats it: NEEDS UPDATE!!!&lt;br /&gt;
Run it with &amp;quot;motelist&amp;quot;; try &amp;quot;motelist -h&amp;quot; for additional options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=2998</id>
		<title>TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=TmoteSky_Linux_install_on_PowerPC_(PPC)/Ubuntu_Edgy_(6.10)&amp;diff=2998"/>
		<updated>2007-07-09T10:01:06Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Java for PowerPC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This document explains how to install Tmote and and all of it&#039;s its needed environment, such as TinyOS 1.x, NESC compiler etc, under Ubuntu Edgy (6.10) running on PPC CPU. Please be noted, this has only been tested on Powerbook G4 configuration so far and is not guaranteed to work on other PPC configurations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
This document follows the recommended installation of the complete environment for Tmote under Linux, with a few modification where needed for PPC. The original document can be found [http://www.moteiv.com/community/Tmote_Linux_install here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Ubuntu packages==&lt;br /&gt;
First, the development packages needs to be installed. Open from the main menu &#039;&#039;&#039;System-&amp;gt;Administration-&amp;gt;Synaptic Package Manager&#039;&#039;&#039; application.&lt;br /&gt;
&lt;br /&gt;
*Make sure that you have the following package installed:&lt;br /&gt;
** &#039;&#039;&#039;build-essential&#039;&#039;&#039; (In this procedure version 11.3 is installed)&lt;br /&gt;
** &#039;&#039;&#039;cvs, subversion, autoconf, automake (&amp;gt;= 1.9), python-dev, graphviz, g++4.0, g++3.4 gcc-avr, uisp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Java for PowerPC==&lt;br /&gt;
Sun doesn&#039;t support Java for PowerPC but there are alternatives. For this installation, Java SDK from IBM is chosen because of its popularity and reputation. The installation can be retrieved from [http://www-128.ibm.com/developerworks/java/jdk/linux/download.html here]. Choose the &#039;&#039;&#039;32-bit iSeries/pSeries&#039;&#039;&#039;.Download the &#039;&#039;&#039;SDK&#039;&#039;&#039; AND the &#039;&#039;&#039;Java Communications API&#039;&#039;&#039; Follow the installation instruction that comes with the download. If you choose to install the SDK somewhere else than suggested as in above, make sure that appropriate changes are made for the JDKROOT variable such as:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need also to set the following variable to tell Java what processor (PPC) you are using:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Don&#039;t forget&#039;&#039;&#039; to update the Java Communications API files in their appropriate directories. Just follow the same structure as given in the Java Communication API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hint:===&lt;br /&gt;
&lt;br /&gt;
It&#039;s easier to install via the &#039;&#039;&#039;rpm&#039;&#039;&#039; package. Use &amp;lt;code&amp;gt;alien -i&amp;lt;/code&amp;gt; tool to extract and install it.&lt;br /&gt;
&lt;br /&gt;
==TinyOS 1.x==&lt;br /&gt;
The [http://www.tinyos.net/ TinyOS] CVS repository is hosted by the [http://sourceforge.net/projects/tinyos/ TinyOS SourceForge project]. To get the latest version of the code, enter the following commands at the shell prompt; just press &#039;&#039;&#039;Enter&#039;&#039;&#039; when prompted for a password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $HOME&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos login&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cvs -z3 -d:pserver:anonymous@tinyos.cvs.sourceforge.net:/cvsroot/tinyos co tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After downloading the TinyOS 1.x source code, ensure that TOSROOT is set for your installation, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSPGCC==&lt;br /&gt;
[http://mspgcc.sourceforge.net/ MSPGCC] is the compiler used by TinyOS for the TI MSP430 platform. A patched version of this compiler its supporting tools is necessary for Tmote.&lt;br /&gt;
&#039;&#039;Build-mspgcc&#039;&#039; script found in the TinyOS CVS in the directory &#039;&#039;tinyos-1.x/tools/src/mspgcc/&#039;&#039;. You can run it directly inside that directory and it will download, compile, and install the patched tools for you.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;build-mspgcc&#039;&#039; script does not seem to work, you can also follow the manual compilation instructions described in the ToolChain README (it&#039;s complicated) in the same directory as build-mspgcc.&lt;br /&gt;
&lt;br /&gt;
After installing MSPGCC, if you are following along this guide, set the MSPGCCROOT for your installation, such as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MSP430-BSL for Tmote== &lt;br /&gt;
&#039;&#039;msp430-bsl&#039;&#039; is the programmer, or &amp;quot;Boot Strap Loader&amp;quot;, for the MSP430 developed by the MSPGCC project. Tmote requires a special version distributed with TinyOS to support its unique hardware design. For Linux, just symlink bsl.py to msp430-bsl, like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;cd /opt/msp430/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $TOSROOT/tools/src/mspgcc-pybsl/bsl.py ./msp430-bsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MoteList==&lt;br /&gt;
Motelist is a command-line utility that displays which serial ports have Tmote motes attached, available in &#039;&#039;$TOSROOT/tools/src/motelist/&#039;&#039;. The motelist-linux script works with Linux kernel 2.4. The motelist-linux2 script works with Linux kernel 2.6. Symlink the appropriate script it to &#039;&#039;/usr/local/bin/motelist&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ln -s $HOME/tinyos-1.x/tools/src/motelist/motelist-linux /usr/local/bin/motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For both versions, you&#039;ll have to figure out a way to let users read the &#039;&#039;/proc/tty/driver/usbserial&#039;&#039; file. I&#039;ve had success configuring sudo to give all/some users nopassword access to a script that just cats it: NEEDS UPDATE!!!&lt;br /&gt;
Run it with &amp;quot;motelist&amp;quot;; try &amp;quot;motelist -h&amp;quot; for additional options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TinyOS Scripts==&lt;br /&gt;
Some TinyOS scripts, specifically set-mote-id, are necessary to the build process. Install these scripts by entering the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/scripts/ &amp;amp;&amp;amp; make install prefix=/usr/local&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linux Environment==&lt;br /&gt;
Now is a good time to fully prepare your environment for Tmote and TinyOS. Add these commands like these to your ~/.bashrc script. Note that the xxxROOT variables must match your installation and must be defined using unix-style paths.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#IBM-JAVA for PPC G4&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JITC_PROCESSOR_TYPE=6&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#/usr/local/bin&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;/usr/local/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#Java&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export JDKROOT=/opt/IBMJava2-ppc-142&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$JDKROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;#MSPGCC&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MSPGCCROOT=/opt/msp430&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export PATH=&amp;quot;$MSPGCCROOT/bin:$PATH&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# TinyOS&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSROOT=$HOME/tinyos-1.x&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export TOSDIR=$TOSROOT/tos&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export CLASSPATH=&amp;quot;`$TOSROOT/tools/java/javapath`&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;export MAKERULES=$TOSROOT/tools/make/Makerules&amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before continuing to the final steps of this guide, ensure that these commands have been executed, possibly by logging back into your bash shell. Compiling in TinyOS requires TOSDIR be set, using the TinyOS Java tools requires that CLASSPATH be properly set, and building for Tmote requires that MAKERULES be set.&lt;br /&gt;
&lt;br /&gt;
==nesC==&lt;br /&gt;
Download the nesC 1.1.3 source archive from [http://prdownloads.sourceforge.net/nescc/nesc-1.1.3.tar.gz SourceForge]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IF&#039;&#039; building nesc-1.1.3 fails with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.c:123: error: static declaration of &#039;token_buffer&#039; follows non-static declaration&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;c-lex.h:90: error: previous declaration of &#039;token_buffer&#039; was here&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download and patch the following [http://www9.cs.tum.edu/people/rusu/files/nescc-1.1.3/static-clex.patch.nesc file] with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fix with: patch -p0 &amp;lt; static-clex.patch.nesc&amp;lt;/code&amp;gt; (in nesc)&lt;br /&gt;
&lt;br /&gt;
Recompile and install it again.&lt;br /&gt;
&lt;br /&gt;
==TinyOS Java Tools==&lt;br /&gt;
The TinyOS Java tools require the MIG utility provided by nesC to generate certain source files for processing messages. Compile the Java sources with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/tools/java; make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, there will be some compiling errors. Presumably these error will lead to that some Java classes that will not be compiled. Contribution to these errors are however not known at the time of the writing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And finally, because we are using Telosb architechture, you need to do the following:&lt;br /&gt;
In &#039;&#039;&#039;$JAVA_HOME/jre/lib/javax.comm.properties&#039;&#039;&#039;, change the line that reads:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyS=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dev/ttyUSB=PORT_SERIAL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TOSComm==&lt;br /&gt;
TOSComm is a beta package provided by TinyOS that provides native serial port access to Java. It is required to use tools such as SerialForwarder. TOSComm is intended as a replacement for JavaComm. To install TOSComm, as root, run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd $TOSROOT/beta/TOSComm&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
Now it is time to test if the installation went well. Plug the Tmote Device and write the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;motelist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should give similar response as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reference  Device           Descriptiion&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;---------- ---------------- ---------------------------------------------&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;M4A3U434   /dev/ttyUSB0     Moteiv tmote sky&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note: Even if it is working, there are no reference at this time for telling how well. If you encounter any errors due to the installation, please report it.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2975</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2975"/>
		<updated>2007-05-09T17:39:31Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules set by the following article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes leaves its contention area (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. The implementation will include only for the object &amp;lt;br&amp;gt;      within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Test the object (light) tracking on wide nighbourhood network. (Rescheduled for week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2974</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2974"/>
		<updated>2007-05-08T16:19:14Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules set by the following article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes leaves its contention area (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Test the object (light) tracking on wide nighbourhood network. (Schedule on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2973</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2973"/>
		<updated>2007-05-08T10:06:08Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules set by the following article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes leaves its contention area (In progress)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Test the object (light) tracking on wide nighbourhood network. (Schedule on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2972</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2972"/>
		<updated>2007-05-08T10:04:22Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules set by the following article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes leaves its contention area (In progress)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Track the object using the light sensors on the spread out nodes. (Schedule to be tested on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2971</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2971"/>
		<updated>2007-05-07T17:34:08Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules set by the following article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Release of slot when a node leaves the neighborhood (In progress)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Track the object using the light sensors on the spread out nodes. (Schedule to be tested on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2970</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2970"/>
		<updated>2007-05-03T19:53:17Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules following this article:&lt;br /&gt;
[http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TDMA.pdf TDMA.pdf]&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Almost done)&amp;lt;br&amp;gt;&lt;br /&gt;
- Release of slot when a node leaves the neighborhood (To be implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Track the object using the light sensors on the spread out nodes. (Schedule to be tested on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2969</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2969"/>
		<updated>2007-05-03T18:53:10Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
The following milestones are set to meet the requirements of the thesis.&lt;br /&gt;
&lt;br /&gt;
TDMA algorithm is implemented by the rules following this article:&lt;br /&gt;
XXXX&lt;br /&gt;
&lt;br /&gt;
1. Implement the complete TDMA algorithm on the TMote Sky WSN including&amp;lt;br&amp;gt;&lt;br /&gt;
- Automatic slot division when new node joins the neighborhood. (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Dynamic change of frame length when more than enough nodes joins its contention area. (Almost done)&amp;lt;br&amp;gt;&lt;br /&gt;
- Release of slot when a node leaves the neighborhood (To be implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
- Time synchronization of the nodes (Implemented)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
2. Implement light sensor for the object (light) tracking. Algorithm is to be discussed for this. The implementation&amp;lt;br&amp;gt;&lt;br /&gt;
will include only for the object within its neighbourhood. &lt;br /&gt;
&lt;br /&gt;
3. Track the object using the light sensors on the spread out nodes. (Schedule to be tested on week 19).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2964</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2964"/>
		<updated>2007-04-21T15:17:05Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TRead.zip TRead.zip] application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For Tmote Sky connected to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TReadSerial.zip TReadSerial.zip] file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x7D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2963</id>
		<title>Real-Time Object Tracking</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Real-Time_Object_Tracking&amp;diff=2963"/>
		<updated>2007-04-21T15:16:32Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* &amp;#039;&amp;#039;&amp;#039;Tasks&amp;#039;&amp;#039;&amp;#039; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &#039;&#039;&#039;Project definition&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Distributed wireless sensor networks (WSN) have been proposed for a wide&lt;br /&gt;
range of applications. The main purpose of sensor networks is to monitor&lt;br /&gt;
an area, including detecting, identifying, localizing, and tracking one&lt;br /&gt;
or more objects of interest.&lt;br /&gt;
&lt;br /&gt;
The aim of the thesis is to design and implement a wireless sensor&lt;br /&gt;
network for object tracking under real-time constraints, using time&lt;br /&gt;
division media access (TDMA). The application will be implemented in&lt;br /&gt;
TinyOS operating system with ZigBee technology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The objectives:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
- Collecting the data from the WSN to the main station&lt;br /&gt;
&lt;br /&gt;
- Design and implement TDMA algorithm in the WSN&lt;br /&gt;
&lt;br /&gt;
- Ensure real-time communication&lt;br /&gt;
&lt;br /&gt;
- Interpret the data for object tracking&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Time-schedule&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Tasks&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
- Implement time synchronization - DONE (Not fully evaluated).&amp;lt;br&amp;gt;&lt;br /&gt;
- Implement double frame algorithm when too many nodes in neighbouhood&amp;lt;br&amp;gt;&lt;br /&gt;
- Remove transmission conflict between UART and Rfm&amp;lt;br&amp;gt;&lt;br /&gt;
- GUI for easy visualization&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Resources&#039;&#039;&#039; ==&lt;br /&gt;
[[Temperature reading application]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documents&#039;&#039;&#039; ==&lt;br /&gt;
[[TmoteSky Linux install on PowerPC (PPC)/Ubuntu Edgy (6.10)]]&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links&#039;&#039;&#039; ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2962</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2962"/>
		<updated>2007-04-17T20:56:55Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Installation of the application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TRead.zip TRead.zip] application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For Tmote Sky connected to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TReadSerial.zip TReadSerial.zip] file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2961</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2961"/>
		<updated>2007-04-17T20:56:41Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TRead.zip TRead] application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For Tmote Sky connected to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TReadSerial.zip TReadSerial.zip] file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2960</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2960"/>
		<updated>2007-04-17T20:55:53Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Installation of the application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the [http://rtime.felk.cvut.cz/wsn/RT_Object_Tracking/TRead.zip TRead] application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For Tmote Sky connected to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2950</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2950"/>
		<updated>2007-04-15T15:10:28Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Installation of the application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For Tmote Sky connected to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2949</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2949"/>
		<updated>2007-04-15T15:09:59Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Installation of the application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
(For connection to USB port 0)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; make telosb install.$2 bsl,/dev/ttyUSB0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2948</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2948"/>
		<updated>2007-04-15T14:09:59Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;API:&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2947</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2947"/>
		<updated>2007-04-15T14:09:38Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
API:&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2946</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2946"/>
		<updated>2007-04-15T14:08:50Z</updated>

		<summary type="html">&lt;p&gt;Indy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the &#039;&#039;&#039;Base Station&#039;&#039;&#039; transmitts the complete data, both temperature readings, to the computer every second. Please note that the application described here can be used without any &#039;&#039;&#039;Remote Station&#039;&#039;&#039;.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS application &amp;lt;code&amp;gt;TRead&amp;lt;/code&amp;gt; and how to retreive and interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder &amp;lt;code&amp;gt;xxx/tinyos-1.x/apps&amp;lt;/code&amp;gt;, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2945</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2945"/>
		<updated>2007-04-15T14:01:59Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* EXAMPLE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2944</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2944"/>
		<updated>2007-04-15T14:01:40Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* EXAMPLE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== EXAMPLE ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;br /&gt;
&lt;br /&gt;
== Additional ==&lt;br /&gt;
The temperature can be calculated with the following C# code. However, it&#039;s not tested:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 Calculating Temperature in Engineering Units &lt;br /&gt;
 /// &amp;lt;summary&amp;gt; &lt;br /&gt;
 /// Calculates the temperature, in degrees Celsius of the: &lt;br /&gt;
 ///  &lt;br /&gt;
 ///  Panasonic ERT-J1VR103J Thermistor &lt;br /&gt;
 ///   &lt;br /&gt;
 /// The formula in the MTS Series User Manual is: &lt;br /&gt;
 ///  1/T(K) = a + b × ln(Rthr) + c × [ln(Rthr)]^3 &lt;br /&gt;
 ///   &lt;br /&gt;
 ///  where: &lt;br /&gt;
 ///   Rthr = R1(ADC_FS-ADC)/ADC &lt;br /&gt;
 ///   a = 0.00130705 &lt;br /&gt;
 ///   b = 0.000214381 &lt;br /&gt;
 ///   c = 0.000000093 &lt;br /&gt;
 ///   R1 = 10 kOhm &lt;br /&gt;
 ///   ADC_FS = 1023 &lt;br /&gt;
 ///   ADC = output value from mote’s ADC measurement. &lt;br /&gt;
 /// &lt;br /&gt;
 /// Note that an adjusted temp (adjTemp) is used because the &lt;br /&gt;
 /// actual temp reading is a 10 bit value that has been compressed &lt;br /&gt;
 /// into a single byte. As such it must be shifted left 2 bit places. &lt;br /&gt;
 /// &lt;br /&gt;
 ///  The value for _temp is the raw sensor reading from the SurgeMsg. &lt;br /&gt;
 /// &lt;br /&gt;
 /// &amp;lt;/summary&amp;gt; &lt;br /&gt;
 /// &amp;lt;returns&amp;gt;Temperature in Degrees Celsius as a float.&amp;lt;/returns&amp;gt; &lt;br /&gt;
 float CalculateTempC() &lt;br /&gt;
 { &lt;br /&gt;
   int adjTemp = _temp &amp;lt;&amp;lt; 2; &lt;br /&gt;
 &lt;br /&gt;
   // prevent divide by zero. &lt;br /&gt;
  if(adjTemp == 0) &lt;br /&gt;
    return 0F; &lt;br /&gt;
 &lt;br /&gt;
  float temperature, a, b, c, Rthr; &lt;br /&gt;
  a  = 0.001307050F; &lt;br /&gt;
  b  = 0.000214381F; &lt;br /&gt;
  c  = 0.000000093F; &lt;br /&gt;
  Rthr = 10000 * (1023 - adjTemp) / adjTemp; &lt;br /&gt;
  &lt;br /&gt;
  temperature = 1 / (float)(a + b * Math.Log(Rthr) + c *     &lt;br /&gt;
         Math.Pow(Math.Log(Rthr),3)); &lt;br /&gt;
  temperature -= 273.15F;   // Convert from Kelvin to Celcius &lt;br /&gt;
  &lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2943</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2943"/>
		<updated>2007-04-15T13:56:34Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;br /&gt;
&lt;br /&gt;
=== EXAMPLE ===&lt;br /&gt;
The data will be retreived as following (HEX VALUES)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;7E 42 08 00 00 00 00 00 7D 5E 00 01 7D 5D XX XX XX XX XX XX XX XX RR (RR) 7E&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
After removing the framing bytes and the escape code sequences, the ACTUAL packet is:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;42 08 00 00 00 00 00 7E 00 01 7D XX XX XX XX XX XX XX XX RR (RR)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE is 42 (NO_ACK). Data length is 8 bytes in the data region.&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2942</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2942"/>
		<updated>2007-04-15T13:49:46Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7E&#039;&#039;&#039;: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TYPE&#039;&#039;&#039;: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NN&#039;&#039;&#039;: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RESERVED&#039;&#039;&#039;: TMote reservation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DEST&#039;&#039;&#039;. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSG TYPE&#039;&#039;&#039;: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GRP ID&#039;&#039;&#039;: Group ID. Default set to 0x7E&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DATA&#039;&#039;&#039;: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CRC&#039;&#039;&#039;: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2941</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2941"/>
		<updated>2007-04-15T13:48:46Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
7E: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NN: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
RESERVED: TMote reservation&lt;br /&gt;
&lt;br /&gt;
DEST. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MSG TYPE: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
GRP ID: Group ID. Default set to 0x7E&lt;br /&gt;
&lt;br /&gt;
DATA: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
CRC: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
&amp;lt;br&amp;gt;REMOTE = Remote Station&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE!&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;1. The raw stream is in &#039;&#039;&#039;Little Endian&#039;&#039;&#039;  format&lt;br /&gt;
&amp;lt;br&amp;gt;2. The following escaped are used for maintaing the framing byte protocol&lt;br /&gt;
    0x7E -&amp;gt; 0x7D 0x5E&lt;br /&gt;
    0x/D -&amp;gt; 0x7D 0x5D&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2940</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2940"/>
		<updated>2007-04-15T13:44:55Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* DATA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
7E: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NN: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
RESERVED: TMote reservation&lt;br /&gt;
&lt;br /&gt;
DEST. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MSG TYPE: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
GRP ID: Group ID. Default set to 0x7E&lt;br /&gt;
&lt;br /&gt;
DATA: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
CRC: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DATA&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;br /&gt;
&lt;br /&gt;
LOCAL = Base Station&lt;br /&gt;
REMOTE = Remote Station&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2939</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2939"/>
		<updated>2007-04-15T13:42:20Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* DATA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
7E: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NN: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
RESERVED: TMote reservation&lt;br /&gt;
&lt;br /&gt;
DEST. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MSG TYPE: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
GRP ID: Group ID. Default set to 0x7E&lt;br /&gt;
&lt;br /&gt;
DATA: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
CRC: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
=== DATA ===&lt;br /&gt;
&lt;br /&gt;
The encapsulated data is in the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialData.png]]&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2938</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2938"/>
		<updated>2007-04-15T13:41:39Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
7E: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NN: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
RESERVED: TMote reservation&lt;br /&gt;
&lt;br /&gt;
DEST. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MSG TYPE: Not used in this application. Always: 0x01&lt;br /&gt;
&lt;br /&gt;
GRP ID: Group ID. Default set to 0x7E&lt;br /&gt;
&lt;br /&gt;
DATA: NN bytes of data sent. Explained further down&lt;br /&gt;
&lt;br /&gt;
CRC: Checksum (ignored)&lt;br /&gt;
&lt;br /&gt;
==== DATA ====&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2937</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2937"/>
		<updated>2007-04-15T13:38:23Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]] B = Byte(s)&lt;br /&gt;
&lt;br /&gt;
7E: The leading and trailing &#039;&#039;framing byte&#039;&#039; &amp;lt;code&amp;gt;0x7E&amp;lt;/code&amp;gt; can be ignored.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
TYPE: In this application, &amp;lt;code&amp;gt;0x42&amp;lt;/code&amp;gt; Which means no acknowledge is required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NN: Number of bytes of data that is sent in this packet&lt;br /&gt;
&lt;br /&gt;
RESERVED: TMote reservation&lt;br /&gt;
&lt;br /&gt;
DEST. ADDR: Packet destination. In this application: &amp;lt;code&amp;gt;0xFF 0xFF&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2936</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2936"/>
		<updated>2007-04-15T13:31:31Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Interpretting the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;br /&gt;
&lt;br /&gt;
The data is retrived in so called raw format as following:&lt;br /&gt;
&lt;br /&gt;
[[Image:SerialRawStream.png]]&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:SerialData.png&amp;diff=2935</id>
		<title>File:SerialData.png</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:SerialData.png&amp;diff=2935"/>
		<updated>2007-04-15T13:29:25Z</updated>

		<summary type="html">&lt;p&gt;Indy: Encapsulated data within the raw data retreived from the application TRead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Encapsulated data within the raw data retreived from the application TRead&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:SerialRawStream.png&amp;diff=2934</id>
		<title>File:SerialRawStream.png</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:SerialRawStream.png&amp;diff=2934"/>
		<updated>2007-04-15T13:28:09Z</updated>

		<summary type="html">&lt;p&gt;Indy: Raw serial data that is retrevied by the TRead application&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Raw serial data that is retrevied by the TRead application&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2933</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2933"/>
		<updated>2007-04-15T13:22:47Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2932</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2932"/>
		<updated>2007-04-15T13:22:10Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
&amp;lt;br&amp;gt;&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;br /&gt;
&lt;br /&gt;
== Interpretting the data ==&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2931</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2931"/>
		<updated>2007-04-15T13:19:51Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: buffer to transmitt&lt;br /&gt;
     &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2930</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2930"/>
		<updated>2007-04-15T13:19:12Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&amp;lt;br&amp;gt;&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: &amp;lt;code&amp;gt;pData&amp;lt;/code&amp;gt;: where the data should be stored. allocated by the caller&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: &amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;pData: buffer to transmitt&lt;br /&gt;
     &amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;length: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2929</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2929"/>
		<updated>2007-04-15T13:17:16Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;void setOptions(int type);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: pData: where the data should be stored. allocated by the caller&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: pData: buffer to transmitt&lt;br /&gt;
     length: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2928</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2928"/>
		<updated>2007-04-15T13:16:26Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;code&amp;gt;void closeDevice(void)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Settings for the serial device&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;void setOptions(int type);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: pData: where the data should be stored. allocated by the caller&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
&amp;lt;code&amp;gt;int getData(char* &amp;amp; pData);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: pData: buffer to transmitt&lt;br /&gt;
     length: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2927</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2927"/>
		<updated>2007-04-15T13:15:21Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;code&amp;gt;void closeDevice(void);&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Settings for the serial device&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;void setOptions(int type);&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: pData: where the data should be stored. allocated by the caller&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
int getData(char* &amp;amp; pData);&lt;br /&gt;
&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: pData: buffer to transmitt&lt;br /&gt;
     length: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2926</id>
		<title>Temperature reading application</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Temperature_reading_application&amp;diff=2926"/>
		<updated>2007-04-15T13:14:57Z</updated>

		<summary type="html">&lt;p&gt;Indy: /* Retrieving the data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Nesc/TinyOS application is for measuring the temperature with maximum of two sensors. One acts like a &#039;&#039;&#039;Base Station&#039;&#039;&#039; and has to be connected with the USB connection to the computer. The second acts like a &#039;&#039;&#039;Remote Station&#039;&#039;&#039; and transmitts its temperature reading via the radio to the &#039;&#039;&#039;Base Station&#039;&#039;&#039;. At the final stage, the base station transmitts the complete data, both temperature readings, to the computer every second.&lt;br /&gt;
In this document it is described how to install the Nesc/TinyOS, how to retreive the the data and how to interpret the data.&lt;br /&gt;
&lt;br /&gt;
It is assumed that the installation of TinyOS 1.x and Nesc is installed with the nessecary components.&lt;br /&gt;
&lt;br /&gt;
== Installation of the application ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Extract the TRead application in the folder &amp;lt;code&amp;gt;/tinyos-1.x/apps/&amp;lt;/code&amp;gt;.  Then in the folder xxx/tinyos-1.x/apps, install the application by following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;make telosb &amp;amp;&amp;amp; installXXXXXXXX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE!&amp;lt;br&amp;gt;&lt;br /&gt;
In the file &amp;lt;code&amp;gt;TReadM.nc&amp;lt;/code&amp;gt;, at the top, there is a preprocessor definition &amp;lt;code&amp;gt;#define BASE_STATION&amp;lt;/code&amp;gt;. &lt;br /&gt;
When installing for the &#039;&#039;&#039;Remote station&#039;&#039;&#039;, comment this line and install as described above. For &#039;&#039;&#039;Base Station&#039;&#039;&#039;, leave it as it is.&lt;br /&gt;
&lt;br /&gt;
== Retrieving the data ==&lt;br /&gt;
&lt;br /&gt;
Extract the TReadSerial.zip file. Here, you will find a C++ class called &amp;lt;code&amp;gt;CSerialCom&amp;lt;/code&amp;gt; that can be used for retreiving the data. &lt;br /&gt;
&amp;lt;br&amp;gt;Opens the connection to a serial device&lt;br /&gt;
with i.e &amp;quot;/dev/USB0&amp;quot; (Linux)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;int openDevice(const char* pDevice);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Closes the connection to the serial device&lt;br /&gt;
&amp;lt;code&amp;gt;void closeDevice(void);&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Settings for the serial device&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: Only type available: &amp;lt;code&amp;gt;TYPE_TMOTE_SKY&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;void setOptions(int type);&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Retreives the data from the serial port if any available.  Max waiting&lt;br /&gt;
time for the data retreival is 6s. Where after the return value will be 0.&lt;br /&gt;
&#039;&#039;&#039;IN&#039;&#039;&#039;: pData: where the data should be stored. allocated by the caller&lt;br /&gt;
&#039;&#039;&#039;Return&#039;&#039;&#039;: Nr of bytes allocated in the pData buffer.&lt;br /&gt;
int getData(char* &amp;amp; pData);&lt;br /&gt;
&lt;br /&gt;
Sends the to the serial device NOTE! Doesn&#039;t work!&lt;br /&gt;
IN: pData: buffer to transmitt&lt;br /&gt;
     length: number of bytes to send from the buffer&lt;br /&gt;
&amp;lt;code&amp;gt;int sendData(uint8_t* pData, int length);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method &amp;lt;opendevice(const char* pDevice)&amp;lt;/code&amp;gt; opens the connection to the tmote device by for example &amp;quot;/dev/USB0&amp;quot; in unix/linux environment. There after the data can be read by calling&lt;/div&gt;</summary>
		<author><name>Indy</name></author>
	</entry>
</feed>