...
- You need to be able to run the OpenVisualizer, so make sure installed the elements necessary for the OpenVisualizer to run.
- Your computer needs to have
gcc
installed to be able to compile the firmware as a Python extension module. On Linux, that should be the case by default. On Windows, we recommend http://www.mingw.org/. To be able to compile the firmware, the compiler will need to have access to the
Python.h
header file. If the compiler cannot find it, you will get the following error:Code Block File "/home/user/Desktop/openWSN-sim/openwsn-fw/SConscript", line 449, in sconscript_scanner scons: done reading SConscript files. scons: Building targets ... Compiling (shared) firmware/openos/projects/common/03oos_openwsn/03oos_openwsn_obj.os In file included from build/python_gcc/bsp/boards/board_obj.h:46:0, from firmware/openos/projects/common/03oos_openwsn/03oos_openwsn_obj.c:15: build/python_gcc/bsp/boards/python/openwsnmodule_obj.h:11:20: fatal error: Python.h: No such file or directory compilation terminated. scons: *** [firmware/openos/projects/common/03oos_openwsn/03oos_openwsn_obj.os] Error 1 scons: building terminated because of errors.
The Python header files should be present by default on Windows. On Linux, you need to install the
python-dev
package:Code Block apt-get install python-dev
In some Linux installations, you might need to install the
python-tk
package:Code Block apt-get install python-tk
Compiling firmware
Before you can run a simulation, you need to compile the OpenWSN firmware as a Python extension module. For that, navigate to the openwsn-fw/
directory, and enter the following command:
...
Code Block |
---|
openwsn-fw/firmware/openos/projects/common/oos_openwsn.pyd |
...
Code Block |
---|
scons copy-simfw |
Running a simulation
Running a simulation is exactly like running the OpenVisualizer, but specifying that this is a simulation.
...
from the command line, navigate to
openwsn-sw/software/openvisualizer/bin/openVisualizerApp/
and enter the following command:Code Block python openVisualizerGui.py --sim [--simCount =<number of simulated nodes>]
enter the following command from
openwsn-sw/software/openvisualizer/
:Code Block scons rungui --sim [--simCount =<number of simulated nodes>]
Note | ||
---|---|---|
Brackets are not required when issuing a command. For example, to run a 5 motes simulating network, use following command without brackets. It's the same for following two cases: CLI and Web interface
|
command line interface (CLI)
...
from the command line, navigate to
openwsn-sw/software/openvisualizer/bin/openVisualizerApp/
and enter the following command:Code Block python openVisualizerCli.py --sim [--simCount =<number of simulated nodes>]
enter the following command from
openwsn-sw/software/openvisualizer/
:Code Block scons runcli --sim [--simCount =<number of simulated nodes>]
...
from the command line, navigate to
openwsn-sw/software/openvisualizer/bin/openVisualizerApp/
and enter the following command:Code Block python openVisualizerWeb.py --sim [--simCount =<number of simulated nodes>]
enter the following command from
openwsn-sw/software/openvisualizer/
:Code Block scons runweb --sim [--simCount =<number of simulated nodes>]