...
Info |
---|
|
- a computer running Windows. This page is written with Windows 7 Professional.
- optionally, two TelosB motes to play with real hardware.
|
Note |
---|
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! |
Warning |
---|
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. |
...
...
...
Tip |
---|
|
Before you can go on, you need to install mingw , which gives you all of the build tools to build the firmware: |
...
Tip |
---|
|
Before you can go on, you need to install Python: Download Python 2.7.x from https://www.python.org/ (NOT Python 3!) Warning |
---|
At the time of writing, Python 2.7.10 was just released. It doesn't work for compiling the OpenWSN code in emulation mode, for the reasons detailed in http://comments.gmane.org/gmane.comp.python.cython.user/13394. At the time of writing, we recommend you use Python 2.7.9. Let's hope Python 2.7.11 fixes this bug. If you read this and Python 2.7.11 was already released and works, please edit this page, or leave a comment at the bottom. |
- Add the following directories to your
PATH environment variable:C:\Python27 C:\Python27\Scripts
Verify you can call python : Code Block |
---|
| C:\Users\Thomas>pythonTengfei>python --version
Python 2.7.9 |
- Install
pywin32 , an extension for WIndowsWindows. You will need it to interact with the TAP virtual interface - Install the OpenWSN Python dependencies (from the
openwsn-sw\ directory on your DesktopMicrosoft 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 openvisualizer\ and coap\ directory on your Desktop): Code Block |
---|
| C:\Users\ThomasTengfei\Desktop\openwsn-sw>openvisualizer> pip install -r requirements.txt
C:\Users\Tengfei\Desktop\coap> pip install -r requirements.txt |
Install SCons, the build environment: Code Block |
---|
| C:\Users\ThomasTengfei\Desktop\openwsn-sw>openvisualizer> pip install --egg scons |
|
...
Note |
---|
If you have any problem with the installation of SCons, try the following command Code Block |
---|
| 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:
Code Block |
---|
|
C:\Users\ThomasTengfei\Desktop\openwsn-fw>scons board=python toolchain=gcc oos_openwsn
scons: Reading SConscript files ...
___ _ _ _ ___ _ _
| . | ___ ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \| |
`___'| _/\___.|_|_||__/_/ <___/|_\_|
|_| openwsn.org
[...]
gcc -shared -o firmware\openos\projects\common\oos_openwsn.pyd firmware\openos\projects\common\03oos
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_openw
snopenwsn_obj.o firmwarebuild\openospython_gcc\bspprojects\boardscommon\python03oos_openwsn\openwsnmodule_obj.o -LCL
C:\Python27\libs -Lbuild\python_gcc\bsp\boards\python -
Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\d
rivers -Lbuild\python_gcc\driversopenstack -Lbuild\python_gcc\openwsnopenapps -lopenstack -lopenoslopenapps -ldriverslkernel -lbldr
spivers -lbsp -lpython27 -Wl,--out-implib,firmwarebuild\openospython_gcc\projects\common\liboos_openwsn.a
scons: done building targets. |
...
Expand |
---|
title | click here for full output... |
---|
|
Code Block |
---|
C:\Users\ThomasTengfei\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\03oos03o
os_openwsn\03oos_openwsn_obj.o build\pyt
honpython_gcc\projects\common\03oos_openwsn\openwsnmodule_obj.o -LCL
C:\Python27\libs -Lbuild\python_gcc\bsp\boards -Lbuild\python_gcc\kernel\openos -Lbuild\python_gcc\driversd
rivers -Lbuild\python_gcc\openstack -Lbuild\python_gcc\openapps -lopenstack -lopenapps -lkernel -ldriversldr
ivers -lbsp -lpythonlpython27 27 -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.
...
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 you your machine.
Tip |
---|
|
Before you can go on, you need to install a TAP virtual interface: |
...
Code Block |
---|
|
C:\Users\ThomasTengfei\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\ThomasTengfei\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\openvisualizer.confweb_files", "bin\openVisualizerApp\openvisualizer.confweb_files")
Mkdir("C:\Users\Thomas\Desktop\openwsn-sw\software\openvisualizer\build\runui")
CopyDelete("build\runui\logging.conf", "bin\openVisualizerApp\logging.conf"sim_files")
Mkdir("C:\Users\ThomasTengfei\Desktop\openwsn-sw\software\openvisualizer\build\runui")
Copy("build\runui\trace.confsim_files", "bin\openVisualizerApp\trace.confsim_files")
DeleteuiRunner(["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:22bin\openVisualizerWeb"], ["bin\openVisualizerWeb.py"])
10:46:15 INFO create instance
10:46:15 INFO create instance
10:46:15 INFO create instance
10:46:15 INFO create instance
1310:0946:2215 INFO create instance
1310:0946:2215 INFO create instance
1310:0946:2215 INFO create instance
1310:0946:2215 INFO create instance
1310:0946:2215 INFO create instance
13:09:22 INFO create3 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.[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 |
...
Info |
---|
As SCons on Windows can be run with scons.bat, you can launch the simulation on another window with the following command : C:\Users\ThomasTengfei\Desktop\openwsn-sw\software\openvisualizer>start cmd.exe /k "scons.bat" runweb --sim Closing SCons window will kill the simulation. |
...
Code Block |
---|
|
C:\Users\Thomas>pingTengfei>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 |
...
Code Block |
---|
|
C:\Users\Thomas>pingTengfei>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 |
...
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:
Code Block |
---|
|
C:\Users\Thomas\Desktop\openwsn-fw\firmware\openos\openwsn\07-App\rinfo
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.
Tip |
---|
|
Before you can go on, you need to install Wireshark: |
Start Wireshark 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:
Image Removed
In the OpenVisualizer's "Event bus" tab, check the "Wireshark debug" box.
Image Removed
You now see all the packets exchanged over the simulated radio environment, exciting!
Image RemovedOpenWSN 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:
Code Block |
---|
|
C:\Users\Tengfei\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.
Tip |
---|
|
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).
You now see all the packets exchanged over the simulated radio environment, exciting!
Image Added
You may not able to see the 6LoWPAN packet in your Wireshark, then you need to configure Wireshark to decode it. Choose one packet in your wireshark and right click to choose "Decode As".
Image Added
In the prompt window, Choose 6LoWPAN protocol on the Current column.
Image Added
Click "OK" to close the window and do a "Reload" or press "Ctrl+R" to reload current setting. After this operation, you will see the 6LoWPAN packets.
You also need to configure the Wireshark to tell which IPv6 prefix is the network is using. In packet detail content, right click the 6LoWPAN dissect area and choose "Protocol Perference" → "Open 6LoWPAN Perference".
Image Added
Type bbbb::/64 in the Context 0 textbox to indicate the prefix is using bbbb::, and click OK to close the window. A "Reload" Operation is also required.
Image Added
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
quit
to close it
Now with real hardware
...
Code Block |
---|
|
C:\Users\ThomasTengfei\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. |
...
Code Block |
---|
|
C:\Users\ThomasTengfei\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\Thomastengfei\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\Thomastengfei\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 Childinterface PIDstarted isat 4740
scons: done building targets. 0.0.0.0: 8080
enter 'q' to exit
> |
Open http://127.0.0.1:8080/ to see the web interface:
Image RemovedImage Added
Your TelosB motes turn on their blue LED once synchronized.
Note |
---|
title | 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 Jira Legacy |
---|
server | JIRA (openwsn.atlassian.net) |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 86fa4a0d-9af7-33cf-98fd-d8943a0dd0b4 |
---|
key | SW-137 |
---|
| . |
...
Code Block |
---|
|
C:\Users\Thomas>pingTengfei>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 |
...
Code Block |
---|
|
C:\Users\ThomasTengfei\Desktop\openwsn-fw\firmware\openos\openwsn\07-App\rinfo>python rinfoopenapps\cinfo>python cinfo.py
C:\Users\ThomasTengfei\Desktop\openwsn-fw\firmware\openos\openwsn\07-App\rinfoopenapps\cinfo
OpenWSN 1.4.1
TelosB
MSP430f1611
CC2420
Done. Press enter to close. |
...