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).
  • Here is the link I followed to install tinyos: – Thuy Dinh Jul 17 '16 at 6:29
  • What link? You didn't give any link. Neither does the TinyOS Documentation wiki which hasn't been updated for a while. There are several broken links there. – karel Jul 17 '16 at 7:25
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.

  • Thank you very much for your answer. Actually, I am just a beginner. In your step 2, after adding 2 last rows in sources.list.d, I got the following errors:E: Type 'echo' is not known on line 3 in source list /etc/apt/sources.list.d/tinyprod-debian.list E: The list of sources could not be read. Any suggestions? Thank you very much – Thuy Dinh Jul 20 '16 at 18:16
  • One more question please. In step 2, should I add in /etc/apt/sources.list.d/tinyprod-debian.list or in ~.bashrc file? The first option does not work out. – Thuy Dinh Jul 20 '16 at 18:22
  • Therefore, I added them in bashrc and went to step 3. Then, I got the following error msg: You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: 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 E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)." – Thuy Dinh Jul 20 '16 at 18:26
  • 1. How did you write the echo part in tinyprod-debian.list? The two new lines are supposed to be deb http://tinyprod.net/repos/debian wheezy main and deb http://tinyprod.net/repos/debian msp430-46 main. 2. I wrote that I didn't install msp430-46 in step 3. This was because of unmet dependencies, so you should skip installing msp430-46, the same as I did. – karel Jul 20 '16 at 19:04
  • I use root to write echo in tinyprod-debian.list – Thuy Dinh Jul 21 '16 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.