Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip
titleOops!

Before you can go on, you need to install Python:

  • Download Python 2.7.x from https://www.python.org/ (NOT Python 3!)

    Warning

    At the time of writing, Python 2.7.10 was just released. It doesn't work for compiling the OpenWSN code in emulation mode, for the reasons detailed in http://comments.gmane.org/gmane.comp.python.cython.user/13394.

    At the time of writing, we recommend you use Python 2.7.9.

    Let's hope Python 2.7.11 fixes this bug. If you read this and Python 2.7.11 was already released and works, please edit this page, or leave a comment at the bottom.

  • Add the following directories to your PATH environment variable:
    • C:\Python27
    • C:\Python27\Scripts
  • Verify you can call python:

    Code Block
    languagebash
    C:\Users\Thomas>python --version
    Python 2.7.10
  • Install pywin32, an extension for WIndows. You will need it to interact with the TAP virtual interface
  • Install the OpenWSN Python dependencies (from the openwsn-sw\ directory on your Desktop):

    Code Block
    languagebash
    C:\Users\Thomas\Desktop\openwsn-sw> pip install -r requirements.txt
  • Install SCons, the build environment:

    Code Block
    languagebash
    C:\Users\Thomas\Desktop\openwsn-sw> pip install --egg scons

...

Code Block
languagebash
C:\Users\Thomas\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
[...]
gcc -shared -o firmware\openos\projects\common\oos_openwsn.pyd firmware\openos\projects\common\03oos_openwsn\03oos_openw
sn_obj.o firmware\openos\bsp\boards\python\openwsnmodule_obj.o -LC:\Python27\libs -Lbuild\python_gcc\bsp\boards\python -
Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\drivers -Lbuild\python_gcc\openwsn -lopenstack -lopenos -ldrivers -lb
sp -lpython27 -Wl,--out-implib,firmware\openos\projects\common\liboos_openwsn.a
scons: done building targets.
Expand
titleclick here for full output...

 

 

This step compile the complete OpenWSN firmware as a Python extension module (a form of shared library) which the simulation environment can import at run-time.

...