0

I have install tinyos on a raspberry pi3 successfully, but had many problems: 1-when make any application other than the tinyos apps like Blink i have the following error:

/root/tinyos-main/support/make/Makerules:56:  Old TinyOS environment variables detected.

while in Blink it run sucessfully 2- when run a python program with "import tos" like

import tos
 a=1
 b=2
 c=a+b

i had an error like Traceback (most recent call last):

File "ali.py", line 1, in <module>
    import tos
ImportError: No module named tos

i think i had a problem with setting of the path

3 Answers3

0

you need to download the package tinyos

Extract the package using tar

tar -xzvf package_name

cd into the extracted directory then:

sudo python setup.py install

Hackaholic
  • 19,069
  • 5
  • 54
  • 72
  • thank you, i did this but still the same problem. is the following path correct: export TOSROOT="~/tinyos-main" export TOSDIR="$TOSROOT/tos" export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:. export MAKERULES="$TOSROOT/support/make/Makerules" export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python – Ali H. Hamad Apr 21 '17 at 17:54
0

OP can you confirm, are you getting a warning or an error? I looked in TinyOS makerules and it says that the message you quoted is just a warning about deprecated variables and it can removed by setting the TINYOS_NO_DEPRECATION_WARNING environmental variable. Excerpt from the makerules below

ifndef TINYOS_NO_DEPRECATION_WARNING
define MAKE_VERSION_TWO_WARNING
$(WARN_STRING) Old TinyOS environment variables detected.

    This version of the TinyOS make system has deprecated the TOSDIR, TOSROOT,
    and MAKERULES environment variables. Generally, you shouldnt need
    environment variables with this version of the TinyOS make system, and if
    you are not using any older versions of TinyOS on your system you should
    delete these environment variables. If you wish to leave these variables
    but hide this warning, set the TINYOS_NO_DEPRECATION_WARNING environment
    variable. If you are looking to compile against a different TinyOS tree,
    configure the makefiles used when compiling, or setup an external TinyOS
    tree with additional source files, please visit
    https://github.com/tinyos/tinyos-main/blob/master/support/make/README.md
    for more information about the TinyOS make system.

endef
KillaKem
  • 995
  • 1
  • 13
  • 29
0

The warning for old environment is not critical.

For your question, please add the python SDK path to ~/.bashrc and then try from tinyos import tos rather than import tos.

Yaoshicn
  • 144
  • 9