Difference between revisions of "Automatic installation for ubuntu using the tinyprod repository"

From TinyOS Wiki
Jump to: navigation, search
 
Line 1: Line 1:
<p>With Ubuntu you have the possibility for a relative hassle-free installation by using the repository from the [https://github.com/tinyprod tinyprod] project. In particular, it provides the toolchain, while the TinyOS code can be obtained from somewhere else.</p>
+
<p>With Debian based systems (like Ubuntu) you have the possibility for a relative hassle-free installation by using the repository from the [https://github.com/tinyprod tinyprod] project for the toolchain installation. The TinyOS code ifself is obtained from the official github.</p>
<p>You can also use this guide to install TinyOS on VM of your choice, as long as the installed system is Ubuntu.</p>
+
<p>You can also use this guide to install TinyOS on a virtual machine of your choice, as long as the installed system is compatible with the packages.</p>
  
 
==Installation==
 
==Installation==
  
1) First follow the [http://tinyprod.net/debian-dev/ guide by Eric Decker] to install the toolchain. You will need to have gpg installed (which is quite likely already included in your distribution).<br>
+
1) Follow the [http://tinyprod.net/debian-dev/ guide by Eric Decker] to install the toolchain from the tinyprod repository. You will need to have gpg installed (which is quite likely already included in your distribution).<br>
 
<br>
 
<br>
2) Get the code from the official svn (subversion is required):
+
2) Get the code from the main branch (git is required):
   svn co http://tinyos-main.googlecode.com/svn/trunk/ <local-tinyos-path>
+
   git clone https://github.com/tinyos/tinyos-main.git
<code><local-tinyos-path></code> is the folder that will contain all the TinyOS code.<br>
+
This will check out the actual TinyOS code in a folder named <code>tinyos-main</code> inside the directory the command was iussed.<br>
 
<br>
 
<br>
3) You will need to add some enviroment variables to your shell. The following file includes the necessary ones. Of course the placeholder <code><local-tinyos-path> </code> has to be replaced by the actual path where you chose to place the code in the last section.<br>
+
3) You will need to add some enviroment variables to your shell. The following file includes the necessary ones.The placeholder <code><local-tinyos-path> </code> has to be replaced with the path where you chose to place the code in the last section.<br>
 
<pre>
 
<pre>
 
# Here we setup the environment
 
# Here we setup the environment
Line 26: Line 26:
  
 
Suppose you named this file <code>tinyos.env</code>. There are now at least two possibilites to have these variables accessible in your shell:<br>
 
Suppose you named this file <code>tinyos.env</code>. There are now at least two possibilites to have these variables accessible in your shell:<br>
a) Place it in <code><local-tinyos-path></code> and add the following line to your <code>.bashrc</code><br>
+
a) Place it as root user in <code>/etc/profile.d/</code><br>
 +
b) Place it in <code><local-tinyos-path></code> and add the following line to your <code>.bashrc</code><br>
 
   source <local-tinyos-path>/tinyos.env
 
   source <local-tinyos-path>/tinyos.env
b) Place it as root user in <code>/etc/profile.d/</code>.<br>
+
You can also directly 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>
 
To make the changes work, the easiest way is to open a new terminal window.<br>
 
<br>
 
<br>
Line 36: Line 37:
  
 
Now you should have everything needed to get started. This guide should work on  
 
Now you should have everything needed to get started. This guide should work on  
all Ubuntu and Debian based on Squeeze. Has only been tested on Ubuntu though.
+
all Ubuntu and Debian based on Squeeze. It has only been tested on Ubuntu though.

Latest revision as of 07:34, 19 April 2013

With Debian based systems (like Ubuntu) you have the possibility for a relative hassle-free installation by using the repository from the tinyprod project for the toolchain installation. The TinyOS code ifself is obtained from the official github.

You can also use this guide to install TinyOS on a virtual machine of your choice, as long as the installed system is compatible with the packages.

Installation

1) Follow the guide by Eric Decker to install the toolchain from the tinyprod repository. You will need to have gpg installed (which is quite likely already included in your distribution).

2) Get the code from the main branch (git is required):

 git clone https://github.com/tinyos/tinyos-main.git

This will check out the actual TinyOS code in a folder named tinyos-main inside the directory the command was iussed.

3) You will need to add some enviroment variables to your shell. The following file includes the necessary ones.The placeholder <local-tinyos-path> has to be replaced with the path where you chose to place the code in the last section.

# 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:
a) Place it as root user in /etc/profile.d/
b) Place it in <local-tinyos-path> and add the following line to your .bashrc

 source <local-tinyos-path>/tinyos.env

You can also directly 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.

4) 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.

Now you should have everything needed to get started. This guide should work on all Ubuntu and Debian based on Squeeze. It has only been tested on Ubuntu though.