If you are completely new to OpenWSN, and you are using Linux, read this page first. It will walk you through all the steps to install OpenWSN and explore a number of key features.
...
- compile and run OpenWSN in simulation mode, ping a simulated mote, and interact with it over CoAP.
- program a TelosB OpenMote-CC2538 mote, connect it to your computer, ping it, and interact with it over CoAP.
Info | ||
---|---|---|
| ||
|
...
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! |
...
- https://github.com/openwsn-berkeley/openwsn-fw holds the firmware source code which runs on the (possibly emulated) motes
- https://github.com/openwsn-berkeley/openwsn-swopenvisualizer holds the software source code which runs on your computer
- https://github.com/openwsn-berkeley/coap is a Python module which implements CoAP
...
Code Block | ||
---|---|---|
| ||
~$ cd Desktop/ ~/Desktop$ mkdir openwsn ~/Desktop$ cd openwsn/ ~/Desktop/openwsn$ git clone https://github.com/openwsn-berkeley/openwsn-fw.git [...] ~/Desktop/openwsn$ git clone https://github.com/openwsn-berkeley/openwsn-swopenvisualizer.git [...] ~/Desktop/openwsn$ git clone https://github.com/openwsn-berkeley/coap.git [...] |
...
Code Block | ||
---|---|---|
| ||
~$ cd Desktop/ ~/Desktop$ cd openwsn/ ~/Desktop/openwsn$ cd openwsn-swopenvisualizer/ ~/Desktop/openwsn/openwsn-sw$openvisualizer$ git pull Already up-to-date. ~/Desktop/openwsn/openwsn-sw$openvisualizer$ cd .. ~/Desktop/openwsn$ cd openwsn-fw/ ~/Desktop/openwsn/openwsn-fw$ git pull Already up-to-date. |
...
Tip | |||||
---|---|---|---|---|---|
| |||||
Before you can go on, you need to install SCons:
|
Code Block | ||
---|---|---|
| ||
~/Desktop/openwsn$ cd openwsn-fw/ ~/Desktop/openwsn/openwsn-fw$ scons board=python toolchain=gcc oos_openwsn [...] Archiving build/python_gcc/bsp/boards/python/libbsp.a Indexing build/python_gcc/bsp/boards/python/libbsp.a Linking (shared) build/python_gcc/projects/common/oos_openwsn.so scons: done building targets. |
...
Tip | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
Before you can go on, you need to install some Python packages:
Or install them simple with one command.
PySerial is also required and it's available in Debian/Ubuntu. you need to install the PySerial if it's not installed on your machine.
|
...
Code Block | ||
---|---|---|
| ||
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo 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/linux") Copy("bin/openVisualizerApp/sim_files/linux/oos_openwsn-x86.so", "../../../openwsn-fw/build/python_gcc/projects/common/oos_openwsn.so") Copy("bin/openVisualizerApp/sim_files", "../../../openwsn-fw/build/python_gcc/projects/common/oos_openwsn.sopyd") Delete("build/runui/web_files") Mkdir("/home/tengfeithomas/Desktop/openwsn/openwsn-sw/software/openvisualizer/build/runui") Copy("build/runui/web_files", "bin/openVisualizerApp/web_files") Delete("build/runui/sim_files") Mkdir("/home/tengfeithomas/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"]) ioctl(TUNSETIFF): Device or resource busy created following virtual interface: 6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500 link/none inet6 bbbb::1/64 scope global valid_lft forever preferred_lft forever inet6 fe80::1/64 scope link valid_lft forever preferred_lft forever 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance 21:57:51 INFO create instance OpenVisualizer web interface started at 0.0.0.0: 8080 enter 'qquit' to exit > 21:57:51 INFO 3 [OPENWSN] booted 21:57:51 INFO 2 [OPENWSN] booted 21:57:51 INFO 1 [OPENWSN] booted |
...
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). You can select other motes and see that they join the network and obtained the same prefix bbbb::/64.
Congratulations, you have built your first OpenWSN simulated network!
...
Code Block | ||
---|---|---|
| ||
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ ping6 -s 10 bbbb::1415:92cc:0:2
PING bbbb::1415:92cc:0:2(bbbb::1415:92cc:0:2) 56 data bytes
64 bytes from bbbb::1415:92cc:0:2: icmp_seq=1 ttl=64 time=51.1 ms
64 bytes from bbbb::1415:92cc:0:2: icmp_seq=2 ttl=64 time=134 ms
64 bytes from bbbb::1415:92cc:0:2: icmp_seq=3 ttl=64 time=137 ms
64 bytes from bbbb::1415:92cc:0:2: icmp_seq=4 ttl=64 time=101 ms
^C
--- bbbb::1415:92cc:0:2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 51.172/106.146/137.486/34.713 ms |
...
Code Block | ||
---|---|---|
| ||
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ ping6 -s 10 bbbb::1415:92cc:0:3
PING bbbb::1415:92cc:0:3(bbbb::1415:92cc:0:3) 10 data bytes
18 bytes from bbbb::1415:92cc:0:3: icmp_seq=1 ttl=63 time=80.1 ms
18 bytes from bbbb::1415:92cc:0:3: icmp_seq=2 ttl=63 time=105 ms
18 bytes from bbbb::1415:92cc:0:3: icmp_seq=3 ttl=63 time=94.0 ms
18 bytes from bbbb::1415:92cc:0:3: icmp_seq=4 ttl=63 time=147 ms
^C
--- bbbb::1415:92cc:0:3 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 80.115/106.887/147.964/25.359 ms |
...
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.
...
title | Oops! |
---|
Before you can go on, you need to install wireshark 6tisch dissector. The source code and installation instruction can be found at here. For quick installation, you can download this wireshark installation script and execute it with following command:
...
language | bash |
---|
...
You can download the Wireshark from https://www.wireshark.org/download/automated/ and install with default configuration.
Start Wireshark on the tun
interface at address bbbb::1
, and configure the filtering for zep
(the ZigBee encapsulation protocol).
Note | |||||
---|---|---|---|---|---|
You need to start Wireshark with "sudo":
|
For now, you don't see any packets, that's normal:
In the OpenVisualizer's "Event bus" tab, check the "Wireshark debug" box.
...
need to start Wireshark with "sudo":
|
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
...
Info | ||
---|---|---|
| ||
If you compile for the OpenMote board, you need to use the package "gcc-arm-none-eabi" and use the toolchain "armgcc" |
The build environment allow you to build the firmware and load is on all your boards with a single command (how cool is that?):
...
Code Block | ||
---|---|---|
| ||
thomas@Thomas-X61s:~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo scons runweb scons: Reading SConscript files ... ___ _ _ _ ___ _ _ | . | ___ ___ ._ _ | | | |/ __>| \ | | | || . \/ ._>| ' || | | |\__ \| | `___'| _/\___.|_|_||__/_/ <___/|_\_| |_| openwsn.org scons: done reading SConscript files. scons: Building targets ... Delete("build/runui/web_files") Mkdir("/home/thomas/Desktop/openwsn/openwsn-sw/software/openvisualizer/build/runui") Copy("build/runui/web_files", "bin/openVisualizerApp/web_files") Delete("build/runui/sim_files") Mkdir("/home/thomas/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"]) Child PID is 2820 scons: done building targets. thomas@Thomas-X61s:~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ ioctl(TUNSETIFF): Device or resource busy created following virtual interface: 4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500 link/none inet6 bbbb::1/64 scope global valid_lft forever preferred_lft forever inet6 fe80::1/64 scope link valid_lft forever preferred_lft forever |
...
Your TelosB motes turn on their blue LED once synchronized.
Note | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
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
|
...
- join the Mailing List.
- asks questions through the questions plugin.
- submit bugs and feature requests through the issue tracker.
...
AttributeError: 'Requirement' object has no attribute 'project_name'