Versions Compared

Key

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

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
titleWhat to bring?
  • a computer running Linux with root access. This page is written with Ubuntu 1218.10 QuantalCosmic.
  • optionally, two TelosB motes to play with real hardware.

...

...

Code Block
languagebash
~$ 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
languagebash
~$ 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
titleOops!

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

Code Block
languagebash
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$openvisualizer/$ sudo apt-getpip install python-pipr requirements.txt
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$coap/$ sudo pip install bottle
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install PyDispatcher
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install Sphinx
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install netifaces
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install yappi
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install pyzmq
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install openwsn-coap

Or install them simple with one command.

Code Block
languagebash
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install -r requirements.-r requirements.txt


Info

The current version of pip 8.1.2 has some changes on the source code, which may cause the error: AttributeError: 'Requirement' object has no attribute 'project_name' when use the -r option to install the packages, . If this error happens, try to install those packages one by one as shown previously.


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
languagebash
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install PySerial


...

Code Block
languagebash
~/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

...

Code Block
languagebash
~/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
languagebash
~/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.

...

titleOops!

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:

...

languagebash

...

simulating the wireless medium. You can use Wireshark to take a peek at what goes over this simulated radio space.

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":

Code Block
languagebash
sudo wireshark

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!

...

Code Block
languagebash
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

...


AttributeError: 'Requirement' object has no attribute 'project_name'