Difference between revisions of "Manual installation using RPM packages"

From TinyOS Wiki
Jump to: navigation, search
(New page: <h1>Manual installation on your host OS with RPMs</h1> Currently, the TinyOS Core Working Group supports TinyOS on two platforms: Cygwin (Windows) and Linux. There have been some successfu...)
 
 
(7 intermediate revisions by the same user not shown)
Line 8: Line 8:
  
 
<ol>
 
<ol>
   <li><b>Installing a Java 1.6  JDK.</b> Java is the most common way of interacting
+
   <li><b>Installing a Java JDK.</b> Java is the most common way of interacting
 
   with mote base stations or gateways that are plugged into a PC or laptop.</li>
 
   with mote base stations or gateways that are plugged into a PC or laptop.</li>
 
   <li><b><font color="red">Windows only.</font> Install Cygwin.</b> This gives you a shell
 
   <li><b><font color="red">Windows only.</font> Install Cygwin.</b> This gives you a shell
Line 24: Line 24:
 
   put into their optimizations.</li>
 
   put into their optimizations.</li>
 
   <li><b>Installing the TinyOS source tree.</b> If you want to compile and
 
   <li><b>Installing the TinyOS source tree.</b> If you want to compile and
   install TinyOS programs, you need the code. Note that with the described method you will only obtain pretty old code. Try to skip that step to get the code and set up the enviroment with the method described in the [[automatic installation]].</li>
+
   install TinyOS programs, you need the code.</li>
 
   <li><b>Installing the Graphviz visualization tool.</b> The TinyOS
 
   <li><b>Installing the Graphviz visualization tool.</b> The TinyOS
 
   environment includes <tt>nesdoc</tt>, a tool that automatically
 
   environment includes <tt>nesdoc</tt>, a tool that automatically
Line 35: Line 35:
 
</ol>
 
</ol>
  
<h2>Step 1: Install Java 1.6 JDK</h2>
+
<h2>Step 1: Install Java JDK</h2>
  
 
+
Download and install Sun's JDK from [http://java.sun.com  http://java.sun.com].
Download and install Sun's 1.6 JDK from [http://java.sun.com  http://java.sun.com].
 
  
 
<h2>Step 2: Install Cygwin</h2>
 
<h2>Step 2: Install Cygwin</h2>
Line 45: Line 44:
 
on Linux, skip to step 3.</font>
 
on Linux, skip to step 3.</font>
  
<p>We have put online the cygwin packages that we've confirmed to be
+
# Download [http://cygwin.com/setup.exe setup.exe] and run it to install Cygwin.
compatible with TinyOS. The instructions below use those packages. You
+
# When the window pops up to allow you to select what packages to install, be sure to select:
can also upgrade your cygwin environment according to the instructions
+
#*rpm
at www.cygwin.com and your environment will most likely work. A large
+
#*make
number of TinyOS users, upgrade their cygwin packages at least monthly
+
#*perl
from cygnus. However, since we can't test what packages are compatible
+
#*python
as they become available daily, we can't confirm that today's set will
 
work.
 
</p>
 
 
 
<ol>
 
# Download [http://cone.informatik.uni-freiburg.de/people/aslam/cygwin-files.zip cygwin-files.zip] and unzip it under some local folder say c:/cygwin-files
 
# Go to c:/cygwin-files and start the setup. Use following instructions.
 
:# When it ask for ''"Choose A download source"'', then use ''"Install from Local Directory"'' option
 
:# When it ask for ''"Select Root Install Director"'' then use following options.
 
:#: Root Directory: c:\cygwin (or some other directory without spaces in its name)
 
:#: Install for: All Users
 
:#: Default Text file type: Unix/Binary
 
:# When it ask for ''"Select local Package directory"'' then select ''"c:/cygwin-files"'' (Note: this location depends on where you have unzip cygwin-files.zip, in step-1 above we have used c:/cygwin-files)
 
:# Complete the rest of installation process
 
</ol>
 
 
 
Some notes:
 
<ul>
 
<li> You might see a message explaining that you need to reboot because some
 
    files are in use. This most likely means that your cygwin DLL is loaded
 
    and in-use and, therefore, cannot be replaced. When you reboot, the new DLL
 
    will be loaded. <p></p></li>
 
 
 
<li> Related to the above warnings, if you see warnings about the cygwin1.dll not
 
    being found, don't worry. All will be well once you reboot and the right DLL is loaded. <p></p></li>
 
<li> You will need the packages rpm, make and perl which are not installed by default. For a complete installation, flex, bison and python are required, too.<p></p></li>
 
</ul>
 
  
 
<h2>Step 3: Install native compilers </h2>
 
<h2>Step 3: Install native compilers </h2>
  
<p>Install the appropriate version of the following (Windows or Linux,
+
<p>Install the appropriate compiler based on your hardware and operating system.</p>
avr or msp430 or both) with the rpm command 'rpm -ivh <i>rpm></i>'.
 
On
 
windows, if you get an error claiming that the rpm was intended for a cygwin_nt-5.1 operating system and you're indeed on a windows computer, bypass the erroneous
 
error by using 'rpm -ivh --ignoreos <i>rpmname</i>'.
 
</p>
 
  
 
<b><em>Atmel AVR Tools</em></b>
 
<b><em>Atmel AVR Tools</em></b>
Line 92: Line 59:
 
<tr>
 
<tr>
 
   <td bgcolor="#dddddd"><b>Tool</b></td>
 
   <td bgcolor="#dddddd"><b>Tool</b></td>
 
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 +
  <td bgcolor="#dddddd"><b>Command</b></td>
 
</tr>
 
</tr>
  
Line 101: Line 68:
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/avr-binutils-2.17tinyos-3.cygwin.i386.rpm avr-binutils-2.17tinyos-3.cygwin.i386.rpm] </td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/avr-binutils-2.17tinyos-3.cygwin.i386.rpm avr-binutils-2.17tinyos-3.cygwin.i386.rpm] </td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/avr-binutils-2.17tinyos-3.i386.rpm avr-binutils-2.17tinyos-3.i386.rpm] </td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/avr-binutils-2.17tinyos-3.i386.rpm avr-binutils-2.17tinyos-3.i386.rpm] </td>
 
+
  <td rowspan="6"><code>rpm -ivh</code><br/><code>rpm -ivh --ignoreos</code> (if Cygwin complains)</td>
 
</tr>
 
</tr>
  
Line 112: Line 79:
 
<tr>
 
<tr>
 
   <td>avr-libc</td>
 
   <td>avr-libc</td>
 
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/avr-libc-1.4.7-1.cygwin.i386.rpm avr-libc-1.4.7-1.cygwin.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/avr-libc-1.4.7-1.cygwin.i386.rpm avr-libc-1.4.7-1.cygwin.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/avr-libc-1.4.7-1.i386.rpm avr-libc-1.4.7-1.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/avr-libc-1.4.7-1.i386.rpm avr-libc-1.4.7-1.i386.rpm]</td>
Line 121: Line 87:
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/windows/avarice-2.4-1.cygwin.i386.rpm avarice-2.4-1.cygwin.i386.rpm]</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/windows/avarice-2.4-1.cygwin.i386.rpm avarice-2.4-1.cygwin.i386.rpm]</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/linux/avarice-2.4-1.i386.rpm avarice-2.4-1.i386.rpm]</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/linux/avarice-2.4-1.i386.rpm avarice-2.4-1.i386.rpm]</td>
 
 
</tr>
 
</tr>
  
Line 135: Line 100:
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/linux/avrdude-tinyos-5.6cvs-1.i386.rpm avrdude-tinyos-5.6cvs-1.i386.rpm]</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tools/linux/avrdude-tinyos-5.6cvs-1.i386.rpm avrdude-tinyos-5.6cvs-1.i386.rpm]</td>
 
</tr>
 
</tr>
 
 
 
</table>
 
</table>
 
<i><font color="red">&#8224;</font>If you receive an rpm error that indicates that you have a newer version already installed, try <code>rpm -Uvh --force</code></i><br>
 
<i><font color="red">&#8224;</font>If you receive an rpm error that indicates that you have a newer version already installed, try <code>rpm -Uvh --force</code></i><br>
Line 148: Line 111:
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 +
  <td bgcolor="#dddddd"><b>Command</b></td>
 
</tr>
 
</tr>
  
Line 154: Line 118:
 
   <td>[http://sing.stanford.edu/intelmote2/tools/windows/xscale-elf-binutils-2.15-1.cygwin.i386.rpm xscale-elf-binutils-2.15tinyos-1.cygwin.i386.rpm]</td>
 
   <td>[http://sing.stanford.edu/intelmote2/tools/windows/xscale-elf-binutils-2.15-1.cygwin.i386.rpm xscale-elf-binutils-2.15tinyos-1.cygwin.i386.rpm]</td>
 
   <td>[http://sing.stanford.edu/intelmote2/tools/linux/xscale-elf-binutils-2.15-2.i386.deb xscale-elf-binutils-2.15-2.i386.deb]</td>
 
   <td>[http://sing.stanford.edu/intelmote2/tools/linux/xscale-elf-binutils-2.15-2.i386.deb xscale-elf-binutils-2.15-2.i386.deb]</td>
 +
  <td rowspan="4"><code>rpm -ivh</code><br/><code>rpm -ivh --ignoreos</code> (if Cygwin complains)</td>
 
</tr>
 
</tr>
  
Line 159: Line 124:
 
   <td bgcolor="#dddddd">xscale-elf-gcc</td>
 
   <td bgcolor="#dddddd">xscale-elf-gcc</td>
 
   <td bgcolor="#dddddd">[http://sing.stanford.edu/intelmote2/tools/windows/xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm]</td>
 
   <td bgcolor="#dddddd">[http://sing.stanford.edu/intelmote2/tools/windows/xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm]</td>
 
 
   <td bgcolor="#dddddd">[http://sing.stanford.edu/intelmote2/tools/linux/xscale-elf-gcc-3.4.3-2.i386.deb xscale-elf-gcc-3.4.3-2.i386.deb]</td>
 
   <td bgcolor="#dddddd">[http://sing.stanford.edu/intelmote2/tools/linux/xscale-elf-gcc-3.4.3-2.i386.deb xscale-elf-gcc-3.4.3-2.i386.deb]</td>
 
</tr>
 
</tr>
Line 181: Line 145:
  
 
<p></p><b><em>TI MSP430 Tools</em></b>
 
<p></p><b><em>TI MSP430 Tools</em></b>
 +
...wow this is outdated. Don't use any of this. Use the debian packages or install from source. See the packaging folder in tinyos-main.
 
<table border="0">
 
<table border="0">
 
<tr>
 
<tr>
Line 186: Line 151:
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 
   <td bgcolor="#dddddd"><b>Linux</b></td>
 +
  <td bgcolor="#dddddd"><b>Command</b></td>
 
</tr>
 
</tr>
  
 
<tr>
 
<tr>
 
 
   <td>base</td>
 
   <td>base</td>
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-base-0.1-20050607.cygwin.i386.rpm msp430tools-base-0.1-20050607.cygwin.i386.rpm] </td>
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-base-0.1-20050607.cygwin.i386.rpm msp430tools-base-0.1-20050607.cygwin.i386.rpm] </td>
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-base-0.1-20050607.i386.rpm msp430tools-base-0.1-20050607.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-base-0.1-20050607.i386.rpm msp430tools-base-0.1-20050607.i386.rpm]</td>
 +
  <td rowspan="7"><code>rpm -ivh</code><br/><code>rpm -ivh --ignoreos</code> (if Cygwin complains)</td>
 
</tr>
 
</tr>
  
Line 198: Line 164:
 
   <td bgcolor="#dddddd">python tools</td>
 
   <td bgcolor="#dddddd">python tools</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-python-tools-1.0-1.cygwin.noarch.rpm msp430tools-python-tools-1.0-1.cygwin.noarch.rpm] </td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-python-tools-1.0-1.cygwin.noarch.rpm msp430tools-python-tools-1.0-1.cygwin.noarch.rpm] </td>
 
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-python-tools-1.0-1.noarch.rpm msp430tools-python-tools-1.0-1.noarch.rpm]</td>
 
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-python-tools-1.0-1.noarch.rpm msp430tools-python-tools-1.0-1.noarch.rpm]</td>
 
</tr>
 
</tr>
 
  
 
<tr>
 
<tr>
Line 218: Line 182:
 
<tr>
 
<tr>
 
   <td>libc</td>
 
   <td>libc</td>
 
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/msp430tools-libc-20080808-1.cygwin.i386.rpm msp430tools-libc-20080808-1.cygwin.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/windows/msp430tools-libc-20080808-1.cygwin.i386.rpm msp430tools-libc-20080808-1.cygwin.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/msp430tools-libc-20080808-1.i386.rpm msp430tools-libc-20080808-1.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tools/linux/msp430tools-libc-20080808-1.i386.rpm msp430tools-libc-20080808-1.i386.rpm]</td>
Line 236: Line 199:
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-gdb-6.0-20050609.i386.rpm msp430tools-gdb-6.0-20050609.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.0.0/tools/linux/msp430tools-gdb-6.0-20050609.i386.rpm msp430tools-gdb-6.0-20050609.i386.rpm]</td>
 
</tr>
 
</tr>
 +
</table>
  
</table>
+
 
 +
<b><em>Renesas M16C (m32c-elf-gcc)</em></b><br />
 +
http://www.eistec.se/docs/wiki/index.php?title=Mulle_software_with_GCC
  
 
<h2>Step 4: Install TinyOS toolchain</h2>
 
<h2>Step 4: Install TinyOS toolchain</h2>
  
 
The TinyOS-specific tools are the NesC compiler and a set of tools
 
The TinyOS-specific tools are the NesC compiler and a set of tools
developed in the tinyos-2.x/tools source code repository. They are
+
developed in the <code>tinyos-2.x/tools</code> source code repository. They are
also installed using rpms. If you using the Cygwin version recommended
+
also installed using rpms.
in these install
 
instructions, you should install the "Recommended" Windows/Cygwin
 
nesC RPM.
 
If you
 
get strange errors when you try to compile TinyOS programs,
 
such as the error message "the procedure entry point basename could not be located
 
in the dynamic link library cygwin1.dll", this is likely due
 
to a Cygwin version incompatibility: try the "Other" Windows/Cygwin
 
RPM (1.2.7a).
 
If you are using Cygwin and installing the nesC RPM
 
causes an error that the RPM was built for Cygwin,
 
add the <code>--ignoreos</code> option.
 
  
Finally, there are two Linux versions of tinyos-tools, depending
+
There are two Linux versions of tinyos-tools, depending
 
on whether you have a 32-bit or 64-bit machine. The first is the
 
on whether you have a 32-bit or 64-bit machine. The first is the
 
i386 RPM and the second is the i686 RPM. If you have a 64-bit
 
i386 RPM and the second is the i686 RPM. If you have a 64-bit
Line 275: Line 229:
 
<tr>
 
<tr>
 
   <td>NesC</td>
 
   <td>NesC</td>
   <td>[http://tinyos.stanford.edu/tinyos-rpms/nesc-1.3.1-1.cygwin.i386.rpm nesc-1.3.1-1.cygwin.i386.rpm] (not available yet)</td>
+
   <td>[http://tinyos.stanford.edu/tinyos-rpms/nesc-1.3.1-1.cygwin.i386.rpm nesc-1.3.1-1.cygwin.i386.rpm]</td>
 
   <td>[http://tinyos.stanford.edu/tinyos-rpms/nesc-1.3.1-1.fc9.i386.rpm nesc-1.3.1-1.fc9.i386.rpm]</td>
 
   <td>[http://tinyos.stanford.edu/tinyos-rpms/nesc-1.3.1-1.fc9.i386.rpm nesc-1.3.1-1.fc9.i386.rpm]</td>
   <td><code>rpm -Uvh</code><br/>
+
   <td><code>rpm -Uvh</code><br/><code>rpm -Uvh --ignoreos</code> (if Cygwin complains)</td>
                    <code>rpm -Uvh --ignoreos</code> (if Cygwin complains)</td>
 
 
</tr>
 
</tr>
  
 
<tr>
 
<tr>
   <td bgcolor="#dddddd"><b>Tool</b></td>
+
   <td bgcolor="#dddddd">Deputy</td>
   <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
+
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tinyos/windows/tinyos-deputy-1.1-1.cygwin.i386.rpm tinyos-deputy-1.1-1.cygwin.i386.rpm]</td>
  <td bgcolor="#dddddd"><b>Linux</b></td>
+
   <td bgcolor="#dddddd">[http://www.tinyos.net/dist-2.1.0/tinyos/linux/tinyos-deputy-1.1-1.fc9.i386.rpm tinyos-deputy-1.1-1.fc9.i386.rpm]</td>
  <td bgcolor="#dddddd"><b>Command</b></td>
+
   <td bgcolor="#dddddd"><code>rpm -i</code><br/><code>rpm -i --ignoreos</code> (if Cygwin complains)</td>
</tr>
 
 
 
<tr>
 
  <td>Deputy</td>
 
  <td>[http://www.tinyos.net/dist-2.1.0/tinyos/windows/tinyos-deputy-1.1-1.cygwin.i386.rpm tinyos-deputy-1.1-1.cygwin.i386.rpm]</td>
 
   <td>[http://www.tinyos.net/dist-2.1.0/tinyos/linux/tinyos-deputy-1.1-1.fc9.i386.rpm tinyos-deputy-1.1-1.fc9.i386.rpm]</td>
 
   <td><code>rpm -i</code><br/>
 
                    <code>rpm -i --ignoreos</code> (if Cygwin complains)</td>
 
</tr>
 
 
 
 
 
<tr>
 
 
 
  <td bgcolor="#dddddd"><b>Tool</b></td>
 
  <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
  <td bgcolor="#dddddd"><b>Linux</b></td>
 
  <td bgcolor="#dddddd"><b>Command</b></td>
 
 
</tr>
 
</tr>
  
Line 308: Line 244:
 
   <td>tinyos-tools</td>
 
   <td>tinyos-tools</td>
 
   <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.0-3.cygwin.i386.rpm tinyos-tools-1.4.0-3.cygwin.i386.rpm]</td>
 
   <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.0-3.cygwin.i386.rpm tinyos-tools-1.4.0-3.cygwin.i386.rpm]</td>
   <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.0-3.ubuntu.i386.rpm tinyos-tools-1.4.0-3.ubuntu.i386.rpm]</td>
+
   <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.0-3.ubuntu.i386.rpm tinyos-tools-1.4.0-3.ubuntu.i386.rpm]<br />
  <td><code>rpm -ivh --force</code>&nbsp;(1.x tree)<br><code>rpm -Uvh</code>&nbsp;(no 1.x tree)<br></td>
+
      [http://tinyos.stanford.edu/tinyos-rpms/tinyos-tools-1.4.2-20120807.x86_64.rpm tinyos-tools-1.4.2-20120807.x86_64.rpm]</td>
 +
  <td><code>rpm -Uvh</code><br/></td>
  
 
</tr>
 
</tr>
Line 319: Line 256:
 
<p>Now that the tools are installed, you need only install the tinyos 2.x  
 
<p>Now that the tools are installed, you need only install the tinyos 2.x  
 
source tree and then set your environment variables.
 
source tree and then set your environment variables.
Install the appropriate version of the following (Window or Linux)
 
with the rpm command 'rpm -ivh <i>rpm</i>'.
 
As with the previous rpms, if you get an error claiming that the rpm
 
was build for an NT computer and you're on a windows NT computer,
 
bypass the erroneous error by using 'rpm -ivh --ignoreos
 
<i>rpmname</i>'.
 
 
</p>
 
</p>
  
<ul>
+
<ol>
<li> Install tinyos-2.x
+
<li>Get the code from the TinyOS release repository:
 +
<pre>
 +
wget http://github.com/tinyos/tinyos-release/archive/tinyos-2_1_2.tar.gz
 +
tar xf tinyos-2_1_2.tar.gz
 +
</pre>
 +
This will extract the actual TinyOS code in a folder named <code>tinyos-release-tinyos-2_1_2</code> inside the directory the command was iussed. Feel free to rename this folder to <code>tinyos-main</code>.
 +
</li>
 +
<li>You will need to add some enviroment variables to your shell. The following file includes the necessary ones. Substitute the placeholder <code><local-tinyos-path></code> with the path where you chose to place the code in the previous section (full path recommended).
 +
<pre>
 +
# Here we setup the environment
 +
# variables needed by the tinyos
 +
# make system
  
 +
export TOSROOT="<local-tinyos-path>"
 +
export TOSDIR="$TOSROOT/tos"
 +
export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java
 +
export MAKERULES="$TOSROOT/support/make/Makerules"
 +
export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python
  
<p></p>
+
echo "setting up TinyOS on source path $TOSROOT"
<b><em>TinyOS 2.x</em></b>
 
<table border="0">
 
<tr>
 
  <td bgcolor="#dddddd"><b></b></td>
 
  <td bgcolor="#dddddd"><b>Windows/Cygwin</b></td>
 
  <td bgcolor="#dddddd"><b>Linux</b></td>
 
</tr>
 
 
 
<tr>
 
  <td>TinyOS</td>
 
 
 
  <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-2.1.1-3.cygwin.noarch.rpm tinyos-2.1.1-3.cygwin.noarch.rpm]</td>
 
  <td>[http://tinyos.stanford.edu/tinyos-rpms/tinyos-2.1.1-3.ubuntu.noarch.rpm tinyos-2.1.1-3.ubuntu.noarch.rpm]</td>
 
</tr>
 
 
 
</table></li>
 
 
 
<li> Configure your environment
 
 
 
<p>
 
Ideally, you'll put these environment variables in a shell script that will run when your shell starts, but you needn't
 
put such a script under /etc/profile.d.
 
You can use ~/.bash_profile. (in Cygwin, too)
 
</p>
 
<p>
 
The example
 
settings below assume that the tinyos-2.x installation is in /opt/tinyos-2.x.
 
Change the settings to be correct for where you've put your tinyos-2.x tree. Note
 
that the windows CLASSPATH must be a windows-style path, not a cygwin path. You can
 
generate a windows style path from a cygwin-style path using 'cygpath -w'. For example:
 
 
 
</p>
 
 
 
<pre>export CLASSPATH=`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar`
 
export CLASSPATH="$CLASSPATH;."
 
 
</pre>
 
</pre>
  
<b><em>TinyOS 2.x</em></b>
+
Suppose you named this file <code>tinyos.env</code>. There are now at least two possibilites to have these variables accessible in your shell:
<table border="0">
 
<tr>
 
  <td bgcolor="#dddddd"><b>Environment Variable</b></td>
 
  <td bgcolor="#dddddd"><b>Windows</b></td>
 
  <td bgcolor="#dddddd"><b>Linux</b></td>
 
 
 
</tr>
 
 
 
<tr>
 
  <td>TOSROOT</td>
 
  <td>/opt/tinyos-2.x</td>
 
  <td>same as in Cygwin</td>
 
<td>
 
 
 
</td></tr><tr>
 
  <td bgcolor="#dddddd">TOSDIR</td>
 
 
 
  <td bgcolor="#dddddd">$TOSROOT/tos</td>
 
  <td bgcolor="#dddddd">same as in Cygwin</td>
 
<td>
 
 
 
</td></tr><tr>
 
  <td>CLASSPATH</td>
 
  <td>C:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;.</td>
 
  <td>$TOSROOT/support/sdk/java/tinyos.jar:.</td>
 
 
 
<td>
 
 
 
</td></tr><tr>
 
  <td bgcolor="#dddddd">MAKERULES</td>
 
  <td bgcolor="#dddddd">$TOSROOT/support/make/Makerules</td>
 
  <td bgcolor="#dddddd">same as in Cygwin</td>
 
<td>
 
 
 
</td></tr><tr>
 
  <td>PATH<font color="red">&#8224;</font></td>
 
 
 
  <td>/opt/msp430/bin:/opt/jflashmm:$PATH</td>
 
  <td>same as in Cygwin</td>
 
<td>
 
 
 
</td></tr></table>
 
 
 
<i><font color="red">&#8224;</font>Only necessary if you're using MSP430 or iMote2 platform/tools.</i>
 
 
 
<p>
 
In addition to the above environment variables, do the following on Linux machines:
 
</p>
 
 
 
 
<ol>
 
<ol>
<li> Change the ownership on your /opt/tinyos-2.x files: <code>chown -R&nbsp;&lt;your uid&gt;&nbsp;/opt/tinyos-2.x
+
<li>Place it as root user in <code>/etc/profile.d/</code></li>
</code></li>
+
<li>Place it in <code><local-tinyos-path></code> and add the following line to your <code>.bashrc</code><br>
<li> Change the permissions on any serial (/dev/ttyS&lt;N&gt;), usb
+
<pre>source <local-tinyos-path>/tinyos.env</pre>
(/dev/tts/usb&lt;N&gt;, /dev/ttyUSB&lt;N&gt;), or parallel (/dev/parport) devices you
+
</li>
are going to use: <code>chmod 666 /dev/&lt;devicename&gt;</code></li>
 
 
 
 
</ol>
 
</ol>
 +
You can also add the contents of the file directly to the .bashrc.<br>
 +
To make the changes work, the easiest way is to open a new terminal window.<br>
 
</li>
 
</li>
 
+
<li>In order to program motes you will need to access the serial ports. This can be done by joining the group that grants this privilege.
</li></ul>
+
  sudo gpasswd -a <your-user> dialout
 +
This change only takes effect when log out and log in again.
 +
</li>
 +
</ol>
  
 
<h2>Step 5b (optional): Post-install fixes in Windows/Cygwin environment</h2>
 
<h2>Step 5b (optional): Post-install fixes in Windows/Cygwin environment</h2>

Latest revision as of 23:01, 25 May 2013

Manual installation on your host OS with RPMs

Currently, the TinyOS Core Working Group supports TinyOS on two platforms: Cygwin (Windows) and Linux. There have been some successful efforts to getting TinyOS environments working on Mac OSX, but OSX is not supported by the Core WG.

Installing a TinyOS enviromnent has five basic steps; Windows requires an extra step, installing Cygwin, which is a UNIX-like environment. The steps are:

  1. Installing a Java JDK. Java is the most common way of interacting with mote base stations or gateways that are plugged into a PC or laptop.
  2. Windows only. Install Cygwin. This gives you a shell and many UNIX tools which the TinyOS environment uses, such as perl and shell scripts.
  3. Installing native compilers. As you're compiling code for low-power microcontrollers, you need compilers that can generate the proper assembly code. If you using mica-family motes, you need the AVR toolchain; if you're using telos-family motes, you need the MSP430 toolchain.
  4. Installing the nesC compiler. TinyOS is written in nesC, a dialect of C with support for the TinyOS concurrency model and component-based programming. The nesC compiler is platform-independent: it passes its output to the native compilers, so that it can take advantage of all of the effort put into their optimizations.
  5. Installing the TinyOS source tree. If you want to compile and install TinyOS programs, you need the code.
  6. Installing the Graphviz visualization tool. The TinyOS environment includes nesdoc, a tool that automatically generates HTML documentation from source code. Part of this process involves drawing diagrams that show the relationships between different TinyOS components. Graphviz is an open source tool that nesdoc uses to draw the diagrams.

Step 1: Install Java JDK

Download and install Sun's JDK from http://java.sun.com.

Step 2: Install Cygwin

This step is required for Windows installations only. If you are installing on Linux, skip to step 3.

  1. Download setup.exe and run it to install Cygwin.
  2. When the window pops up to allow you to select what packages to install, be sure to select:
    • rpm
    • make
    • perl
    • python

Step 3: Install native compilers

Install the appropriate compiler based on your hardware and operating system.

Atmel AVR Tools

Tool Windows/Cygwin Linux Command
avr-binutils avr-binutils-2.17tinyos-3.cygwin.i386.rpm avr-binutils-2.17tinyos-3.i386.rpm rpm -ivh
rpm -ivh --ignoreos (if Cygwin complains)
avr-gcc avr-gcc-4.1.2-1.cygwin.i386.rpm avr-gcc-4.1.2-1.i386.rpm
avr-libc avr-libc-1.4.7-1.cygwin.i386.rpm avr-libc-1.4.7-1.i386.rpm
avarice avarice-2.4-1.cygwin.i386.rpm avarice-2.4-1.i386.rpm
insight (avr-gdb) avr-insight-6.3-1.cygwin.i386.rpm avr-insight-6.3-1.i386.rpm
avrdude†† avrdude-tinyos-5.6cvs-1.cygwin.i386.rpm avrdude-tinyos-5.6cvs-1.i386.rpm

If you receive an rpm error that indicates that you have a newer version already installed, try rpm -Uvh --force
††If you receive an rpm error that indicates that you are missing /bin/sh, try rpm -Uvh --force --nodeps


PXA27x Tools (iMote2)

Tool Windows/Cygwin Linux Command
xscale-elf-binutils xscale-elf-binutils-2.15tinyos-1.cygwin.i386.rpm xscale-elf-binutils-2.15-2.i386.deb rpm -ivh
rpm -ivh --ignoreos (if Cygwin complains)
xscale-elf-gcc xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm xscale-elf-gcc-3.4.3-2.i386.deb
xscale-elf-newlibc xscale-elf-newlib-1.11.0tinyos-1.cygwin.i386.rpm xscale-elf-newlib-1.13.0-1.i386.deb
jtag jflashmm.tgz†† OpenOCD toolchain

Newer versions of GCC can be installed in certain cases. For further info see section iMote2 Compiler from this wiki.

††Copy jflashmm.tgz to /opt directory, untar it (tar xzf jflashmm.tgz), and make sure it's on your path (see Step 5). If the download link above doesn't work, try the cvs.


TI MSP430 Tools

...wow this is outdated. Don't use any of this. Use the debian packages or install from source. See the packaging folder in tinyos-main.

Tool Windows/Cygwin Linux Command
base msp430tools-base-0.1-20050607.cygwin.i386.rpm msp430tools-base-0.1-20050607.i386.rpm rpm -ivh
rpm -ivh --ignoreos (if Cygwin complains)
python tools msp430tools-python-tools-1.0-1.cygwin.noarch.rpm msp430tools-python-tools-1.0-1.noarch.rpm
binutils msp430tools-binutils-2.16-20050607.cygwin.i386.rpm msp430tools-binutils-2.16-20050607.i386.rpm
gcc msp430tools-gcc-3.2.3-20050607.cygwin.i386.rpm msp430tools-gcc-3.2.3-20050607.i386.rpm
libc msp430tools-libc-20080808-1.cygwin.i386.rpm msp430tools-libc-20080808-1.i386.rpm
jtag [1]Not yet available msp430tools-jtag-lib-20031101cvs-20050610.i386.rpm
gdb [2]Not yet available msp430tools-gdb-6.0-20050609.i386.rpm


Renesas M16C (m32c-elf-gcc)
http://www.eistec.se/docs/wiki/index.php?title=Mulle_software_with_GCC

Step 4: Install TinyOS toolchain

The TinyOS-specific tools are the NesC compiler and a set of tools developed in the tinyos-2.x/tools source code repository. They are also installed using rpms.

There are two Linux versions of tinyos-tools, depending on whether you have a 32-bit or 64-bit machine. The first is the i386 RPM and the second is the i686 RPM. If you have a 64-bit Java VM, it is important that you install the i686 RPM or otherwise the Java support may not work properly.

TinyOS-specific Tools

Tool Windows/Cygwin Linux Command
NesC nesc-1.3.1-1.cygwin.i386.rpm nesc-1.3.1-1.fc9.i386.rpm rpm -Uvh
rpm -Uvh --ignoreos (if Cygwin complains)
Deputy tinyos-deputy-1.1-1.cygwin.i386.rpm tinyos-deputy-1.1-1.fc9.i386.rpm rpm -i
rpm -i --ignoreos (if Cygwin complains)
tinyos-tools tinyos-tools-1.4.0-3.cygwin.i386.rpm tinyos-tools-1.4.0-3.ubuntu.i386.rpm
tinyos-tools-1.4.2-20120807.x86_64.rpm
rpm -Uvh

Step 5: Install the TinyOS 2.x source tree

Now that the tools are installed, you need only install the tinyos 2.x source tree and then set your environment variables.

  1. Get the code from the TinyOS release repository:
    wget http://github.com/tinyos/tinyos-release/archive/tinyos-2_1_2.tar.gz
    tar xf tinyos-2_1_2.tar.gz
    

    This will extract the actual TinyOS code in a folder named tinyos-release-tinyos-2_1_2 inside the directory the command was iussed. Feel free to rename this folder to tinyos-main.

  2. You will need to add some enviroment variables to your shell. The following file includes the necessary ones. Substitute the placeholder <local-tinyos-path> with the path where you chose to place the code in the previous section (full path recommended).
    # Here we setup the environment
    # variables needed by the tinyos 
    # make system
    
    export TOSROOT="<local-tinyos-path>"
    export TOSDIR="$TOSROOT/tos"
    export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java
    export MAKERULES="$TOSROOT/support/make/Makerules"
    export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python
    
    echo "setting up TinyOS on source path $TOSROOT"
    

    Suppose you named this file tinyos.env. There are now at least two possibilites to have these variables accessible in your shell:

    1. Place it as root user in /etc/profile.d/
    2. Place it in <local-tinyos-path> and add the following line to your .bashrc
      source <local-tinyos-path>/tinyos.env

    You can also add the contents of the file directly to the .bashrc.
    To make the changes work, the easiest way is to open a new terminal window.

  3. In order to program motes you will need to access the serial ports. This can be done by joining the group that grants this privilege. sudo gpasswd -a <your-user> dialout This change only takes effect when log out and log in again.

Step 5b (optional): Post-install fixes in Windows/Cygwin environment

If you later experience problems when building some tutorials, running Java tools, ... see Geoffrey Lo's excellent blog post, especially step 2.

Step 6: Installing Graphviz

Go to download page of the Graphviz project and download the appropriate RPM. You only need the basic graphviz RPM (graphviz-); you don't need all of the add-ons, such as -devel, -doc, -perl, etc. If you're not sure what version of Linux you're running,

uname -a

might give you some useful information. Install the rpm with rpm -i rpm-name. In the case of Windows, there is a simple install program, so you don't need to deal with RPMs.

you may need to download graphviz 1.1.0 here