Page tree
Skip to end of metadata
Go to start of metadata

If you are completely new to OpenWSN, and you are using Windows, read this page first. It will walk you through all the steps to install OpenWSN and explore a number of key features.

In particular you will:

  • compile and run OpenWSN in simulation mode, ping a simulated mote, and interact with it over CoAP.
  • program a TelosB mote, connect it to your computer, ping it, and interact with it over CoAP.

What to bring?

  • a computer running Windows. This page is written with Windows 7 Professional.
  • optionally, two TelosB motes to play with real hardware.

At the time of writing, we are using the latest and greatest of all software. Undoubtedly, this will become outdated very fast. If you see something out of the date, take action! Send an e-mail to Tengfei Chang or Thomas Watteyne to get this page update. Thanks!

During this tutorial, you will be installing a number of tools (python, pywin32, mingw). We recommend you install the 32-bit version of all of these tools, even you have a 64-bit machine.

Download OpenWSN

OpenWSN is a collection of repositories hosted on GitHub. We will download and use the following:

Oops!

Before you can go on, you need to install a Git client. Any client will do, but we will use tortoisegit.

Once you've installed it, it will integrate nicely with your Windows explorer.

We will download these repositories side-by-side on your desktop using Git:

You now have:

At any time you can make sure you are running the latest code by right-clicking on each folder, and choosing Git Pull....

Running a simulation

Frankly, it's a bit strange to start using OpenWSN with a simulation, since the firmware is really meant (and written) to run on real motes. But, not everyone has hardware, not always the same hardware, etc. So to make things nice and easy, we'll start by simulation. Oh, and the simulated code behaves exactly the same as the real code, so what you see now is what you'll get with real hardware.

Prepare

Before we can start running a simulation, we need to compile the firmware as a Python extension. This is all explained in the OpenSim page if you want to know what's going on.

Oops!

Before you can go on, you need to install mingw, which gives you all of the build tools to build the firmware:

  • Download from http://www.mingw.org/

    If you're as lazy as we are, you can just follow the "Looking for the latest version? Download mingw-get-setup.exe" link at the top of http://sourceforge.net/projects/mingw/files/.

  • Use the following installation options:
    • Install at C:\MingGW\
    • Mark the following packages for installation:
      • ming32-base
      • msys-base
    • Select "Installation > Apply Changes" to download and install those packages. This will download and install the packages.
  • Add C:\MinGW\bin to your PATH environment variable
  • Verify you can call the gcc command:

    C:\Users\Thomas>gcc --version
    gcc (GCC) 4.8.1
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Oops!

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

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

    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:

    C:\Users\Thomas>python --version
    Python 2.7.9
  • Install pywin32, an extension for Windows. You will need it to interact with the TAP virtual interface
  • Install the Microsoft Visual C++ for Windows. You will need it to compile the yappi module which will be installed with pip at next
  • Install the OpenWSN Python dependencies (from the openwsn-sw\ directory on your Desktop):

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

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

    If you have any problem with the installation of SCons, try the following command

    pip install --index-url=http://pypi.python.org/simple --trusted-host pypi.python.org --egg scons

To compile the firmware as a Python extension module, type:

C:\Users\Thomas\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
[...]
Archiving          build\python_gcc\bsp\boards\libbsp.a
Indexing           build\python_gcc\bsp\boards\libbsp.a
gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03o
os_openwsn\03oos_openwsn_obj.o build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -L
C:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\d
rivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldr
ivers -lbsp -lpython27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
scons: done building targets.
 click here for full output...
C:\Users\Thomas\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
scons: done reading SConscript files.
scons: Building targets ...
Objectifying       build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn.c -> 03oos_openwsn_obj.c
Objectifying       build\python_gcc\bsp\boards\board.h -> board_obj.h
Objectifying       build\python_gcc\inc\opendefs.h -> opendefs_obj.h
Objectifying       build\python_gcc\openstack\openstack.h -> openstack_obj.h
Objectifying       build\python_gcc\kernel\scheduler.h -> scheduler_obj.h
Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.h -> adaptive_sync_obj.h
Objectifying       build\python_gcc\openapps\c6t\c6t.h -> c6t_obj.h
Objectifying       build\python_gcc\openapps\cexample\cexample.h -> cexample_obj.h
Objectifying       build\python_gcc\openapps\cinfo\cinfo.h -> cinfo_obj.h
Objectifying       build\python_gcc\openapps\cleds\cleds.h -> cleds_obj.h
Objectifying       build\python_gcc\openapps\cstorm\cstorm.h -> cstorm_obj.h
Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.h -> cwellknown_obj.h
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.h -> icmpv6echo_obj.h
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.h -> icmpv6rpl_obj.h
Objectifying       build\python_gcc\openstack\cross-layers\idmanager.h -> idmanager_obj.h
Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.h -> IEEE802154E_obj.h
Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.h -> neighbors_obj.h
Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.h -> opencoap_obj.h
Objectifying       build\python_gcc\openstack\cross-layers\openqueue.h -> openqueue_obj.h
Objectifying       build\python_gcc\openstack\cross-layers\openrandom.h -> openrandom_obj.h
Objectifying       build\python_gcc\drivers\common\openserial.h -> openserial_obj.h
Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.h -> opentcp_obj.h
Objectifying       build\python_gcc\drivers\common\opentimers.h -> opentimers_obj.h
Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.h -> processIE_obj.h
Objectifying       build\python_gcc\openapps\rrt\rrt.h -> rrt_obj.h
Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.h -> schedule_obj.h
Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.h -> sixtop_obj.h
Objectifying       build\python_gcc\openapps\techo\techo.h -> techo_obj.h
Objectifying       build\python_gcc\openapps\uecho\uecho.h -> uecho_obj.h
Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.h -> IEEE802154_obj.h
Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o
Copy("build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c", "bsp\boards\python\openwsnmodule.c")
Objectifying       build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c -> openwsnmodule_obj.c
Objectifying       build\python_gcc\bsp\boards\bsp_timer.h -> bsp_timer_obj.h
Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o
Objectifying       build\python_gcc\openstack\openstack.c -> openstack_obj.c
Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.h -> forwarding_obj.h
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.h -> icmpv6_obj.h
Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.h -> iphc_obj.h
Objectifying       build\python_gcc\openapps\openapps.h -> openapps_obj.h
Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.h -> openbridge_obj.h
Objectifying       build\python_gcc\openstack\04-TRAN\openudp.h -> openudp_obj.h
Compiling          build\python_gcc\openstack\openstack_obj.o
Objectifying       build\python_gcc\openstack\02a-MAClow\topology.c -> topology_obj.c
Objectifying       build\python_gcc\openstack\02a-MAClow\topology.h -> topology_obj.h
Compiling          build\python_gcc\openstack\02a-MAClow\topology_obj.o
Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.c -> IEEE802154_obj.c
Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.h -> packetfunctions_obj.h
Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154_obj.o
Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.c -> IEEE802154E_obj.c
Objectifying       build\python_gcc\bsp\boards\debugpins.h -> debugpins_obj.h
Objectifying       build\python_gcc\bsp\boards\leds.h -> leds_obj.h
Objectifying       build\python_gcc\bsp\boards\radiotimer.h -> radiotimer_obj.h
Objectifying       build\python_gcc\bsp\boards\radio.h -> radio_obj.h
Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154E_obj.o
Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.c -> adaptive_sync_obj.c
Compiling          build\python_gcc\openstack\02a-MAClow\adaptive_sync_obj.o
Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.c -> neighbors_obj.c
Compiling          build\python_gcc\openstack\02b-MAChigh\neighbors_obj.o
Objectifying       build\python_gcc\openstack\02b-MAChigh\otf.c -> otf_obj.c
Objectifying       build\python_gcc\openstack\02b-MAChigh\otf.h -> otf_obj.h
Compiling          build\python_gcc\openstack\02b-MAChigh\otf_obj.o
Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.c -> processIE_obj.c
Compiling          build\python_gcc\openstack\02b-MAChigh\processIE_obj.o
Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.c -> schedule_obj.c
Compiling          build\python_gcc\openstack\02b-MAChigh\schedule_obj.o
Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.c -> sixtop_obj.c
Compiling          build\python_gcc\openstack\02b-MAChigh\sixtop_obj.o
Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.c -> iphc_obj.c
Compiling          build\python_gcc\openstack\03a-IPHC\iphc_obj.o
Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.c -> openbridge_obj.c
Compiling          build\python_gcc\openstack\03a-IPHC\openbridge_obj.o
Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.c -> forwarding_obj.c
Compiling          build\python_gcc\openstack\03b-IPv6\forwarding_obj.o
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.c -> icmpv6_obj.c
Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6_obj.o
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.c -> icmpv6echo_obj.c
Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6echo_obj.o
Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.c -> icmpv6rpl_obj.c
Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6rpl_obj.o
Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.c -> opencoap_obj.c
Compiling          build\python_gcc\openstack\04-TRAN\opencoap_obj.o
Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.c -> opentcp_obj.c
Compiling          build\python_gcc\openstack\04-TRAN\opentcp_obj.o
Objectifying       build\python_gcc\openstack\04-TRAN\openudp.c -> openudp_obj.c
Objectifying       build\python_gcc\openapps\uinject\uinject.h -> uinject_obj.h
Compiling          build\python_gcc\openstack\04-TRAN\openudp_obj.o
Objectifying       build\python_gcc\openstack\cross-layers\idmanager.c -> idmanager_obj.c
Objectifying       build\python_gcc\bsp\boards\eui64.h -> eui64_obj.h
Compiling          build\python_gcc\openstack\cross-layers\idmanager_obj.o
Objectifying       build\python_gcc\openstack\cross-layers\openqueue.c -> openqueue_obj.c
Compiling          build\python_gcc\openstack\cross-layers\openqueue_obj.o
Objectifying       build\python_gcc\openstack\cross-layers\openrandom.c -> openrandom_obj.c
Compiling          build\python_gcc\openstack\cross-layers\openrandom_obj.o
Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.c -> packetfunctions_obj.c
Compiling          build\python_gcc\openstack\cross-layers\packetfunctions_obj.o
Archiving          build\python_gcc\openstack\libopenstack.a
Indexing           build\python_gcc\openstack\libopenstack.a
Objectifying       build\python_gcc\openapps\openapps.c -> openapps_obj.c
Compiling          build\python_gcc\openapps\openapps_obj.o
Objectifying       build\python_gcc\openapps\c6t\c6t.c -> c6t_obj.c
Compiling          build\python_gcc\openapps\c6t\c6t_obj.o
Objectifying       build\python_gcc\openapps\cexample\cexample.c -> cexample_obj.c
Compiling          build\python_gcc\openapps\cexample\cexample_obj.o
Objectifying       build\python_gcc\openapps\cinfo\cinfo.c -> cinfo_obj.c
Compiling          build\python_gcc\openapps\cinfo\cinfo_obj.o
Objectifying       build\python_gcc\openapps\cleds\cleds.c -> cleds_obj.c
Compiling          build\python_gcc\openapps\cleds\cleds_obj.o
Objectifying       build\python_gcc\openapps\cstorm\cstorm.c -> cstorm_obj.c
Compiling          build\python_gcc\openapps\cstorm\cstorm_obj.o
Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.c -> cwellknown_obj.c
Compiling          build\python_gcc\openapps\cwellknown\cwellknown_obj.o
Objectifying       build\python_gcc\openapps\rrt\rrt.c -> rrt_obj.c
Compiling          build\python_gcc\openapps\rrt\rrt_obj.o
Objectifying       build\python_gcc\openapps\techo\techo.c -> techo_obj.c
Compiling          build\python_gcc\openapps\techo\techo_obj.o
Objectifying       build\python_gcc\openapps\uecho\uecho.c -> uecho_obj.c
Compiling          build\python_gcc\openapps\uecho\uecho_obj.o
Objectifying       build\python_gcc\openapps\uinject\uinject.c -> uinject_obj.c
Compiling          build\python_gcc\openapps\uinject\uinject_obj.o
Archiving          build\python_gcc\openapps\libopenapps.a
Indexing           build\python_gcc\openapps\libopenapps.a
Objectifying       build\python_gcc\kernel\openos\scheduler.c -> scheduler_obj.c
Compiling          build\python_gcc\kernel\openos\scheduler_obj.o
Archiving          build\python_gcc\kernel\openos\libkernel.a
Indexing           build\python_gcc\kernel\openos\libkernel.a
Objectifying       build\python_gcc\drivers\common\openhdlc.c -> openhdlc_obj.c
Objectifying       build\python_gcc\drivers\common\openhdlc.h -> openhdlc_obj.h
Compiling          build\python_gcc\drivers\common\openhdlc_obj.o
Objectifying       build\python_gcc\drivers\common\opensensors.c -> opensensors_obj.c
Objectifying       build\python_gcc\drivers\common\opensensors.h -> opensensors_obj.h
Compiling          build\python_gcc\drivers\common\opensensors_obj.o
Objectifying       build\python_gcc\drivers\common\openserial.c -> openserial_obj.c
Objectifying       build\python_gcc\bsp\boards\uart.h -> uart_obj.h
Compiling          build\python_gcc\drivers\common\openserial_obj.o
Objectifying       build\python_gcc\drivers\common\opentimers.c -> opentimers_obj.c
Compiling          build\python_gcc\drivers\common\opentimers_obj.o
Archiving          build\python_gcc\drivers\libdrivers.a
Indexing           build\python_gcc\drivers\libdrivers.a
Compiling          build\python_gcc\bsp\boards\python\board_obj.o
Compiling          build\python_gcc\bsp\boards\python\bsp_timer_obj.o
Compiling          build\python_gcc\bsp\boards\python\debugpins_obj.o
Compiling          build\python_gcc\bsp\boards\python\eui64_obj.o
Compiling          build\python_gcc\bsp\boards\python\leds_obj.o
Compiling          build\python_gcc\bsp\boards\python\radio_obj.o
Compiling          build\python_gcc\bsp\boards\python\radiotimer_obj.o
Compiling          build\python_gcc\bsp\boards\python\uart_obj.o
Compiling          build\python_gcc\bsp\boards\python\supply_obj.o
Compiling          build\python_gcc\bsp\boards\common\aes_cbc.o
Compiling          build\python_gcc\bsp\boards\common\aes_ccms.o
Compiling          build\python_gcc\bsp\boards\common\aes_ctr.o
Compiling          build\python_gcc\bsp\boards\common\aes_ecb.o
Compiling          build\python_gcc\bsp\boards\common\firmware_crypto_engine.o
Compiling          build\python_gcc\bsp\boards\common\dummy_crypto_engine.o
Archiving          build\python_gcc\bsp\boards\libbsp.a
Indexing           build\python_gcc\bsp\boards\libbsp.a
gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03o
os_openwsn\03oos_openwsn_obj.o build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -L
C:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\d
rivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldr
ivers -lbsp -lpython27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
scons: done building targets.


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.

The extension module is at openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pydno need to move it.

Simulate

You can now start a simulation. Running a simulation just means taking the usual software which runs on your computer (and call "openvisualizer"), but running it in simulation mode. That is, instead of the openvisualizer connecting to real motes, it connects to emulated mote code actually running on your machine.

Oops!

Before you can go on, you need to install a TAP virtual interface:

Start a simulation:

C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer>scons runweb --sim
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
scons: done reading SConscript files.
scons: Building targets ...
Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\bsp\boards\python\openwsnmodule_obj.h")
Mkdir("bin\openVisualizerApp\sim_files\windows")
Copy("bin\openVisualizerApp\sim_files\windows\oos_openwsn-x86.pyd", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\openvisualizer.conf", "bin\openVisualizerApp\openvisualizer.conf")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\logging.conf", "bin\openVisualizerApp\logging.conf")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\trace.conf", "bin\openVisualizerApp\trace.conf")
Delete("build\runui\web_files")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\web_files", "bin\openVisualizerApp\web_files")
Delete("build\runui\sim_files")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\sim_files", "bin\openVisualizerApp\sim_files")
uiRunner(["bin\openVisualizerApp\openVisualizerWeb"], ["bin\openVisualizerApp\openVisualizerWeb.py"])
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO create instance
13:09:22 INFO 3 [OPENWSN] booted
OpenVisualizer
web interface started at  0.0.0.0: 8080
enter 'q' to exit
> 13:09:22 INFO 2 [OPENWSN] booted
13:09:22 INFO 1 [OPENWSN] booted

That's it, an OpenWSN simulation is now running your computer!

As SCons on Windows can be run with scons.bat, you can launch the simulation on another window with the following command :

C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer>start cmd.exe /k "scons.bat" runweb --sim
Closing SCons window will kill the simulation.

Now, open http://127.0.0.1:8080/ to see the web interface of OpenWSN.

Open the "Topology" tab:

  • left click on a mote to move it around
  • right-click on two motes to connect them with a wireless link

    You need to right-click on the red balloon, not the blue rectangle. Confusing, right?

    Also, to create a link, you need to right-click on both endpoints.

     

  • left-click on a link to change its PDR (packet delivery ratio)

Set up the topology to have a chain 1-2-3, and set each PDR to 1.

Back in the "Motes" tab, select mote 0001 and click on the "Toggle" button. You just declare mote 1 to be the root of your network (the DAGroot in RPL parlance, the sink in WSN parlance, the gateway, etc).

Congratulations, you have built your first OpenWSN simulated network!

Ping a mote

By convention (i.e. this is hard-coded in the software), the IPv6 prefix of the simulated network is bbbb:/64. This means that the IPv6 address of each mote will start with "bbbb::". The remainder of a mote's IPv6 address is it's MAC address (or EUI-64). You can read this in the web interface (under "EUI-64").

Open a new command prompt to ping mote 2:

C:\Users\Thomas>ping bbbb::1415:92cc:0:2

Pinging bbbb::1415:92cc:0:2 with 32 bytes of data:
Reply from bbbb::1415:92cc:0:2: time=101ms
Reply from bbbb::1415:92cc:0:2: time=67ms
Reply from bbbb::1415:92cc:0:2: time=97ms
Reply from bbbb::1415:92cc:0:2: time=91ms

Ping statistics for bbbb::1415:92cc:0:2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 67ms, Maximum = 101ms, Average = 89ms

You can also ping mote 3 which is 3 hops away:

C:\Users\Thomas>ping bbbb::1415:92cc:0:3

Pinging bbbb::1415:92cc:0:3 with 32 bytes of data:
Reply from bbbb::1415:92cc:0:3: time=206ms
Reply from bbbb::1415:92cc:0:3: time=95ms
Reply from bbbb::1415:92cc:0:3: time=153ms
Reply from bbbb::1415:92cc:0:3: time=76ms

Ping statistics for bbbb::1415:92cc:0:3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 76ms, Maximum = 206ms, Average = 132ms

Interact over CoAP

CoAP is a protocol implement on each OpenWSN device, which makes it appear like a web server on the Internet.

By default, an OpenWSN mote implements a CoAP "info" resource which indicate what version of the code is running. You can test that by running the Python test script provided in the firmware:

C:\Users\Thomas\Desktop\openwsn-fw\openapps\cinfo
OpenWSN 1.4.1
Python
Python
Python
Done. Press enter to close.

Debugging with Wireshark

In simulation mode, the openvisualizer takes care of simulating the wireless medium. You can use Wireshark to take a peek at what goes over this simulated radio space.

Oops!

Before you can go on, you need to install Wireshark 6TiSCH dissectors:

Start Wireshark (run as administrator) on the OpenWSN interface at address, and configure the filtering for zep (the ZigBee encapsulation protocol).

For now, you don't see any packets, that's normal:

In the OpenVisualizer's "Event bus" tab, check the "Wireshark debug" box.

You now see all the packets exchanged over the simulated radio environment, exciting!


Here is an example pcap file of openwsn simulation network with three motes: example.

Closing the OpenVisualizer

In the command prompt from where you started the OpenVisualizer, type q to close it

Now with real hardware

User experience with real hardware is identical than when using the simulator. Because it is a popular platform, we will use the TelosB mote, although any other supported hardware platform can be used instead.

Connecting the boards

Oops!

Before you can go on, you need to install the FTDI driver for your TelosB board

When connecting a TelosB board, Windows assigns it a COM port. You can see which in the Device Manager:

Compiling/Loading firmware

Oops!

Before you can go on, you need to install mspgcc toolchain:

  • Download the latest version from http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/. At the time of writing, mspgcc-20120406-p20120911.zip.

  • Unzip somewhere on your computer. We recommend C:\mspgcc\mspgcc-20120406-p20120911.

  • Add C:\mspgcc\mspgcc-20120406-p20120911\bin\ to your PATH environment variable

The build environment allow you to build the firmware and load is on all your boards with a single command (how cool is that?):

C:\Users\Thomas\Desktop\openwsn-fw>scons board=telosb toolchain=mspgcc bootload=COM4,COM5,COM6 oos_openwsn
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
scons: done reading SConscript files.
scons: Building targets ...
[...]
Linking   firmware\openos\projects\common\03oos_openwsn_prog.exe
msp430-size firmware\openos\projects\common\03oos_openwsn_prog.exe
   text    data     bss     dec     hex filename
  43156       0    4006   47162    b83a firmware\openos\projects\common\03oos_openwsn_prog.exe
msp430-objcopy --output-target=ihex firmware\openos\projects\common\03oos_openwsn_prog.exe firmware\openos\projects\comm
on\03oos_openwsn_prog.ihex
msp430-objcopy --output-target=binary firmware\openos\projects\common\03oos_openwsn_prog.exe firmware\openos\projects\co
mmon\03oos_openwsn_prog.bin
telosb_bootload(["firmware\openos\projects\common\03oos_openwsn_prog.phonyupload"], ["firmware\openos\projects\common\03
oos_openwsn_prog.ihex"])
starting bootloading on COM4
starting bootloading on COM5
starting bootloading on COM6
[...]
done bootloading on COM4
done bootloading on COM6
done bootloading on COM5
scons: done building targets.

Start a network

Once the motes are programmed, you have the exact same experience as when running a simulated network.

First, start the OpenVisualizer:

C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer>scons runweb
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
scons: done reading SConscript files.
scons: Building targets ...
Delete("build\runui\web_files")
Mkdir("C:\Users\tengfei\Desktop\openwsn\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\web_files", "bin\openVisualizerApp\web_files")
Delete("build\runui\sim_files")
Mkdir("C:\Users\tengfei\Desktop\openwsn\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\sim_files", "bin\openVisualizerApp\sim_files")
uiRunner(["bin\openVisualizerApp\openVisualizerWeb"], ["bin\openVisualizerApp\openVisualizerWeb.py"]
)
OpenVisualizer
web interface started at  0.0.0.0: 8080
enter 'q' to exit
>

Open http://127.0.0.1:8080/ to see the web interface:

Your TelosB motes turn on their blue LED once synchronized.

Can I see the topology?

You might be tempted to look for a graphical representation of the topology. Unfortunately, this is only implemented in simulation mode. Really want it? Help fix SW-137 - Getting issue details... STATUS .

Ping a mote

You can ping a mote exactly as you would in the simulator:

C:\Users\Thomas>ping bbbb::1415:9200:12:e63b
Pinging bbbb::1415:9200:12:e63b with 32 bytes of data:
Reply from bbbb::1415:9200:12:e63b: time=285ms
Reply from bbbb::1415:9200:12:e63b: time=276ms
Reply from bbbb::1415:9200:12:e63b: time=437ms
Reply from bbbb::1415:9200:12:e63b: time=431ms
Ping statistics for bbbb::1415:9200:12:e63b:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 276ms, Maximum = 437ms, Average = 357ms

Interaction over CoAP

You can interact with a mote exactly as you would in the simulator. After modifying the rinfo.py script to communicate with mote bbbb::1415:9200:12:e63b:

C:\Users\Thomas\Desktop\openwsn-fw\openapps\cinfo>python cinfo.py
C:\Users\Thomas\Desktop\openwsn-fw\openapps\cinfo
OpenWSN 1.4.1
TelosB
MSP430f1611
CC2420
Done. Press enter to close.

What's next?

Congratulations! You've now gone through the trouble of installing all of the tools and pieces of OpenWSN. From now on, it's just fun.

  • No labels

74 Comments

  1. I had to install pywin32 before running the openvisualizer.
    First I tried to install it using pip but it not worked:

    pip install pywin32
    Downloading/unpacking pywin32
    Could not find any downloads that satisfy the requirement pywin32
    Some externally hosted files were ignored (use --allow-external pywin32 to all
    ow).
    Cleaning up...
    No distributions at all found for pywin32

    Note: pip search told that there was a pywin32 module...

    However, it was possible using the installer available at sourceforge:

    pywin32-214.win32-py2.7.exe at http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/

    As a note, my versions were:

    python 2.7.6
    setuptools 3.4.1
    pip 1.5.4
    tap-windows-9.9.2_3.exe
    scons: v2.3.0
    Win7 32 bits Home Basic

  2. Yes, absolutely. I forgot to document that, thanks! I modifed the page accordingly.

     

  3. Great tutorial!...

    For some reason, pip install scons did not work for me. I had to install scons-2.3.1 manually:

    c:\Users\Rasit\Desktop\openwsn-sw\software\openvisualizer>pip install scons
    Downloading/unpacking scons
      Running setup.py (path:c:\users\rasit\appdata\local\temp\pip_build_Rasit\scons
    \setup.py) egg_info for package scons

    Installing collected packages: scons
      Running setup.py install for scons
        usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
           or: -c --help [cmd1 cmd2 ...]
           or: -c --help-commands
           or: -c cmd --help

        error: option --single-version-externally-managed not recognized
        Complete output from command C:\Python27\python.exe -c "import setuptools, t
    okenize;__file__='c:\\users\\rasit\\appdata\\local\\temp\\pip_build_Rasit\\scons
    \\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
    e('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\rasit\appdata\loc
    al\temp\pip-evnbwr-record\install-record.txt --single-version-externally-managed
     --compile:
        usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

       or: -c --help [cmd1 cmd2 ...]

       or: -c --help-commands

       or: -c cmd --help



    error: option --single-version-externally-managed not recognized

    ----------------------------------------
    Cleaning up...
    Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use
    rs\\rasit\\appdata\\local\\temp\\pip_build_Rasit\\scons\\setup.py';exec(compile(
    getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__
    , 'exec'))" install --record c:\users\rasit\appdata\local\temp\pip-evnbwr-record
    \install-record.txt --single-version-externally-managed --compile failed with er
    ror code 1 in c:\users\rasit\appdata\local\temp\pip_build_Rasit\scons
    Storing debug log for failure in C:\Users\Rasit\pip\pip.log

    Otherwise, every step was smooth...

    As a side note, I used 3 tmotesky motes.

    1. Good to hear is all went OK. Not sure why SCons wouldn't install through pip, let's see if others get the same error.

  4. For some reason, pip install scons did not work for me TOO. I had to install scons-2.3.1 manually:

    Same failure mode as in Rasit Eskicioglu 's post above.

    I am running Window 7 (japanese) on an i5 machine: Fresh Install
    Python 2.7.7 (32bit)
    pywin32-219.win32-py2.7.exe
    setuptools 5.3 installed with ez_setup.py
    openwsn-fw, openwsn-sw, coap cloned yesterday.

  5. The tun configuration for just one computer isn't quite clear.  For one computer, the following steps should be taken to configure tun:

    • install TAP
    • create an interface and rename it to OpenWSN
    • assign the interface an IPv6 address
    • add a static route

     

  6. C:\Users\Thomas\Desktop\openwsn-sw> pip install -r requirements.pip

    The file is called requirements.txt bye me.

  7. C:\Users\Thomas\Desktop\openwsn-sw> pip install scons

    Throw an Exception, so I need to install SCons with pip install --egg scons

    1. This may be caused by the old version of setuptools, which is used by pip. See this thread,

      http://stackoverflow.com/questions/14296531/what-does-error-option-single-version-externally-managed-not-recognized-ind

      Can this explain this issue?

  8. scons board=python toolchain=gcc oos_openwsn

    For me I need to install zlib1.dll to use zlib-Features while compile.

  9. Didn't meet this error yet. Could you provide more information show in the commandline? 

  10. Hello I was trying to go throw this tutorial and i encountered this issue while using this command "scons board=python toolchain=gcc oos_openwsn"

    C:\Users\khaled\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
    scons: Reading SConscript files ...

     

    ___ _ _ _ ___ _ _
    | . | ___ ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \| |
    `___'| _/\___.|_|_||__/_/ <___/|_\_|
    |_| openwsn.org

     

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 295: ordina
    l not in range(128):
    File "C:\Users\khaled\Desktop\openwsn-fw\SConstruct", line 329:
    exports = ['env'],
    File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.3.3\SCons\Script\SConsc
    ript.py", line 550:
    return _SConscript(self.fs, *files, **subst_kw)
    File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.3.3\SCons\Script\SConsc
    ript.py", line 260:
    exec _file_ in call_stack[-1].globals
    File "C:\Users\khaled\Desktop\openwsn-fw\docs\SConscript", line 11:
    docsenv['ENV']['PATH'] += os.environ['PATH']

     

    PS : I dont have any skils with python. nice job by the way

     

  11. Hello,

    I tried to compile the firmware as explained in the tutorial but I get the following error:

    D:\msp430\Projects\openwsn-fw (develop)> scons board=python toolchain=gcc oos_openwsn
    scons: Reading SConscript files ...
    ___ _ _ _ ___ _ _
    | . | ___ ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \| |
    `___'| _/\___.|_|_||__/_/ <___/|_\_|
    |_| openwsn.org
    scons: done reading SConscript files.
    scons: Building targets ...
    gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -LD:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\drivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp -lpython27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
    D:\Python27\libs/libpython27.a(dmmes00245.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
    D:\Python27\libs/libpython27.a(dmmes01026.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
    D:\Python27\libs/libpython27.a(dmmes00007.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
    D:\Python27\libs/libpython27.a(dmmes00173.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
    D:\Python27\libs/libpython27.a(dmmes00057.o):(.idata$7+0x0): undefined reference to `_head_C__build27_cpython_PCBuild_libpython27_a'
    D:\Python27\libs/libpython27.a(dmmes00131.o):(.idata$7+0x0): more undefined references to `_head_C__build27_cpython_PCBuild_libpython27_a' follow collect2.exe: error: ld returned 1 exit status
    scons: *** [build\python_gcc\projects\common\oos_openwsn.pyd] Error 1
    scons: building terminated because of errors.
     

    Do you have any idea where to start fixing this issue?

    Thank you for your answer and for the great job... 

    1. Not sure why that is but I had the same issue with Python 2.7.10. If you use Python 2.7.5 the error is fixed.

      1. Thank you Marius. As you said by using Python 2.7.5 the build worked properly for me.

  12. Hello,

    when i run scons board=python toolchain=gcc oos_openwsn

    i get the following error message:

    The procedure entry point __printf__ could not be location in the dynamic link library libintl-8.dll

     

    any idea what i can do ?

    (i followed the direction so far, except that i'm working on the desktop)

    thanks in advance,

    Sharon

     

    1. sharon guy,

      I'm afraid I have never encountered that problem. The compilation of the OpenWSN firmware for running a simulation isn't anything particular. This error looks like it has nothing to do with OpenWSN code, and more with the installation of your tools. Did you try to Google it? The first entry is http://stackoverflow.com/questions/18363367/procedure-entry-point-printf-could-not-be-located-in-the-dynamic-link-librar.

      Just to be sure, I just re-compiled everything on my Win8 machine:

      C:\Users\Thomas\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
      scons: Reading SConscript files ...
       ___                 _ _ _  ___  _ _
      | . | ___  ___ ._ _ | | | |/ __>| \ |
      | | || . \/ ._>| ' || | | |\__ \|   |
      `___'|  _/\___.|_|_||__/_/ <___/|_\_|
           |_|                  openwsn.org
      scons: done reading SConscript files.
      scons: Building targets ...
      Objectifying       build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn.c -> 03oos_openwsn_obj.c
      Objectifying       build\python_gcc\bsp\boards\board.h -> board_obj.h
      Objectifying       build\python_gcc\inc\opendefs.h -> opendefs_obj.h
      Objectifying       build\python_gcc\openstack\openstack.h -> openstack_obj.h
      Objectifying       build\python_gcc\kernel\scheduler.h -> scheduler_obj.h
      Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.h -> adaptive_sync_obj.h
      Objectifying       build\python_gcc\openapps\c6t\c6t.h -> c6t_obj.h
      Objectifying       build\python_gcc\openapps\cexample\cexample.h -> cexample_obj.h
      Objectifying       build\python_gcc\openapps\cinfo\cinfo.h -> cinfo_obj.h
      Objectifying       build\python_gcc\openapps\cleds\cleds.h -> cleds_obj.h
      Objectifying       build\python_gcc\openapps\cstorm\cstorm.h -> cstorm_obj.h
      Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.h -> cwellknown_obj.h
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.h -> icmpv6echo_obj.h
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.h -> icmpv6rpl_obj.h
      Objectifying       build\python_gcc\openstack\cross-layers\idmanager.h -> idmanager_obj.h
      Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.h -> IEEE802154E_obj.h
      Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.h -> neighbors_obj.h
      Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.h -> opencoap_obj.h
      Objectifying       build\python_gcc\openstack\cross-layers\openqueue.h -> openqueue_obj.h
      Objectifying       build\python_gcc\openstack\cross-layers\openrandom.h -> openrandom_obj.h
      Objectifying       build\python_gcc\drivers\common\openserial.h -> openserial_obj.h
      Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.h -> opentcp_obj.h
      Objectifying       build\python_gcc\drivers\common\opentimers.h -> opentimers_obj.h
      Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.h -> processIE_obj.h
      Objectifying       build\python_gcc\openapps\rrt\rrt.h -> rrt_obj.h
      Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.h -> schedule_obj.h
      Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.h -> sixtop_obj.h
      Objectifying       build\python_gcc\openapps\techo\techo.h -> techo_obj.h
      Objectifying       build\python_gcc\openapps\uecho\uecho.h -> uecho_obj.h
      Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.h -> IEEE802154_obj.h
      Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o
      Copy("build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c", "bsp\boards\python\openwsnmodule.c")
      Objectifying       build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c -> openwsnmodule_obj.c
      Objectifying       build\python_gcc\bsp\boards\bsp_timer.h -> bsp_timer_obj.h
      Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o
      Objectifying       build\python_gcc\openstack\openstack.c -> openstack_obj.c
      Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.h -> forwarding_obj.h
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.h -> icmpv6_obj.h
      Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.h -> iphc_obj.h
      Objectifying       build\python_gcc\openapps\openapps.h -> openapps_obj.h
      Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.h -> openbridge_obj.h
      Objectifying       build\python_gcc\openstack\04-TRAN\openudp.h -> openudp_obj.h
      Compiling          build\python_gcc\openstack\openstack_obj.o
      Objectifying       build\python_gcc\openstack\02a-MAClow\topology.c -> topology_obj.c
      Objectifying       build\python_gcc\openstack\02a-MAClow\topology.h -> topology_obj.h
      Compiling          build\python_gcc\openstack\02a-MAClow\topology_obj.o
      Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.c -> IEEE802154_obj.c
      Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.h -> packetfunctions_obj.h
      Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154_obj.o
      Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.c -> IEEE802154E_obj.c
      Objectifying       build\python_gcc\bsp\boards\debugpins.h -> debugpins_obj.h
      Objectifying       build\python_gcc\bsp\boards\leds.h -> leds_obj.h
      Objectifying       build\python_gcc\bsp\boards\radiotimer.h -> radiotimer_obj.h
      Objectifying       build\python_gcc\bsp\boards\radio.h -> radio_obj.h
      Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154E_obj.o
      Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.c -> adaptive_sync_obj.c
      Compiling          build\python_gcc\openstack\02a-MAClow\adaptive_sync_obj.o
      Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.c -> neighbors_obj.c
      Compiling          build\python_gcc\openstack\02b-MAChigh\neighbors_obj.o
      Objectifying       build\python_gcc\openstack\02b-MAChigh\otf.c -> otf_obj.c
      Objectifying       build\python_gcc\openstack\02b-MAChigh\otf.h -> otf_obj.h
      Compiling          build\python_gcc\openstack\02b-MAChigh\otf_obj.o
      Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.c -> processIE_obj.c
      Compiling          build\python_gcc\openstack\02b-MAChigh\processIE_obj.o
      Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.c -> schedule_obj.c
      Compiling          build\python_gcc\openstack\02b-MAChigh\schedule_obj.o
      Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.c -> sixtop_obj.c
      Compiling          build\python_gcc\openstack\02b-MAChigh\sixtop_obj.o
      Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.c -> iphc_obj.c
      Compiling          build\python_gcc\openstack\03a-IPHC\iphc_obj.o
      Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.c -> openbridge_obj.c
      Compiling          build\python_gcc\openstack\03a-IPHC\openbridge_obj.o
      Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.c -> forwarding_obj.c
      Compiling          build\python_gcc\openstack\03b-IPv6\forwarding_obj.o
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.c -> icmpv6_obj.c
      Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6_obj.o
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.c -> icmpv6echo_obj.c
      Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6echo_obj.o
      Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.c -> icmpv6rpl_obj.c
      Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6rpl_obj.o
      Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.c -> opencoap_obj.c
      Compiling          build\python_gcc\openstack\04-TRAN\opencoap_obj.o
      Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.c -> opentcp_obj.c
      Compiling          build\python_gcc\openstack\04-TRAN\opentcp_obj.o
      Objectifying       build\python_gcc\openstack\04-TRAN\openudp.c -> openudp_obj.c
      Objectifying       build\python_gcc\openapps\uinject\uinject.h -> uinject_obj.h
      Compiling          build\python_gcc\openstack\04-TRAN\openudp_obj.o
      Objectifying       build\python_gcc\openstack\cross-layers\idmanager.c -> idmanager_obj.c
      Objectifying       build\python_gcc\bsp\boards\eui64.h -> eui64_obj.h
      Compiling          build\python_gcc\openstack\cross-layers\idmanager_obj.o
      Objectifying       build\python_gcc\openstack\cross-layers\openqueue.c -> openqueue_obj.c
      Compiling          build\python_gcc\openstack\cross-layers\openqueue_obj.o
      Objectifying       build\python_gcc\openstack\cross-layers\openrandom.c -> openrandom_obj.c
      Compiling          build\python_gcc\openstack\cross-layers\openrandom_obj.o
      Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.c -> packetfunctions_obj.c
      Compiling          build\python_gcc\openstack\cross-layers\packetfunctions_obj.o
      Archiving          build\python_gcc\openstack\libopenstack.a
      Indexing           build\python_gcc\openstack\libopenstack.a
      Objectifying       build\python_gcc\openapps\openapps.c -> openapps_obj.c
      Compiling          build\python_gcc\openapps\openapps_obj.o
      Objectifying       build\python_gcc\openapps\c6t\c6t.c -> c6t_obj.c
      Compiling          build\python_gcc\openapps\c6t\c6t_obj.o
      Objectifying       build\python_gcc\openapps\cexample\cexample.c -> cexample_obj.c
      Compiling          build\python_gcc\openapps\cexample\cexample_obj.o
      Objectifying       build\python_gcc\openapps\cinfo\cinfo.c -> cinfo_obj.c
      Compiling          build\python_gcc\openapps\cinfo\cinfo_obj.o
      Objectifying       build\python_gcc\openapps\cleds\cleds.c -> cleds_obj.c
      Compiling          build\python_gcc\openapps\cleds\cleds_obj.o
      Objectifying       build\python_gcc\openapps\cstorm\cstorm.c -> cstorm_obj.c
      Compiling          build\python_gcc\openapps\cstorm\cstorm_obj.o
      Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.c -> cwellknown_obj.c
      Compiling          build\python_gcc\openapps\cwellknown\cwellknown_obj.o
      Objectifying       build\python_gcc\openapps\rrt\rrt.c -> rrt_obj.c
      Compiling          build\python_gcc\openapps\rrt\rrt_obj.o
      Objectifying       build\python_gcc\openapps\techo\techo.c -> techo_obj.c
      Compiling          build\python_gcc\openapps\techo\techo_obj.o
      Objectifying       build\python_gcc\openapps\uecho\uecho.c -> uecho_obj.c
      Compiling          build\python_gcc\openapps\uecho\uecho_obj.o
      Objectifying       build\python_gcc\openapps\uinject\uinject.c -> uinject_obj.c
      Compiling          build\python_gcc\openapps\uinject\uinject_obj.o
      Archiving          build\python_gcc\openapps\libopenapps.a
      Indexing           build\python_gcc\openapps\libopenapps.a
      Objectifying       build\python_gcc\kernel\openos\scheduler.c -> scheduler_obj.c
      Compiling          build\python_gcc\kernel\openos\scheduler_obj.o
      Archiving          build\python_gcc\kernel\openos\libkernel.a
      Indexing           build\python_gcc\kernel\openos\libkernel.a
      Objectifying       build\python_gcc\drivers\common\openhdlc.c -> openhdlc_obj.c
      Objectifying       build\python_gcc\drivers\common\openhdlc.h -> openhdlc_obj.h
      Compiling          build\python_gcc\drivers\common\openhdlc_obj.o
      Objectifying       build\python_gcc\drivers\common\opensensors.c -> opensensors_obj.c
      Objectifying       build\python_gcc\drivers\common\opensensors.h -> opensensors_obj.h
      Compiling          build\python_gcc\drivers\common\opensensors_obj.o
      Objectifying       build\python_gcc\drivers\common\openserial.c -> openserial_obj.c
      Objectifying       build\python_gcc\bsp\boards\uart.h -> uart_obj.h
      Compiling          build\python_gcc\drivers\common\openserial_obj.o
      Objectifying       build\python_gcc\drivers\common\opentimers.c -> opentimers_obj.c
      Compiling          build\python_gcc\drivers\common\opentimers_obj.o
      Archiving          build\python_gcc\drivers\libdrivers.a
      Indexing           build\python_gcc\drivers\libdrivers.a
      Compiling          build\python_gcc\bsp\boards\python\board_obj.o
      Compiling          build\python_gcc\bsp\boards\python\bsp_timer_obj.o
      Compiling          build\python_gcc\bsp\boards\python\debugpins_obj.o
      Compiling          build\python_gcc\bsp\boards\python\eui64_obj.o
      Compiling          build\python_gcc\bsp\boards\python\leds_obj.o
      Compiling          build\python_gcc\bsp\boards\python\radio_obj.o
      Compiling          build\python_gcc\bsp\boards\python\radiotimer_obj.o
      Compiling          build\python_gcc\bsp\boards\python\uart_obj.o
      Compiling          build\python_gcc\bsp\boards\python\supply_obj.o
      Compiling          build\python_gcc\bsp\boards\common\aes_cbc.o
      Compiling          build\python_gcc\bsp\boards\common\aes_ccms.o
      Compiling          build\python_gcc\bsp\boards\common\aes_ctr.o
      Compiling          build\python_gcc\bsp\boards\common\aes_ecb.o
      Compiling          build\python_gcc\bsp\boards\common\firmware_crypto_engine.o
      Compiling          build\python_gcc\bsp\boards\common\dummy_crypto_engine.o
      Archiving          build\python_gcc\bsp\boards\libbsp.a
      Indexing           build\python_gcc\bsp\boards\libbsp.a
      gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o build\pyt
      hon_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -LC:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos
      -Lbuild\python_gcc\drivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp -lpython
      27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
      scons: done building targets.
  13. Thanks a lot,

    I had to hide the mingw32 folder to make it work

     

  14. Hi

    I'm a new arrival to OpenWSN and I'm trying to test how this works. I'm trying to launch a simulation and I've followed very carefully all the steps of this page. Anyway, I'm having questions and several problems. Basically, it looks I'm having problems with the Tun connection. When I execute "scons runweb --sim", I get:

     

    scons: done reading SConscript files.
    scons: Building targets ...
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\bsp\boards\python\o
    penwsnmodule_obj.h")
    Mkdir("bin\openVisualizerApp\sim_files\windows")
    Copy("bin\openVisualizerApp\sim_files\windows\oos_openwsn-x86.pyd", "..\..\..\op
    enwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\build\python_gcc\pr
    ojects\common\oos_openwsn.pyd")
    Delete("build\runui\web_files")
    Mkdir("D:\Pruebas\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\web_files", "bin\openVisualizerApp\web_files")
    Delete("build\runui\sim_files")
    Mkdir("D:\Pruebas\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\sim_files", "bin\openVisualizerApp\sim_files")
    uiRunner("bin\openVisualizerApp\openVisualizerWeb", ["bin\openVisualizerApp\op
    enVisualizerWeb.py"])
    Traceback (most recent call last):
    File "bin\openVisualizerApp\openVisualizerWeb.py", line 408, in <module>
    app = openVisualizerApp.main(parser)
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\bin\openVisualizerApp\open
    VisualizerApp.py", line 264, in main
    pathTopo = argspace.pathTopo,
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\bin\openVisualizerApp\open
    VisualizerApp.py", line 57, in _init_
    self.openTun = openTun.create()
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\openvisualizer\openTun\ope
    nTun.py", line 32, in create
    return OpenTunWindows()
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\openvisualizer\openTun\ope
    nTunWindows.py", line 143, in _init_
    openTun.OpenTun._init_(self)
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\openvisualizer\openTun\ope
    nTun.py", line 78, in _init_
    self.tunIf = self._createTunIf()
    File "D:\Pruebas\openwsn-sw\software\openvisualizer\openvisualizer\openTun\ope
    nTunWindows.py", line 197, in _createTunIf
    None
    pywintypes.error: (87, 'DeviceIoControl', 'The parameter is incorrect.')
    scons: *** bin\openVisualizerApp\openVisualizerWeb Error 1
    scons: building terminated because of errors.

    Same error when executing the python script responder. In addition, the Tun Cap connection appears as disconnected.

    Any suggestion?

    Thanks in advance

    Eduardo

  15. HI Eduardo Méndez

    Could you try to uninstall the TUN on your computer and install it again by following the Install tun section instruction? It seems the TUN is not install correctly.

    Tengfei

  16. Thanks. I had followed all the steps very carefully, but after re-installing the problems were fixed.

    Anyway, I don't understand very well the purpose of this simulation. How can I for example to add new motes? Can I do more complicated simulations like for example in Contiki and Cooja? I will continue reading about this.

    Thanks for your help

    Eduardo

     

    1. Eduardo Méndez,

      Sure, use the topology map to move nodes around, add/delete link and change the PDR of the links.

      Use --simTopology and --simCount switches to change the initial topology and the number of motes.

      Thomas

  17. Hi,

    I have followed the steps and have successful configured the simulation but when I try to ping any moot it shows me as destination unreachable below is the error

    C:\Users\iqra>ping bbbb::1415:92cc:0:2

    Pinging bbbb::1415:92cc:0:2 with 32 bytes of data:
    Destination host unreachable.
    Destination host unreachable.
    Destination host unreachable.
    Destination host unreachable.

    Ping statistics for bbbb::1415:92cc:0:2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

  18. hi Iqra Ijaz,  have you configured the TUN interface on your computer, which refers to step: Re: Kickstart Windows the first Oops info box?

  19. Yes, I have configured it but I have doubt regarding the command

     netsh interface ipv4 set interface interface=IEEE802.3 forwarding=enabled

    Is IEEE802.3 an ethernet interface and should it be connected? I have confusions.

    Edit: My TAP interface is connected on computer 1, but on Computer 2 TAP interface is showing disconnected even after TUN configuration.

    1. Iqra Ijaz, sorry I didn't say it clear. For this case, you only need to configure you computer as computer B shown in the Configure tun

      For example, you only need the command of :

      netsh interface ipv4 add address name=OpenWSN address=10.2.0.1 mask=255.255.0.0
      netsh interface ipv6 add address interface=OpenWSN address=bbbb::1/64
      netsh interface ipv4 set interface interface=OpenWSN forwarding=enabled
      netsh interface ipv6 set interface interface=OpenWSN forwarding=enabled
      netsh interface ipv6 delete route bbbb::/64 OpenWSN
      netsh interface ipv6 add    route bbbb::/64 OpenWSN fe80::8

      The configuration on that page is for the mote can be ping from one computer to another.

      1. and ping the mote only when the openvisualizer is running, Or you'll see in your network connection window that it appears as "disconnected".

      2. I have changed the configuration just to use my Computer as Computer B, well the message is changed from host unreachable to request time out.

        C:\Users\iqra>ping bbbb::1415:92cc:0:2

        Pinging bbbb::1415:92cc:0:2 with 32 bytes of data:
        Request timed out.
        Request timed out.
        Request timed out.
        Request timed out.

        Ping statistics for bbbb::1415:92cc:0:2:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

        Thanks for you cooperation.

         

         

        1. Iqra Ijaz, are you able to see the DAO message coming out from the openvisualizer command line?

           

          Something like:

          received RPL DAO from 14-15-92-cc-00-00-00-02
          - parents:
          . 14-15-92-cc-00-00-00-01
          - children:

           

          1. Yes, I can see this

            received RPL DAO from 14-15-92-cc-00-00-00-02
            - parents:
            . 14-15-92-cc-00-00-00-01
            - children:

            . 14-15-92-cc-00-00-00-03

  20. Hello,

    after following all the steps by word trying to run my first simulation, i encountered this problem :  

    C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer>scons runweb --sim
    scons: Reading SConscript files ...

    ___ _ _ _ ___ _ _
    | . | ___ ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \| |
    `___'| _/\___.|_|_||__/_/ <___/|_\_|
    |_| openwsn.org

    scons: done reading SConscript files.
    scons: Building targets ...
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\bsp\boards\python\openwsnmodule_obj.h")
    Mkdir("bin\openVisualizerApp\sim_files\windows")
    Copy("bin\openVisualizerApp\sim_files\windows\oos_openwsn-x86.pyd", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
    Delete("build\runui\web_files")
    Mkdir("C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\web_files", "bin\openVisualizerApp\web_files")
    Delete("build\runui\sim_files")
    Mkdir("C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\sim_files", "bin\openVisualizerApp\sim_files")
    uiRunner(["bin\openVisualizerApp\openVisualizerWeb"], ["bin\openVisualizerApp\openVisualizerWeb.py"])
    Traceback (most recent call last):
    File "bin\openVisualizerApp\openVisualizerWeb.py", line 40, in <module>
    import openVisualizerApp
    File "C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer\bin\openVisualizerApp\openVisualizerApp.py", line 16, in <module>
    from openvisualizer.OVtracer import OVtracer
    File "C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer\openvisualizer\OVtracer.py", line 11, in <module>
    import yappi
    ImportError: No module named yappi
    scons: *** [bin\openVisualizerApp\openVisualizerWeb] Error 1
    scons: building terminated because of errors.

     

     

    PS : i have windows 7 64 bits. 

    python 2.7.12 (for 32 bits windows)

    gcc (GCC) 4.9.3

    bottle (0.11.6)
    docutils (0.12)
    Jinja2 (2.8)
    MarkupSafe (0.23)
    netifaces (0.10.4)
    pip (8.1.1)
    PyDispatcher (2.0.3)
    Pygments (2.1.3)
    pyserial (2.6)
    pywin32 (220)
    setuptools (20.10.1)
    Sphinx (1.1.3)

    and the firmware was compiled successfully.

     

    Thank you in advance.

    Hamza

     

  21. Taieb, try git pull to update your branch and run

    cd openwsn-sw

    sudo pip install -r requirement.txt

     

    1. Thank you for your quick reply.

      C:\Users\an37090\Desktop\openwsn-sw\software\openvisualizer>git pull
      Already up-to-date.

       

      C:\Users\an37090\Desktop\openwsn-sw>pip install -r requirement.txt
      Could not open requirements file: [Errno 2] No such file or directory: 'requirement.t
      You are using pip version 8.1.1, however version 8.1.2 is available.
      You should consider upgrading via the 'python -m pip install --upgrade pip' command.

       

      I still get the same error after running ' scons runweb --sim '.

      Thank you.

    2. Tengfei Chang

      I tried the same thing on Ubuntu 14.04 runing on vmware and the same problem appears (even with Ubuntu).

      1. Taieb,

        It requirements.txt, not requirement.txt. See https://github.com/openwsn-berkeley/openwsn-sw.

        Thomas

      2. My mistake Taieb, it's requirements.txt Sorry!

  22. Problem solved !     

    to get the Python package Index 'yappi', i installed Microsoft Visual c++ Compiler through this link and ran the command ' pip install -r requirements.txt ' again.

    Now the simulator seems working fine.

    Thank you for the help.

    Taieb.

    1. Awesome! Thanks for letting us know.

  23. Hello Admins

    Can you fix errors when i install ' pip install -r requirements.txt ' ? 

    Thank you so much

    " building '_yappi' extension

    error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27 " 

     

    1. Hi Thang Phan Duy

       

      try to install microsoft Visual c++ from this link and re compile again. 

      1. Thank you. I tried, and it is OK. I think admins should update to solve this issue in this article.

        1. Thang Phan Duy, thanks for flagging this.

          Tengfei Chang, could you please update?

    2. Thang Phan Duy, it has been updated. Thanks for letting me know this!

  24. Hi Thomas Watteyne,

    I was exploring the openwsn project and was setting up the simulation mode.

    All went well, till the point of calling scons runweb --sim

    The below is what i got.

    After reading through comments, I uninstall TUN. I tried running the same command (scons runweb --sim) after uninstalling TUN, but to no avail. I got the same error.

    E:\Hands On\IoT\openwsn-sw-develop\software\openvisualizer>scons runweb --sim
    scons: Reading SConscript files ...

     ___                 _ _ _  ___  _ _
    | . | ___  ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \|   |
    `___'|  _/\___.|_|_||__/_/ <___/|_\_|
         |_|                  openwsn.org

    scons: done reading SConscript files.
    scons: Building targets ...
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\bsp\boards\python\o
    penwsnmodule_obj.h")
    scons: *** [bin\openVisualizerApp\simui-openVisualizerWeb.py] ..\..\..\openwsn-f
    w\bsp\boards\python\openwsnmodule_obj.h/*.*: The system cannot find the path spe
    cified
    scons: building terminated because of errors.

    Any suggestion/pointer to get away this issue will be really appreciable and help me explore openWSN project.

    I had taken the code from these links by downloading the develop branch zip.

    1. Hi Abu M. Muttalib,

      Try to rename your the folder name to :

      openwsn-fw

      openwsn-sw

      The simulation will look for the path of openwsn-fw, I guess you folder name is openwsn-fw-develop.

      Tengfei

      1. Thanks Tengfei Chang for your prompt reply. It helped to get away with issue. Really appreciate it.

        Its helping me to be an IoT enthusiast.

        I was able to move forward and was able to ping Mote 2 as well. But when tried to ping Mote 3, I got request timeout message. Any idea why so?

        C:\Users\abu.m>ping bbbb::1415:92cc:0:2

        Pinging bbbb::1415:92cc:0:2 with 32 bytes of data:
        Reply from bbbb::1415:92cc:0:2: time=37ms
        Reply from bbbb::1415:92cc:0:2: time=32ms
        Reply from bbbb::1415:92cc:0:2: time=32ms
        Reply from bbbb::1415:92cc:0:2: time=75ms

        Ping statistics for bbbb::1415:92cc:0:2:
            Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
        Approximate round trip times in milli-seconds:
            Minimum = 32ms, Maximum = 75ms, Average = 44ms

        C:\Users\abu.m>ping bbbb::1415:92cc:0:3

        Pinging bbbb::1415:92cc:0:3 with 32 bytes of data:
        Request timed out.
        Request timed out.
        Request timed out.
        Request timed out.

        Ping statistics for bbbb::1415:92cc:0:3:
            Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

        C:\Users\abu.m>

        Hope my configurations are correct. I had proceeded as suggested.

        As an aside, does "DAG" in "DAG Root" mean "Directed Acyclic Graph"?

        Regards,

        Abu

        1. Hi Abu M. Muttalib , you can open the topology page and see whether more 3 is connected to mote 2 or mote 1. Add the link between them and you should able to ping.

          1. Thanks Tengfei,

            I am redoing all it all over again; with the cloned code from jit.

            I am seeing this while installing scons. Any pointer?


            E:\Hands On\IoT\openwsn-sw>pip install --egg scons
            Collecting scons
              Could not fetch URL https://pypi.python.org/simple/scons/: There was a problem
             confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate ve
            rify failed (_ssl.c:590) - skipping
              Could not find a version that satisfies the requirement scons (from versions:
            )
            No matching distribution found for scons

            Regards,

            Abu

            1. I was able to solve the issue, off course with help from "Google Uncle", using this command,

              E:\Hands On\IoT\openwsn-sw>pip install --index-url=http://pypi.python.org/simple
              / --trusted-host pypi.python.org --egg scons
              Collecting scons
                Downloading scons-2.5.0.tar.gz (620kB)
                  100% |################################| 624kB 882kB/s
              Installing collected packages: scons
                Running setup.py install for scons ... done
              Successfully installed scons
              You are using pip version 8.1.1, however version 8.1.2 is available.
              You should consider upgrading via the 'python -m pip install --upgrade pip' comm
              and.

              instead of only,

              E:\Hands On\IoT\openwsn-sw>pip install --egg scons

              This is FYI, may help others.

              1. Abu M. Muttalib, Thanks a lot for the updating! It 's kind of weird that the site pypi.python.org do has https site but still needs to use trusted-host option. I will add this as an option if user doesn't work with 

                pip install --egg scons

                Thanks for the input!


  25. Hello,
    I have problem with the firmware compilation as a Python extension module. I present you compilation result below:

    H:\OPENwsn\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
    scons: Reading SConscript files ...
    
     ___                 _ _ _  ___  _ _
    | . | ___  ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \|   |
    `___'|  _/\___.|_|_||__/_/ <___/|_\_|
         |_|                  openwsn.org
    
    none
    scons: done reading SConscript files.
    scons: Building targets ...
    gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -LC:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\drivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp -lpython27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
    build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o:openwsnmodule_obj.c:(.text+0x9aa): undefined reference to `__imp_Py_InitModule4'
    collect2.exe: error: ld returned 1 exit status
    scons: *** [build\python_gcc\projects\common\oos_openwsn.pyd] Error 1
    scons: building terminated because of errors.

    I pulled the latest commit from development branch.

    I will be grateful if you can send me a solution for this problem.


    1. Hi Mateusz Kubaszek, try to clear the last compilation by scons board=python toolchain=gcc oos-openwsn -c

      OR just delete the whole build folder.

      That should helps.

      Tengfei

      1. Thank you for your reply Tengfei Chang.
        I compiled this software from scratch. I placed output from the second compilation in my previous post. Hence the problem still exists. I followed your tips -  result is the same (printed below):

        H:\OPENwsn\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
        scons: Reading SConscript files ...
        
         ___                 _ _ _  ___  _ _
        | . | ___  ___ ._ _ | | | |/ __>| \ |
        | | || . \/ ._>| ' || | | |\__ \|   |
        `___'|  _/\___.|_|_||__/_/ <___/|_\_|
             |_|                  openwsn.org
        
        none
        scons: done reading SConscript files.
        scons: Building targets ...
        Objectifying       build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn.c -> 03oos_openwsn_obj.c
        Objectifying       build\python_gcc\bsp\boards\board.h -> board_obj.h
        Objectifying       build\python_gcc\inc\opendefs.h -> opendefs_obj.h
        Objectifying       build\python_gcc\openstack\openstack.h -> openstack_obj.h
        Objectifying       build\python_gcc\kernel\scheduler.h -> scheduler_obj.h
        Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.h -> adaptive_sync_obj.h
        Objectifying       build\python_gcc\openapps\c6t\c6t.h -> c6t_obj.h
        Objectifying       build\python_gcc\openapps\cexample\cexample.h -> cexample_obj.h
        Objectifying       build\python_gcc\openapps\cinfo\cinfo.h -> cinfo_obj.h
        Objectifying       build\python_gcc\openapps\cleds\cleds.h -> cleds_obj.h
        Objectifying       build\python_gcc\openapps\cstorm\cstorm.h -> cstorm_obj.h
        Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.h -> cwellknown_obj.h
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.h -> icmpv6echo_obj.h
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.h -> icmpv6rpl_obj.h
        Objectifying       build\python_gcc\openstack\cross-layers\idmanager.h -> idmanager_obj.h
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.h -> IEEE802154E_obj.h
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154_security.h -> IEEE802154_security_obj.h
        Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.h -> neighbors_obj.h
        Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.h -> opencoap_obj.h
        Objectifying       build\python_gcc\openstack\cross-layers\openqueue.h -> openqueue_obj.h
        Objectifying       build\python_gcc\openstack\cross-layers\openrandom.h -> openrandom_obj.h
        Objectifying       build\python_gcc\drivers\common\openserial.h -> openserial_obj.h
        Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.h -> opentcp_obj.h
        Objectifying       build\python_gcc\drivers\common\opentimers.h -> opentimers_obj.h
        Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.h -> processIE_obj.h
        Objectifying       build\python_gcc\openapps\rrt\rrt.h -> rrt_obj.h
        Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.h -> schedule_obj.h
        Objectifying       build\python_gcc\openstack\02b-MAChigh\sf0.h -> sf0_obj.h
        Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.h -> sixtop_obj.h
        Objectifying       build\python_gcc\openapps\techo\techo.h -> techo_obj.h
        Objectifying       build\python_gcc\openapps\uecho\uecho.h -> uecho_obj.h
        Objectifying       build\python_gcc\openstack\02a-MAClow\ieee802154_security_driver.h -> ieee802154_security_driver_obj.h
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.h -> IEEE802154_obj.h
        Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o
        Copy("build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c", "bsp\boards\python\openwsnmodule.c")
        Objectifying       build\python_gcc\projects\common\03oos_openwsn\openwsnmodule.c -> openwsnmodule_obj.c
        Objectifying       build\python_gcc\bsp\boards\bsp_timer.h -> bsp_timer_obj.h
        Compiling (shared) build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o
        Objectifying       build\python_gcc\openstack\openstack.c -> openstack_obj.c
        Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.h -> forwarding_obj.h
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.h -> icmpv6_obj.h
        Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.h -> iphc_obj.h
        Objectifying       build\python_gcc\openapps\openapps.h -> openapps_obj.h
        Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.h -> openbridge_obj.h
        Objectifying       build\python_gcc\openstack\04-TRAN\openudp.h -> openudp_obj.h
        Compiling          build\python_gcc\openstack\openstack_obj.o
        Objectifying       build\python_gcc\openstack\02a-MAClow\topology.c -> topology_obj.c
        Objectifying       build\python_gcc\openstack\02a-MAClow\topology.h -> topology_obj.h
        Compiling          build\python_gcc\openstack\02a-MAClow\topology_obj.o
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154.c -> IEEE802154_obj.c
        Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.h -> packetfunctions_obj.h
        Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154_obj.o
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154E.c -> IEEE802154E_obj.c
        Objectifying       build\python_gcc\bsp\boards\debugpins.h -> debugpins_obj.h
        Objectifying       build\python_gcc\bsp\boards\leds.h -> leds_obj.h
        Objectifying       build\python_gcc\bsp\boards\radiotimer.h -> radiotimer_obj.h
        Objectifying       build\python_gcc\bsp\boards\radio.h -> radio_obj.h
        Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154E_obj.o
        Objectifying       build\python_gcc\openstack\02a-MAClow\adaptive_sync.c -> adaptive_sync_obj.c
        Compiling          build\python_gcc\openstack\02a-MAClow\adaptive_sync_obj.o
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154_security.c -> IEEE802154_security_obj.c
        Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.o
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:926:4: warning: initialization from incompatible pointer
         type [-Wincompatible-pointer-types]
            IEEE802154_security_init,
            ^
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:926:4: note: (near initialization for 'IEEE802154_security.init')
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:927:4: warning: initialization from incompatible pointer
         type [-Wincompatible-pointer-types]
            IEEE802154_security_prependAuxiliarySecurityHeader,
            ^
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:927:4: note: (near initialization for 'IEEE802154_security.prependAuxiliarySecurityHeader')
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:928:4: warning: initialization from incompatible pointer
         type [-Wincompatible-pointer-types]
            IEEE802154_security_retrieveAuxiliarySecurityHeader,
            ^
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:928:4: note: (near initialization for 'IEEE802154_security.retrieveAuxiliarySecurityHeader')
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:929:4: warning: initialization from incompatible pointer
         type [-Wincompatible-pointer-types]
            IEEE802154_security_outgoingFrameSecurity,
            ^
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:929:4: note: (near initialization for 'IEEE802154_security.outgoingFrame')
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:930:4: warning: initialization from incompatible pointer
         type [-Wincompatible-pointer-types]
            IEEE802154_security_incomingFrame,
            ^
        build\python_gcc\openstack\02a-MAClow\IEEE802154_security_obj.c:930:4: note: (near initialization for 'IEEE802154_security.incomingFrame')
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154_dummy_security.c -> IEEE802154_dummy_security_obj.c
        Objectifying       build\python_gcc\openstack\02a-MAClow\IEEE802154_dummy_security.h -> IEEE802154_dummy_security_obj.h
        Compiling          build\python_gcc\openstack\02a-MAClow\IEEE802154_dummy_security_obj.o
        Objectifying       build\python_gcc\openstack\02b-MAChigh\neighbors.c -> neighbors_obj.c
        Compiling          build\python_gcc\openstack\02b-MAChigh\neighbors_obj.o
        Objectifying       build\python_gcc\openstack\02b-MAChigh\sf0.c -> sf0_obj.c
        Compiling          build\python_gcc\openstack\02b-MAChigh\sf0_obj.o
        Objectifying       build\python_gcc\openstack\02b-MAChigh\processIE.c -> processIE_obj.c
        Compiling          build\python_gcc\openstack\02b-MAChigh\processIE_obj.o
        Objectifying       build\python_gcc\openstack\02b-MAChigh\schedule.c -> schedule_obj.c
        Compiling          build\python_gcc\openstack\02b-MAChigh\schedule_obj.o
        Objectifying       build\python_gcc\openstack\02b-MAChigh\sixtop.c -> sixtop_obj.c
        Compiling          build\python_gcc\openstack\02b-MAChigh\sixtop_obj.o
        Objectifying       build\python_gcc\openstack\03a-IPHC\iphc.c -> iphc_obj.c
        Compiling          build\python_gcc\openstack\03a-IPHC\iphc_obj.o
        Objectifying       build\python_gcc\openstack\03a-IPHC\openbridge.c -> openbridge_obj.c
        Compiling          build\python_gcc\openstack\03a-IPHC\openbridge_obj.o
        Objectifying       build\python_gcc\openstack\03b-IPv6\forwarding.c -> forwarding_obj.c
        Compiling          build\python_gcc\openstack\03b-IPv6\forwarding_obj.o
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6.c -> icmpv6_obj.c
        Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6_obj.o
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6echo.c -> icmpv6echo_obj.c
        Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6echo_obj.o
        Objectifying       build\python_gcc\openstack\03b-IPv6\icmpv6rpl.c -> icmpv6rpl_obj.c
        Compiling          build\python_gcc\openstack\03b-IPv6\icmpv6rpl_obj.o
        Objectifying       build\python_gcc\openstack\04-TRAN\opencoap.c -> opencoap_obj.c
        Compiling          build\python_gcc\openstack\04-TRAN\opencoap_obj.o
        Objectifying       build\python_gcc\openstack\04-TRAN\opentcp.c -> opentcp_obj.c
        Compiling          build\python_gcc\openstack\04-TRAN\opentcp_obj.o
        Objectifying       build\python_gcc\openstack\04-TRAN\openudp.c -> openudp_obj.c
        Objectifying       build\python_gcc\openapps\uinject\uinject.h -> uinject_obj.h
        Objectifying       build\python_gcc\openapps\userialbridge\userialbridge.h -> userialbridge_obj.h
        Compiling          build\python_gcc\openstack\04-TRAN\openudp_obj.o
        Objectifying       build\python_gcc\openstack\cross-layers\idmanager.c -> idmanager_obj.c
        Objectifying       build\python_gcc\bsp\boards\eui64.h -> eui64_obj.h
        Compiling          build\python_gcc\openstack\cross-layers\idmanager_obj.o
        Objectifying       build\python_gcc\openstack\cross-layers\openqueue.c -> openqueue_obj.c
        Compiling          build\python_gcc\openstack\cross-layers\openqueue_obj.o
        Objectifying       build\python_gcc\openstack\cross-layers\openrandom.c -> openrandom_obj.c
        Compiling          build\python_gcc\openstack\cross-layers\openrandom_obj.o
        Objectifying       build\python_gcc\openstack\cross-layers\packetfunctions.c -> packetfunctions_obj.c
        Compiling          build\python_gcc\openstack\cross-layers\packetfunctions_obj.o
        Archiving          build\python_gcc\openstack\libopenstack.a
        Indexing           build\python_gcc\openstack\libopenstack.a
        Objectifying       build\python_gcc\openapps\openapps.c -> openapps_obj.c
        Compiling          build\python_gcc\openapps\openapps_obj.o
        Objectifying       build\python_gcc\openapps\c6t\c6t.c -> c6t_obj.c
        Compiling          build\python_gcc\openapps\c6t\c6t_obj.o
        Objectifying       build\python_gcc\openapps\cexample\cexample.c -> cexample_obj.c
        Compiling          build\python_gcc\openapps\cexample\cexample_obj.o
        Objectifying       build\python_gcc\openapps\cinfo\cinfo.c -> cinfo_obj.c
        Compiling          build\python_gcc\openapps\cinfo\cinfo_obj.o
        Objectifying       build\python_gcc\openapps\cleds\cleds.c -> cleds_obj.c
        Compiling          build\python_gcc\openapps\cleds\cleds_obj.o
        Objectifying       build\python_gcc\openapps\cstorm\cstorm.c -> cstorm_obj.c
        Compiling          build\python_gcc\openapps\cstorm\cstorm_obj.o
        Objectifying       build\python_gcc\openapps\cwellknown\cwellknown.c -> cwellknown_obj.c
        Compiling          build\python_gcc\openapps\cwellknown\cwellknown_obj.o
        Objectifying       build\python_gcc\openapps\rrt\rrt.c -> rrt_obj.c
        Compiling          build\python_gcc\openapps\rrt\rrt_obj.o
        Objectifying       build\python_gcc\openapps\techo\techo.c -> techo_obj.c
        Compiling          build\python_gcc\openapps\techo\techo_obj.o
        Objectifying       build\python_gcc\openapps\uecho\uecho.c -> uecho_obj.c
        Compiling          build\python_gcc\openapps\uecho\uecho_obj.o
        Objectifying       build\python_gcc\openapps\uinject\uinject.c -> uinject_obj.c
        Compiling          build\python_gcc\openapps\uinject\uinject_obj.o
        Objectifying       build\python_gcc\openapps\userialbridge\userialbridge.c -> userialbridge_obj.c
        Compiling          build\python_gcc\openapps\userialbridge\userialbridge_obj.o
        Archiving          build\python_gcc\openapps\libopenapps.a
        Indexing           build\python_gcc\openapps\libopenapps.a
        Objectifying       build\python_gcc\kernel\openos\scheduler.c -> scheduler_obj.c
        Compiling          build\python_gcc\kernel\openos\scheduler_obj.o
        Archiving          build\python_gcc\kernel\openos\libkernel.a
        Indexing           build\python_gcc\kernel\openos\libkernel.a
        Objectifying       build\python_gcc\drivers\common\openhdlc.c -> openhdlc_obj.c
        Objectifying       build\python_gcc\drivers\common\openhdlc.h -> openhdlc_obj.h
        Compiling          build\python_gcc\drivers\common\openhdlc_obj.o
        Objectifying       build\python_gcc\drivers\common\opensensors.c -> opensensors_obj.c
        Objectifying       build\python_gcc\drivers\common\opensensors.h -> opensensors_obj.h
        Compiling          build\python_gcc\drivers\common\opensensors_obj.o
        Objectifying       build\python_gcc\drivers\common\openserial.c -> openserial_obj.c
        Objectifying       build\python_gcc\bsp\boards\uart.h -> uart_obj.h
        Compiling          build\python_gcc\drivers\common\openserial_obj.o
        build\python_gcc\drivers\common\openserial_obj.c: In function 'openserial_handleCommands':
        build\python_gcc\drivers\common\openserial_obj.c:587:12: warning: implicit declaration of function 'sniffer_setListening
        Channel' [-Wimplicit-function-declaration]
                    sniffer_setListeningChannel(comandParam_8); // one byte
                    ^
        Objectifying       build\python_gcc\drivers\common\opentimers.c -> opentimers_obj.c
        Compiling          build\python_gcc\drivers\common\opentimers_obj.o
        Archiving          build\python_gcc\drivers\libdrivers.a
        Indexing           build\python_gcc\drivers\libdrivers.a
        Compiling          build\python_gcc\bsp\boards\python\board_obj.o
        Compiling          build\python_gcc\bsp\boards\python\bsp_timer_obj.o
        Compiling          build\python_gcc\bsp\boards\python\debugpins_obj.o
        Compiling          build\python_gcc\bsp\boards\python\eui64_obj.o
        Compiling          build\python_gcc\bsp\boards\python\leds_obj.o
        Compiling          build\python_gcc\bsp\boards\python\radio_obj.o
        Compiling          build\python_gcc\bsp\boards\python\radiotimer_obj.o
        Compiling          build\python_gcc\bsp\boards\python\uart_obj.o
        Compiling          build\python_gcc\bsp\boards\python\supply_obj.o
        Compiling          build\python_gcc\bsp\boards\common\aes_cbc.o
        Compiling          build\python_gcc\bsp\boards\common\aes_ccms.o
        Compiling          build\python_gcc\bsp\boards\common\aes_ctr.o
        Compiling          build\python_gcc\bsp\boards\common\aes_ecb.o
        Compiling          build\python_gcc\bsp\boards\common\firmware_crypto_engine.o
        Compiling          build\python_gcc\bsp\boards\common\dummy_crypto_engine.o
        Archiving          build\python_gcc\bsp\boards\libbsp.a
        Indexing           build\python_gcc\bsp\boards\libbsp.a
        gcc -shared -o build\python_gcc\projects\common\oos_openwsn.pyd build\python_gcc\projects\common\03oos_openwsn\03oos_openwsn_obj.o build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -LC:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\drivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp -lpython27 -Wl,--out-implib,build\python_gcc\projects\common\liboos_openwsn.a
        build\python_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o:openwsnmodule_obj.c:(.text+0x9aa): undefined reference to `__imp_Py_InitModule4'
        collect2.exe: error: ld returned 1 exit status
        scons: *** [build\python_gcc\projects\common\oos_openwsn.pyd] Error 1
        scons: building terminated because of errors.
        1. Mateusz Kubaszek, I see. I was thinking about the __imp_Py_InitModule4 is some code in the openwsn but it turns out there is no such function. 

          This may related to the wrong gcc compiler you are using. Check out here http://stackoverflow.com/questions/2842469/python-undefined-reference-to-imp-py-initmodule4


          1. I red a couple of topics about that problem and any solution didn't help in that matter. I changed the compilation flags (added -D MS_WIN64 flag in ...\Python27\Lib\distutils\cygwinccompiler.py file). What shall I do next? 
            Maybe I have wrong version of mingw or python:

            H:\OPENwsn\openwsn-fw>gcc --version
            gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 5.3.0
            Copyright (C) 2015 Free Software Foundation, Inc.
            This is free software; see the source for copying conditions.  There is NO
            warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
            H:\OPENwsn\openwsn-fw>python --version
            Python 2.7.12
            1. Mateusz Kubaszek, try to install all tools with 32bit- version, rather than 64 even you are runing a 64-bit OS. There may be something error for the platform issue when using openwsn. It's metioned at the beginning of this tutorial.

              1. Thank you very much for your response, I will try it in the upcoming days (smile)

                Tengfei Chang I solved the problem by modifying path variable. I had an another mingw compiler from other project. So it wasn't working in spite of the right version of mingw installed on my computer.

  26. I have a problem while trying to run the simulation. The program output is attached below:

    H:\OPENwsn\openwsn-sw\software\openvisualizer>scons runweb --sim
    scons: Reading SConscript files ...
    
     ___                 _ _ _  ___  _ _
    | . | ___  ___ ._ _ | | | |/ __>| \ |
    | | || . \/ ._>| ' || | | |\__ \|   |
    `___'|  _/\___.|_|_||__/_/ <___/|_\_|
         |_|                  openwsn.org
    
    scons: done reading SConscript files.
    scons: Building targets ...
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\bsp\boards\python\openwsnmodule_obj.h")
    Mkdir("bin\openVisualizerApp\sim_files\windows")
    Copy("bin\openVisualizerApp\sim_files\windows\oos_openwsn-x86.pyd", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
    Copy("bin\openVisualizerApp\sim_files", "..\..\..\openwsn-fw\build\python_gcc\projects\common\oos_openwsn.pyd")
    Delete("build\runui\web_files")
    Mkdir("H:\OPENwsn\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\web_files", "bin\openVisualizerApp\web_files")
    Delete("build\runui\sim_files")
    Mkdir("H:\OPENwsn\openwsn-sw\software\openvisualizer\build\runui")
    Copy("build\runui\sim_files", "bin\openVisualizerApp\sim_files")
    uiRunner(["bin\openVisualizerApp\openVisualizerWeb"], ["bin\openVisualizerApp\openVisualizerWeb.py"])
    19:14:16 INFO create instance
    19:14:16 INFO create instance
    19:14:16 INFO create instance
    19:14:16 INFO create instance
    19:14:16 INFO create instance
    19:14:16 INFO create instance
    19:14:17 INFO create instance
    19:14:17 INFO create instance
    19:14:17 INFO create instance
    19:14:17 INFO 3 [OPENWSN] booted
    OpenVisualizer
    web interface started at  0.0.0.0: 8080
    enter 'q' to exit
    
    OpenVisualizer  (type "help" for commands)
    > 19:14:17 INFO 2 [OPENWSN] booted
    Exception in thread Thread-9:
    Traceback (most recent call last):
      File "C:\Python27\lib\threading.py", line 530, in __bootstrap_inner
        self.run()
      File "C:\Python27\lib\threading.py", line 483, in run
        self.__target(*self.__args, **self.__kwargs)
      File "C:\Python27\lib\site-packages\bottle.py", line 624, in run
        run(self, **kwargs)
      File "C:\Python27\lib\site-packages\bottle.py", line 2703, in run
        server.run(app)
      File "C:\Python27\lib\site-packages\bottle.py", line 2385, in run
        srv = make_server(self.host, self.port, handler, **self.options)
      File "C:\Python27\lib\wsgiref\simple_server.py", line 144, in make_server
        server = server_class((host, port), handler_class)
      File "C:\Python27\lib\SocketServer.py", line 408, in __init__
        self.server_bind()
      File "C:\Python27\lib\wsgiref\simple_server.py", line 48, in server_bind
        HTTPServer.server_bind(self)
      File "C:\Python27\lib\BaseHTTPServer.py", line 108, in server_bind
        SocketServer.TCPServer.server_bind(self)
      File "C:\Python27\lib\SocketServer.py", line 419, in server_bind
        self.socket.bind(self.server_address)
      File "C:\Python27\lib\socket.py", line 222, in meth
        return getattr(self._sock,name)(*args)
    error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions
    
    19:14:17 INFO 1 [OPENWSN] booted
    
    
    

    As it is shown above program has problem with accessing the socket. I created a tun interface "OpenWSN" and tested it successfully with tun-ping-responder.
    I added python27 to windows firewall and disabled my antivirus before running the simulation.

    1. Mateusz Kubaszek, do you have any other tcp connection using 8080 port? The socket may be used by some other connection.

      Try to run openvisualizer with option --port to specify port:

      scons runweb --sim --port=1234

  27. I have an another problem... I cannot configure the TUN interface to be able to ping motes instances.
    Interfaces configuration:

    ::set the IPv4 and IPv6 addresses tun interface
    netsh interface ipv4 add address name=OpenWSN address=10.2.0.1 mask=255.255.0.0
    netsh interface ipv6 add address interface=OpenWSN address=bbbb::1/64
    :: for IPv4
    netsh interface ipv4 set interface interface=OpenWSN forwarding=enabled
    :: for IPv6
    netsh interface ipv6 set interface interface=OpenWSN forwarding=enabled
    netsh interface ipv6 delete route bbbb::/64 OpenWSN
    netsh interface ipv6 add route bbbb::/64 OpenWSN fe80::8

    Then i run simweb/simgui/simcli (all of them works fine). I can see all packets tracked by Wireshark.

    ipconfig give me information that OpenWSN interface has 3 ipv6 addresses:

    • aaaa::1
    • bbbb::2
    • fe80::7479:1f2:dfe0:8af4%32

      I can ping all of them. But I am not able to ping any of the running motes...
      May I ask for a little help with that? 
    1. Mateusz Kubaszek

      At which computer you issue the ping command, computer A or B? If it doesn't work on computer A, are you able to ping the mote through computer B where the tun interface is installed?

      1. I am running the simulation on one computer. I am pinging them locally.

        1. Mateusz Kubaszek

          Thanks for letting me know. The OpenWSN tun interface should have the address : bbbb::1 rather than bbbb::2. Maybe you uses the wrong address when you follow the tutorial at: Configure tun? Your configuration should be the same with computer B in that tutorial. 

          1. I copied and pasted all the queries from the site above (now I tried it once again). I  used the Computer B configuration.
            Sorry the bbbb::2 address was a typo mistake, it is bbbb::1 as you said.
            Btw. I am running that on Windows 7 OS. 

            1. Mateusz Kubaszek,

              Could you paste the full output information of ipconfig command? That could help for locating the problem.

              Also after running the simulated network, if you open another window prompt and type in route PRINT -6, could you paste that output information also? 

              BTW, I just want to make sure you are already able to see the routing path through the routing page on the web interface, right? The ping works only there is a path from the dagroot to the mote you want to ping. I am not saying you haven't do that. Just want make sure the network running well:-)

              1. ipconfig 
                
                Karta Ethernet OpenWSN:
                   Sufiks DNS konkretnego połączenia :
                   Adres IPv6. . . . . . . . . . . . : bbbb::1
                   Adres IPv6 połączenia lokalnego . : fe80::7479:1f2:dfe0:8af4%32
                   Adres IPv4. . . . . . . . . . . . . : 10.2.0.1
                   Maska podsieci. . . . . . . . . . : 255.255.0.0
                   Brama domyślna. . . . . . . . . . :

                route PRINT -6

                C:\Users\KKK>route PRINT -6
                ===========================================================================
                Lista interfejsów
                 32...00 ff 97 38 01 6f ......TAP-Win32 Adapter V9
                 13...38 59 f9 31 f6 c4 ......Urządzenie Bluetooth (sieć osobista)
                 12...38 59 f9 31 f6 c3 ......Dell Wireless 1702 802.11b/g/n
                 11...18 03 73 79 9a f1 ......Realtek PCIe GBE Family Controller
                  1...........................Software Loopback Interface 1
                 34...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP
                 31...00 00 00 00 00 00 00 e0 Karta Microsoft 6to4
                 28...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
                 20...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #4
                 35...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #2
                 36...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #3
                 37...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #5
                 49...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #6
                ===========================================================================
                
                Tabela tras IPv6
                ===========================================================================
                Aktywne trasy:
                 Jeśli Metryka Miejsce docelowe w sieci      Brama
                  1    306 ::1/128                  On-link
                 28     58 2001::/32                On-link
                 28    306 2001:0:da5d:fa12:30e8:3926:3f57:fe0e/128
                                                    On-link
                 32    286 bbbb::/64                fe80::8
                 32    286 bbbb::1/128              On-link
                 12    281 fd7a:68e7:740a::/48      fe80::32b5:c2ff:fec4:61ba
                 12     33 fd7a:68e7:740a::/64      On-link
                 12    281 fd7a:68e7:740a::3c5/128  On-link
                 12    281 fd7a:68e7:740a:0:8c9:7ad5:13fb:a21f/128
                                                    On-link
                 12    281 fd7a:68e7:740a:0:10bb:4860:f09a:c860/128
                                                    On-link
                 12    281 fe80::/64                On-link
                 32    286 fe80::/64                On-link
                 28    306 fe80::/64                On-link
                 12    281 fe80::8c9:7ad5:13fb:a21f/128
                                                    On-link
                 28    306 fe80::30e8:3926:3f57:fe0e/128
                                                    On-link
                 32    286 fe80::7479:1f2:dfe0:8af4/128
                                                    On-link
                  1    306 ff00::/8                 On-link
                 28    306 ff00::/8                 On-link
                 12    281 ff00::/8                 On-link
                 32    286 ff00::/8                 On-link
                ===========================================================================
                Trasy trwałe:
                  Brak

                I have polish version of OS, should I translate above listings or is it ok?

                1. Mateusz Kubaszek,

                  It's fine. Nice to see polish:-)

                  I compared your setup with mine and all information seems good. The only difference is the Persistent Routes entry which your computer lack of that. Try to delete the routing and add it again by:

                  netsh interface ipv6 delete route bbbb::/64 OpenWSN

                  Then close all windows prompt and open a new one, type in route PRINT -6 to see whether they are removed. (The following two entries should be removed after the command.)

                   32286bbbb::/64fe80::8
                   32286bbbb::1/128On-link


                  Then type in following command to add the route again.

                  netsh interface ipv6 add    route bbbb::/64 OpenWSN fe80::8

                  Close all windows prompt and open a new one, type in route PRINT -6 to see whether the route added are back, also you can following entry in your "Trasy trwałe:"

                    0 4294967295 bbbb::/64                fe80::8

                  If everything goes well, running the simulation again, toggle one mote as dagroot, once you see one mote's DAO printed out in the commandline, try to ping that mote. 


                  Let me know if this works on you side.


                  1. I deleted the routing. These two entries disappeared. Then after adding the route again, 

                    route PRINT -6

                    gives:

                    C:\Users\KKK>route PRINT -6
                    ===========================================================================
                    Lista interfejsów
                     32...00 ff 97 38 01 6f ......TAP-Win32 Adapter V9
                     13...38 59 f9 31 f6 c4 ......Urządzenie Bluetooth (sieć osobista)
                     12...38 59 f9 31 f6 c3 ......Dell Wireless 1702 802.11b/g/n
                     11...18 03 73 79 9a f1 ......Realtek PCIe GBE Family Controller
                      1...........................Software Loopback Interface 1
                     34...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP
                     31...00 00 00 00 00 00 00 e0 Karta Microsoft 6to4
                     28...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
                     20...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #4
                     35...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #2
                     36...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #3
                     37...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #5
                     49...00 00 00 00 00 00 00 e0 Karta Microsoft ISATAP #6
                    ===========================================================================
                    
                    Tabela tras IPv6
                    ===========================================================================
                    Aktywne trasy:
                     Jeśli Metryka Miejsce docelowe w sieci      Brama
                      1    306 ::1/128                  On-link
                     28     58 2001::/32                On-link
                     28    306 2001:0:da5d:fa12:30e8:3926:3f57:fe0e/128
                                                        On-link
                     12    281 fd7a:68e7:740a::/48      fe80::32b5:c2ff:fec4:61ba
                     12     33 fd7a:68e7:740a::/64      On-link
                     12    281 fd7a:68e7:740a::3c5/128  On-link
                     12    281 fd7a:68e7:740a:0:8c9:7ad5:13fb:a21f/128
                                                        On-link
                     12    281 fd7a:68e7:740a:0:10bb:4860:f09a:c860/128
                                                        On-link
                     12    281 fe80::/64                On-link
                     28    306 fe80::/64                On-link
                     12    281 fe80::8c9:7ad5:13fb:a21f/128
                                                        On-link
                     28    306 fe80::30e8:3926:3f57:fe0e/128
                                                        On-link
                      1    306 ff00::/8                 On-link
                     28    306 ff00::/8                 On-link
                     12    281 ff00::/8                 On-link
                    ===========================================================================
                    Trasy trwałe:
                     Jeśli Metryka Miejsce docelowe w sieci      Brama
                      0 4294967295 bbbb::/64                fe80::8
                    ===========================================================================
                    
                    C:\Users\KKK>ping bbbb::1415:92cc:0:1
                    
                    Badanie bbbb::1415:92cc:0:1 z 32 bajtami danych:
                    Host docelowy jest nieosiągalny.	//unreachable
                    Host docelowy jest nieosiągalny.	//unreachable
                    Host docelowy jest nieosiągalny.	//unreachable
                    Host docelowy jest nieosiągalny.	//unreachable
                    
                    Statystyka badania ping dla bbbb::1415:92cc:0:1:
                        Pakiety: Wysłane = 4, Odebrane = 0, Utracone = 4
                                 (100% straty),
                    
                    C:\Users\KKK>ping bbbb::1415:92cc:0:2
                    
                    Badanie bbbb::1415:92cc:0:2 z 32 bajtami danych:
                    Host docelowy jest nieosiągalny.	//unreachable
                    
                    Statystyka badania ping dla bbbb::1415:92cc:0:2:
                        Pakiety: Wysłane = 1, Odebrane = 0, Utracone = 1
                                 (100% straty),
                    Control-C
                    ^C
                    
                    C:\Users\KKK>netsh interface ipv6 show route
                    
                    Publikuj Typ       Met  Prefiks                   Idks Brama/Nazwa interfejsu
                    -------  --------  ---  ------------------------  ---  ------------------------
                    Nie      Ręczne    256  ::1/128                     1  Loopback Pseudo-Interface 1
                    Nie      Ręczne    8    2001::/32                  28  Połączenie lokalne* 18
                    Nie      Ręczne    256  2001:0:da5d:fa12:30e8:3926:3f57:fe0e/128   28  Połączenie lokalne* 18
                    Nie      Ręczne    256  bbbb::/64                  32  fe80::8
                    Nie      Ręczne    256  bbbb::1/128                32  OpenWSN
                    Nie      Ręczne    256  fd7a:68e7:740a::/48        12  fe80::32b5:c2ff:fec4:61ba
                    Nie      Ręczne    8    fd7a:68e7:740a::/64        12  wifi
                    Nie      Ręczne    256  fd7a:68e7:740a::3c5/128    12  wifi
                    Nie      Ręczne    256  fd7a:68e7:740a:0:8c9:7ad5:13fb:a21f/128   12  wifi
                    Nie      Ręczne    256  fd7a:68e7:740a:0:10bb:4860:f09a:c860/128   12  wifi
                    Nie      Ręczne    256  fe80::/64                  13  Połączenie sieciowe Bluetooth
                    Nie      Ręczne    256  fe80::/64                  12  wifi
                    Nie      Ręczne    256  fe80::/64                  11  Połączenie lokalne
                    Nie      Ręczne    256  fe80::/64                  32  OpenWSN
                    Nie      Ręczne    256  fe80::/64                  28  Połączenie lokalne* 18
                    Nie      Ręczne    256  fe80::5efe:10.2.0.1/128    49  Reusable ISATAP Interface {D0F65A31-9C86-4DD0-AD17-41E6BFAAB78D}
                    Nie      Ręczne    256  fe80::5efe:192.168.1.241/128   35  isatap.lan
                    Nie      Ręczne    256  fe80::8c9:7ad5:13fb:a21f/128   12  wifi
                    Nie      Ręczne    256  fe80::2507:c031:e5c4:7bf/128   11  Połączenie lokalne
                    Nie      Ręczne    256  fe80::30e8:3926:3f57:fe0e/128   28  Połączenie lokalne* 18
                    Nie      Ręczne    256  fe80::7479:1f2:dfe0:8af4/128   32  OpenWSN
                    Nie      Ręczne    256  fe80::b5e2:bdf6:6c39:6119/128   13  Połączenie sieciowe Bluetooth
                    Nie      Ręczne    256  ff00::/8                    1  Loopback Pseudo-Interface 1
                    Nie      Ręczne    256  ff00::/8                   28  Połączenie lokalne* 18
                    Nie      Ręczne    256  ff00::/8                   13  Połączenie sieciowe Bluetooth
                    Nie      Ręczne    256  ff00::/8                   12  wifi
                    Nie      Ręczne    256  ff00::/8                   11  Połączenie lokalne
                    Nie      Ręczne    256  ff00::/8                   32  OpenWSN
                    
                    
                    C:\Users\KKK>

                    Thank you for your response (smile)

                    1. Mateusz Kubaszek, It's so strange that you have the route in the table but ping tells unreachable. I can't figure out what the problem is for now.

                      Are you able to get another computer and try that whether works? 

  28. Hello!

    I just started to look into openWSN from yesterday.I'm using Windows 7 Professional following this guide Kickstart Windows#DownloadOpenWSN.I've realize a simple topology with 3 OpenMoteSTM.But I can't ping the mote,the IPv6 prefix of the network is bbbb:/64. the EUI-64 is ff-ff-ff-ff-ff-ff-ff-ff.

    thank you!

  29. Hi zvonimir,

    The openmotestm read it's eui from the last page of flash. I guess your openmotestm is pretty new. You can manually assign an eui64 for the mote through bsp_flash project. Just need be careful all motes are programmed as different eui64 address.

    Tengfei