0

I have to use TinyOS for my small project, so I installed TinyOS in my Ubuntu 14.04 64-bit. Basically, I followed the instructions from Saeid in his YouTube video, TinyOS Tutorial #1 - How to install TinyOS on Ubuntu, however I got the following problems:

  1. After installing TinyOS, I got the following error message:

    Errors were encountered while processing: 
     /var/cache/apt/archives/tinyos-tools_1.4.2-tinyprod1_amd64.deb 
     /var/cache/apt/archives/msp430-binutils-tinyos_2.21.1-20110821_amd64.deb 
     /var/cache/apt/archives/msp430-gcc-tinyos_4.5.3-20110821_amd64.deb 
     /var/cache/apt/archives/msp430-libc-tinyos_20110612-20110821_amd64.deb 
     /var/cache/apt/archives/msp430mcu-tinyos_20110613-20110821_amd64.deb 
    E: Sub-process /usr/bin/dpkg returned an error code (1) 
    

    In the YouTube video, Saeid said that if there are some errors while installation, in the sources.list file add the following:

    deb http://tinyos.stanford.edu/tinyos/dists/ubuntu kramic main  
    

    instead of

    deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main  
    

    I did, but it also does not work.

  2. I made tinyos.sh file as the instruction in YouTube. There is tinyos.sh in my tinyos-release-tinyos-2_1_2 folder, but I got the following error whenever I open a new terminal:

    bash: /opt/tinyos-release-tinyos-2_1_2/tinyos.sh: No such file or directory 
    
  3. After sudo gedit ~/.bashrc, I do source ~/.bashrc as in instruction, but source ~/.bashrc never works with me.

  4. In bashrc file, I add TOSROOT, TOSDIR, CLASSPATH, MAKERULES the same as in the instructions. Then it seems to be not working. When I did cd TOSROOT in /opt/tinyos-release-tinyos-2_1_2, I got the following error:

    bash: cd: /opt/tinyos-release-tinyos-2_1_2: No such file or directory 
    

Because of that, I cannot move to further steps. Also, I could not reinstall tinyos-2.1.2 to reinstall. When I did sudo apt-get remove tinyos-2.1.2 I got the following errors:

You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies: 
 deputy-tinyos : Depends: tinyos-tools but it is not going to be installed 
 msp430-tinyos : Depends: msp430-binutils-tinyos but it is not going to be installed 
                 Depends: msp430-gcc-tinyos but it is not going to be installed 
                 Depends: msp430-libc-tinyos but it is not going to be installed 
                 Depends: msp430mcu-tinyos but it is not going to be installed 
 tinyos-required-avr : Depends: tinyos-tools but it is not going to be installed 
 tinyos-required-msp430 : Depends: tinyos-tools but it is not going to be installed 
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

2

Install TinyOS in Ubuntu 14.04

  1. Visit TinyOS (TinyProd) Debian Development Repository and follow these instructions:

    1. Tell apt about the TinyProd Signing Key.

      wget -O - http://tinyprod.net/repos/debian/tinyprod.key | sudo apt-key add -
      
    2. Add the two new lines to /etc/apt/sources.list.d/tinyprod-debian.list:

      sudo -s
      cd /etc/apt/sources.list.d
      echo "deb http://tinyprod.net/repos/debian wheezy main" >> tinyprod-debian.list
      echo "deb http://tinyprod.net/repos/debian msp430-46 main" >> tinyprod-debian.list
      
    3. Install the new packages:

      sudo apt-get update  
      sudo apt-get install nesc tinyos-tools  
      

      I didn't install either msp430-46 or avr-tinyos at this step, in case you want to install them later after you have tested your TinyOS installation.

  2. 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 issued. Feel free to rename this folder to tinyos-main.

  3. You will need to add some environment variables to your shell. The following file includes the necessary ones. Substitute the placeholder 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 possibilities 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  
      

After the TinyOS installation is finished, you can check if it is successful by executing some of these commands:

tos-bsl                 tos-ident-flags         tos-serial-debug
tos-build-deluge-image  tos-install-jni         tos-set-symbols
tos-channelgen          tos-locate-jre          tos-storage-at45db
tos-check-env           tos-mote-key            tos-storage-pxa27xp30
tos-decode-flid         tos-mviz                tos-storage-stm25p
tos-deluge              tos-ramsize             tos-write-buildinfo
tos-dump.py             tos-serial-configure    tos-write-image

These instructions were copied from Automatic installation - TinyOS Wiki and executed successfully on Ubuntu 14.04 running in VirtualBox. I did all this because the commands in the tutorial in your question have at least one error.

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu kramic main 

should be:

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu karmic main

And the tutorial in your question may be obsolete because it is so out-of-date. The other reason is that I estimate that it would take me an entire day to type all the commands in the YouTube video and run them one at a time, so I copy/pasted the instructions from the TinyOS wiki in the terminal to save time.

karel
  • 122,292
  • 133
  • 301
  • 332