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

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.

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 Linux with root access. This page is written with Ubuntu 12.10 Quantal.
  • 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!

Quick Start

 You can install everything mentioned in this page with one single script: install.sh. To run it, you need type in follow command in terminal under ~/Desktop folder.

~/Desktop$ chmod +x ./install.sh 
~/Desktop$ ./install.sh

In case excepted thing happens, you can still follow the steps detailed in this page.

Download OpenWSN

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

We will download these repositories side-by-side in an openwsn/ directory in your desktop using Git. 

~$ 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-sw.git
[...]
~/Desktop/openwsn$ git clone https://github.com/openwsn-berkeley/coap.git
[...]

At any time, you can make sure that you are using the latest code by using git pull:

~$ cd Desktop/
~/Desktop$ cd openwsn/
~/Desktop/openwsn$ cd openwsn-sw/
~/Desktop/openwsn/openwsn-sw$ git pull
Already up-to-date.
~/Desktop/openwsn/openwsn-sw$ cd ..
~/Desktop/openwsn$ cd openwsn-fw/
~/Desktop/openwsn/openwsn-fw$ git pull
Already up-to-date.

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 the Python header files:

~/Desktop/openwsn/openwsn-fw$ sudo apt-get install python-dev

Oops!

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

~/Desktop/openwsn$ sudo apt-get install scons



~/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.

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 ~/Desktop/openwsn/openwsn-fw/projects/common/oos_openwsn.so, no 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 read motes, it connects to emulated mote code actually running on you machine.

Oops!

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

~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo apt-get install python-pip
~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ 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.

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

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.

~/Desktop/openwsn/openwsn-sw/software/openvisualizer$ sudo pip install PySerial


Start a simulation:

~/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.so")
Delete("build/runui/web_files")
Mkdir("/home/tengfei/Desktop/openwsn/openwsn-sw/software/openvisualizer/build/runui")
Copy("build/runui/web_files", "bin/openVisualizerApp/web_files")
Delete("build/runui/sim_files")
Mkdir("/home/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"])
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 'q' to exit
> 21:57:51 INFO 3 [OPENWSN] booted
21:57:51 INFO 2 [OPENWSN] booted
21:57:51 INFO 1 [OPENWSN] booted

You need to run the openvisualizer with "sudo" since the Python program will create a tun interface.

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

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). 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!

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 terminal to ping mote 2:

~/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

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

~/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

We had to reduce size of the ping request for that one (-s 10). The reason is that the packet contains also a source routing header, leaving less bytes for payload.

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:

~/Desktop/openwsn/openwsn-fw/openapps/cinfo$ python cinfo.py 
/home/thomas/Desktop/openwsn/openwsn-fw/openapps/cinfo
OpenWSN 1.9.0
Python
Python
Python

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

~/Desktop$ chmod +x ./wireshark.sh 
~/Desktop$ ./wireshark.sh

Start Wireshark on the tun interface at address bbbb::1, and configure the filtering for zep (the ZigBee encapsulation protocol).

You need to start Wireshark with "sudo":

sudo wireshark

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 terminal 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

When connecting a TelosB board, you Linux will assign it a device file. Reading/writing to/from that file results in bytes being sent to/from your TelosB over its UART interface. To know which device your TelosB is located at, plug it into your computer, wait a second, and type dmesg:

[ 1181.904524] usb 1-3.3.2: new full-speed USB device number 5 using ehci_hcd
[ 1182.002641] usb 1-3.3.2: New USB device found, idVendor=0403, idProduct=6001
[ 1182.002651] usb 1-3.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1182.002659] usb 1-3.3.2: Product: Crossbow Telos Rev.B
[ 1182.002667] usb 1-3.3.2: Manufacturer: XBOW
[ 1182.002674] usb 1-3.3.2: SerialNumber: XBRAHL2O
[ 1182.035737] usbcore: registered new interface driver usbserial
[ 1182.035784] usbcore: registered new interface driver usbserial_generic
[ 1182.035819] USB Serial support registered for generic
[ 1182.035835] usbserial: USB Serial Driver core
[ 1182.041321] usbcore: registered new interface driver ftdi_sio
[ 1182.041363] USB Serial support registered for FTDI USB Serial Device
[ 1182.041627] ftdi_sio 1-3.3.2:1.0: FTDI USB Serial Device converter detected
[ 1182.041785] usb 1-3.3.2: Detected FT232BM
[ 1182.041793] usb 1-3.3.2: Number of endpoints 2
[ 1182.041801] usb 1-3.3.2: Endpoint 1 MaxPacketSize 64
[ 1182.041809] usb 1-3.3.2: Endpoint 2 MaxPacketSize 64
[ 1182.041815] usb 1-3.3.2: Setting MaxPacketSize 64
[ 1182.043704] usb 1-3.3.2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 1182.043742] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

The penultimate line indicates that this TelosB is attached to /dev/ttyUSB0. You can repeat the same procedure for the other boards. In my case, I have 3 motes connected:

thomas@Thomas-X61s:~/Desktop/openwsn/openwsn-fw$ ls /dev/ttyU*
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2

Compiling/Loading firmware

Wait!

Before going on, you need to make sure you have a recent version mspgcc:

thomas@Thomas-X61s:~$ msp430-gcc --version
msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
Copyright (C) 2011 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.

In particular, earlier versions Ubuntu (e.g. 12.04 LTS) came with the older msp430-gcc 4.5.3. This will NOT work; see FW-209 - Getting issue details... STATUS for details.

OpenMote

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?):

thomas@Thomas-X61s:~/Desktop/openwsn/openwsn-fw$ sudo scons board=telosb toolchain=mspgcc bootload=/dev/ttyUSB2 oos_openwsn
scons: Reading SConscript files ...
 ___                 _ _ _  ___  _ _ 
| . | ___  ___ ._ _ | | | |/ __>| \ |
| | || . \/ ._>| ' || | | |\__ \|   |
`___'|  _/\___.|_|_||__/_/ <___/|_\_|
     |_|                  openwsn.org
scons: done reading SConscript files.
scons: Building targets ...
msp430-size firmware/openos/projects/common/03oos_openwsn_prog
   text	   data	    bss	    dec	    hex	filename
  41024	      0	   4138	  45162	   b06a	firmware/openos/projects/common/03oos_openwsn_prog
telosb_bootload(["firmware/openos/projects/common/03oos_openwsn_prog.phonyupload"], ["firmware/openos/projects/common/03oos_openwsn_prog.ihex"])
starting bootloading on /dev/ttyUSB2
MSP430 Bootstrap Loader Version: 1.39-telos-8
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 1.61 (Device ID: f16c)
Changing baudrate to 38400 ...
Program ...
41024 bytes programmed.
Reset device ...
done bootloading on /dev/ttyUSB2
scons: done building targets.

Programming multiple motes?

While the command allows you to program multiple motes in one go:

sudo scons board=telosb toolchain=mspgcc bootload=/dev/ttyUSB0,/dev/ttyUSB1,/dev/ttyUSB2 oos_openwsn

Linux seems to have synchronization errors when doing so. See SW-136 - Getting issue details... STATUS .

Start a network

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

First, start the OpenVisualizer:

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

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:

thomas@Thomas-X61s:~$ ping6 bbbb::1415:9200:12:e63b
PING bbbb::1415:9200:12:e63b(bbbb::1415:9200:12:e63b) 56 data bytes
64 bytes from bbbb::1415:9200:12:e63b: icmp_seq=1 ttl=64 time=365 ms
64 bytes from bbbb::1415:9200:12:e63b: icmp_seq=2 ttl=64 time=354 ms
64 bytes from bbbb::1415:9200:12:e63b: icmp_seq=3 ttl=64 time=344 ms
64 bytes from bbbb::1415:9200:12:e63b: icmp_seq=4 ttl=64 time=340 ms
64 bytes from bbbb::1415:9200:12:e63b: icmp_seq=5 ttl=64 time=332 ms
^C
--- bbbb::1415:9200:12:e63b ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 332.908/347.599/365.737/11.417 ms

Interaction over CoAP

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

thomas@Thomas-X61s:~/Desktop/openwsn/openwsn-fw/openapps/cinfo$ python cinfo.py 
/home/thomas/Desktop/openwsn/openwsn-fw/openapps/cinfo
OpenWSN 1.9
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.


AttributeError: 'Requirement' object has no attribute 'project_name'
  • No labels

80 Comments

  1. After following this tutorial, I would like to share some comments that might be helpful to someone else:

    • The following package should also be installed:
      • sudo apt-get install python-pip
    • Executing the simulation with "sudoscons runweb --sim" ends incorrectly. It starts, but you cannot stop it directly. The error:
      • "> Traceback (most recent call last):

          File "bin/openVisualizerApp/openVisualizerWeb.py", line 397, in <module>

            input = raw_input('> ')

        EOFError"

      • It is better to execute the simulation with:
        • cd openwsn-sw/software/openvisualizer/bin/openVisualizerApp
        • sudo python openVisualizerWeb.py --sim
    • If you modify the code of the motes' fw and you want to simulate it, you have to copy it:
      • sudo cp ./openwsn-fw/firmware/openos/projects/common/oos_openwsn.so ./openwsn-sw/software/openvisualizer/bin/openVisualizerApp/sim_files/oos_openwsn.so
  2. Marc Domingo,

    Thanks for pointing out these questions

    • sudo apt-get install python-pip was added to Kickstart Linux

    • yet there isn't a graceful way of stopping the OpenVisualizer, so you can also kill the process. e.g:

      ~/Desktopps-ef | grepopenvisualizer
      ...
      ~/Desktopsudokill-9 <process_number>

      Pedro

  3. Thanks for the Kickstart, it is very cool and easy to follow.

     

    I am using CC2538 motes, I am able to compile and flash fw into hardware. But I am not able to get the motes in visualizer, I think it is not able to talk to the CC2538.

    When I select the motes list, it is showing me /dev/ttyUSB0 and 1.

    How can I see my CC2538 network in OpenVisualizer? Is any status and debug messages can be monitored on the gtkterminal?

  4. Hi Chennakeshava Reddy Palla,

    Could you copy the information when you start the OpenVisuallizer, so we can see whether everything is going right? Thanks!

     

  5. /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("/OpenWSN/openwsn-sw/software/openvisualizer/build/runui")
    Copy("build/runui/web_files", "bin/openVisualizerApp/web_files")
    Delete("build/runui/sim_files")
    Mkdir("/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
    RTNETLINK answers: File exists

    created following virtual interface:
    13: tun1: <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
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    16:50:57 INFO create instance
    OpenVisualizer
    web interface started at  0.0.0.0: 8080
    enter 'q' to exit

  6. Thanks for the information, Chennakeshava Reddy Palla! It seems everything is correct.

    Are you able to see the rx led on the OpenBase blinking, which indicates there is something sending from serial port?

  7. There is a RED led on the hw (CC2538DK), but it is not blinking at anytime and I did not get any data out from the serial ports of it.

  8. Any idea on which hardware revision of CC2538DK the openwsn is ported?

    The hw  CC2538EM Revision number is: 1.2.0.1.

    I tried to flash the image (*.ihex) into the target using both CCS_UniFlash, as well as "scons board=OpenMote-CC2538 toolchain=armgcc bootload=/dev/ttyUSB0 oos_openwsn".

  9. Chennakeshava Reddy Palla, are you using some other hardware with CC2538? If so, could you confirm the driver for uart To USB chip (if you are using) works well? You can use a serial port tools to see whether there is data sending out from the serial port. After you can see the correct data, we can see if this is some other issue caused this then. 

  10. I am using the TI's CC2538 Development Kit (revision 12.0.1.0). And it is connected to my Ubuntu 12.04 Host PC over USB.

    I am using gtkterm for monitoring the serial port ttyUSB0-115200 (baudrate).

    TI has provided code flashing tool called "CCS Uniflash", I have used it for experimenting Contiki examples for CC2538, all are working fine as expected.

    Currently I am able to program "OpenWSN/openwsn-fw/build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex", and verify the same is being loaded with this Uniflash tool.

  11. Are you able to see any data coming from the serial port, the raw data? 

  12. I am not getting any data over the serial port. When I connect CC2538DK to my PC over USB, I get two serial ports (ttyUSB0, ttyUSB1).

     

    It seems from the image shown on openmote-cc2538 porting page, that I have a newer version of hardware CC2538EM (rev 1.2.0.1).

    1. Chennakeshava Reddy Palla,

      We are indeed using the OpenMote (www.openmote.com), not the dev kit from TI. Why don't you purchase a couple of OpenMote's?

      Thomas

      1. Thanks for the clarification.

         

        We were having a couple of dev kits to explore 802.15.4 based wsn's, so I just gave a try. Can I get any work around for now to move on.

        1. The kits and the OpenMote contain the same chip (CC2538), so for sure something can be done to make it work. Unfortunately, since the EMK is not an official port of OpenWSN, we do not have any of those kits here. This means that we will not be of any great help in the port (sad) I'd be delighted to integrate your work on the EMK as an official port, though, so don't hesitate to create a pull request with your changes! Thomas (smile)

  13. Hello,

    i am tried with cc2538dk board. I have connected board with USB cable and using Ubuntu 14.04 environment in VM ware.

    it is giving error as shown below log...

    -------------------------------------------------------------

    pkamma@ubuntu:~/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/pkamma/Desktop/openwsn/openwsn-sw/software/openvisualizer/build/runui")
    Copy("build/runui/web_files", "bin/openVisualizerApp/web_files")
    Delete("build/runui/sim_files")
    Mkdir("/home/pkamma/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
    RTNETLINK answers: File exists

    created following virtual interface:
    10: tun2: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default 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
    01:52:11 INFO create instance
    01:52:11 INFO create instance
    01:52:11 INFO create instance
    01:52:11 INFO create instance
    01:52:11 INFO create instance
    01:52:11 INFO create instance
    OpenVisualizer
    web interface started at  0.0.0.0: 8080
    enter 'q' to exit
    > Exception in thread Thread-5:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
        self.run()
      File "/usr/lib/python2.7/threading.py", line 763, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 755, in run
        run(self, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 3117, in run
        server.run(app)
      File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 2771, in run
        srv = make_server(self.host, self.port, app, server_cls, handler_cls)
      File "/usr/lib/python2.7/wsgiref/simple_server.py", line 144, in make_server
        server = server_class((host, port), handler_class)
      File "/usr/lib/python2.7/SocketServer.py", line 419, in __init__
        self.server_bind()
      File "/usr/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
        HTTPServer.server_bind(self)
      File "/usr/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
        SocketServer.TCPServer.server_bind(self)
      File "/usr/lib/python2.7/SocketServer.py", line 430, in server_bind
        self.socket.bind(self.server_address)
      File "/usr/lib/python2.7/socket.py", line 224, in meth
        return getattr(self._sock,name)(*args)
    error: [Errno 98] Address already in use
    ---------------------------------------------------------------------------------

    can any one help me regarding using cc2538dk board from TI insted of OpenMote-CC2538

    Thanks and Regards,

    Praveen

    1. @praveen Is there any other programs using the same port? Or not release the port yet? You can try to clean them first before running. 

      1. yes Tengfei, by restarting system it is working fine.
        Thank you,

  14. Hi! I have this error:

    sudo scons board=OpenMote-CC2538 toolchain=armgcc bootload=/dev/ttyUSB0 oos_openwsn
    scons: Reading SConscript files ...

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

    scons: done reading SConscript files.
    scons: Building targets ...
    Compiling build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn/03oos_openwsn.o
    Dynifying build/OpenMote-CC2538_armgcc/openapps/openapps_dyn.c
    Linking build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog
    arm-none-eabi-size --format=berkeley -x --totals build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog
    text data bss dec hex filename
    0x172bf 0x28c 0x1c20 102763 1916b build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog
    0x172bf 0x28c 0x1c20 102763 1916b (TOTALS)
    arm-none-eabi-objcopy -O ihex build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex
    arm-none-eabi-objcopy -O binary build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.bin
    OpenMoteCC2538_bootload(["build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.phonyupload"], ["build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex"])
    starting bootloading on /dev/ttyUSB0
    Opening port /dev/ttyUSB0, baud 400000
    Reading data from build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex
    Your firmware looks like an Intel Hex file
    Connecting to target...
    ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'
    done bootloading on /dev/ttyUSB0
    scons: done building targets.

     

    How I can solve this ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)' ???

  15. Hello, Francisco Gonzalez
    Have you tried to erase the flash by press the user button? (The right one.)

    tengfei

    1. Hello Tengfei, 

      I also have same problem with Francisco Gonzalez, however when I press user button and then press reset button, the Error is not solved. 
      Hope to hear from you soon.

      Thank you.  

      1. root@comp:/home/lam/Desktop/openwsn/openwsn-fw# scons board=OpenMote-CC2538 toolchain=armgcc bootload=/dev/ttyUSB0 oos_openwsnscons

        : Reading SConscript files ...

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

        none
        scons: done reading SConscript files.
        scons: Building targets ...
        Dynifying build/OpenMote-CC2538_armgcc/openapps/openapps_dyn.c
        arm-none-eabi-size --format=berkeley -x --totals build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog
        text data bss dec hex filename
        0x1766f 0x28c 0x1c74 103791 1956f build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog
        0x1766f 0x28c 0x1c74 103791 1956f (TOTALS)
        OpenMoteCC2538_bootload(["build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.phonyupload"], ["build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex"])
        starting bootloading on /dev/ttyUSB0
        Opening port /dev/ttyUSB0, baud 400000
        Reading data from build/OpenMote-CC2538_armgcc/projects/common/03oos_openwsn_prog.ihex
        Your firmware looks like an Intel Hex file
        Connecting to target...
        ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'
        done bootloading on /dev/ttyUSB0
        scons: done building targets.

        1. Lam Nguyen,

          Try to disconnect the board and reconnect the board and program again. Usually this should work. 

          1. Dear  Tengfei Chang, 

            Thank you very much for your help, the problem is solved. 

            Anyway, sorry if my question is stupid, however Can I flash another program into Openmote-CC2538 and use "openvisualize Web Interface" to monitor ? 

            Thank you. 
            Lam.  

            1. Lam Nguyen, there are no stupid questions, don't hesitate!

              The OpenVisualizer opens the serial port of every mote connected to the computer running it, parses the serial frames it receives, and display the information then contain in table. So as long as your OpenMote generates serial data with a format the OpenVisualizer understands, you can use them together. This is the case for any OpenWSN firmware which uses the OpenStack protocol stack.

              1. Yes, Thank you very much, Thomas.

                Lam.  

  16. Francisco Gonzalez, the OpenBase does not have automatic bootloader so you need to follow Tengfei Chang advice.

    Press the user button to erase the flash and then, afterwards, press the reset button. This will trigger the bootloader and you will be able to flash using the cc2538-bsl.py script.

    Pere

  17. Thank you Pere Tuset and Tengfei Chang, I was able to solve the error with the solution you guys gave me, but I have further questions: is it necessary to press the user and reset button each time I want to flash? 
    Thank you in advance for your answers!

  18. Yes Francisco Gonzalez, it's required each time to flash.

  19. Hi,

    I haven't installed anything of OpenWSN. Not even sure I intend to. Just read e-mails and try to understand what the idea is about and what can I do with it. So my my post is just a formal observation.

    You write:

    you need to make sure you have a recent version mspgcc

    There's a newer version of mspgcc, msp430-elf-gcc to be exact. My system writes so:

    msp430-elf-gcc (GCC) 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1)
    Copyright (C) 2014 Free Software Foundation, Inc.

    Is it OK to use Rep Hat msp430-elf-gcc?

    Regards,

    drvlas




  20. Yury Vlasenko

    It is ok to use Red Hat GCC, but it has some compatibility issues with the old one (some things need to be changed, namely interrupt functions and pragmas da are not supported)

    Also,  

    There's a newer version of mspgcc, msp430-elf-gcc to be exact. My system writes so:
    msp430-elf-gcc (GCC) 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1)
    Copyright (C) 2014 Free Software Foundation, Inc.

    please notice that your system reports an old version of mspgcc that is no longer maintained. At the best of my knowledge the Red Hat mspgcc is not in apt-repo (plz correct me if i'm wrong).

     

    Currently i'm using on my project the Red Hat mspgcc without problems...

  21. Old version... World changes so quickly (smile)

    I've got my version from the TI site. Not so long ago, I see the latest date 2015-09-07 in release notes file.

    Okay, my aim was to help in keeping the article up to date. 

    UPD: thank you for a note about my old version! I've missed 2 releases already! 

  22. I am trying to install openwsn-fw on Telos B motes, but I am getting this error

    An error occoured:

    'Serial' object has no attribute 'setBaudrate'

     And when I try to see the network using runweb, and select the motes I do not see any information about the motes or observer ny network traffic. Could you help me find out what's wrong

  23. Mulugeta Tamiru, this may relate to the new release of pyserial 3.0, which removed the stBaudrate. try to install pyserial 2.xx.

    {code}pip install "pySerial>=2.0,<=2.9999{code}

    http://stackoverflow.com/questions/34602168/dronekit-failed-to-connect-to-dev-tty-usbmodem1411-serial-object-has-no-at

    1. I managed setting up one TelosB mote as GD root, after replacing the line

      self.serialport.setBaudrate(baudrate)

      in the file 

      bootloader/telosb/bsl

      with

       

      self.serialport.baudrate = 38400

      However, I am getting the following error, while trying to setup another TelosB mote as GD sniffer

      build/telosb_mspgcc/drivers/libdrivers.a(openserial.o): In function `openserial_goldenImageCommands':
      openserial.c:(.text+0x45e): undefined reference to `sniffer_setListeningChannel'
      collect2: ld returned 1 exit status
      scons: *** [build/telosb_mspgcc/projects/common/03oos_openwsn_prog] Error 1
      scons: building terminated because of errors.

      Do you have any suggestions how to resolve this one? Thank you for your help.

  24. Hi Mulugeta Tamiru, could you try the following code. The release page is wrong (I just corrected it) The project name has to be oos_sniffer when compiling as a sniffer.

    scons board=OpenMote-CC2538 toolchain=armgcc goldenImage=sniffer bootload=[port name] oos_sniffer
    1. Thank you Tengfei Chang, now I am able to install the sniffer image as well on the TelosB mote. I have one more question. After setting up a GD root, another OpenWSN node and the GD sniffer, it is not clear to me how to observe what the sniffer is capturing. I am not seeing anything after opening Openvisualizer web, checked the wireshark checkbox and trying to capture traffic with Wireshark. In fact the GD sniffer is not recognized on Openvisualiser Web unlike the other motes. Any suggestions on how to observe what the sniffer is capturing? Thanks

  25. Hi Mulugeta Tamiru, the GD_image needs to interact with GD_script, which is the openvisualizer running with:

    scons runcli

    GD_snifer will not show in openvisualizer as it only sends the packet it received to openvisualizer, not like other motes sending their status.

    1. Hi Tengfei Chang, is there a way to see what the sniffer is sniffing, and possibly export it to may be a pcap or dump file for later analysis with Wireshark? Thank you

       

      1. Mulugeta Tamiru, the packet can be seen through the 6tisch wireshark dissector: https://github.com/openwsn-berkeley/dissectors

        To install it on linux:  DebuggingwithWireshark  (monitoring on tun0 interface)

        To install it on windows: http://builder.openwsn.org/job/6TiSCH%20Wireshark/ (monitoring on OpenWSN interface)

        Tengfei

        1. Hi Tengfei Chang,

          I am able to deploy the sniffer image on OpenMote motes and also see the packets using Wireshark. Related to this, I have one more question. Apart from sniffing, can the OpenMote with the OpenWSN sniffer image be used to also "inject" packets so that there is sort of a bidirectional communication (for example, in the case of connecting remote wireless sensor networks together)? Have you come across such a use case/setup? Thanks

          1. Mulugeta Tamiru, very timely remark. We plan on adding that "inject" functionality to our OpenSniffer firmware as part of the http://www.f-interop.eu/ project we are working with (Remy Leone might comment). If you would like to add it, please feel free to submit a PR.

            1. I would like to start being able to inject commands/packets through a REST interface in OpenVisualizer towards simulated or physical nodes.

              Thomas Watteyne Where would be the best place to implement this feature? 

              My best guess for the moment would be to modify this file (1) and make it handle a certain pattern of URI (POST localhost:8080/events/) and make it able to receive JSON.

              openwsn-sw/software/openvisualizer/bin/openVisualizerApp/openVisualizerWeb.py

              Do you see a better way?

              1. Remy, I'm not 100% sure I understand this REST interface would be used for? If you want to send data to a mote, just speak to it using it's IPv6 address. This works both on real hardware and in simulation. If we start created app-level proxies to send data to a mote, we break the IP nature of the network. I must me missing something.

                1. The REST interface would be used to modify the behavior of the node remotely. My goal is to be able to perform commands remotely such as :

                  • Start/Stop sending enhanced beacon
                  • Send 6P commands (set emulated2 6pAdd [6,7])
                  • Send RPL packets (DIO/DAO)

                  I proposed using OpenVisualizer because there is already some Python code implemented coming from the command line control. A REST interface (HTTP/CoAP I don't care) would be better than the command line because it wouldn't require a human in the loop.

                  I agree the best situation would be to do so through IP, that said I got the following questions:

                  • Is there enough memory left to put a CoAP server on each node that would modify its behavior and inject commands?
                  • Are similar remote control functions already implemented?
                  • Should we use the same medium for control and data plane? For instance, if I send commands through CoAP by using the same data plane it will probably sync up the network and influence the test? 
                  1. Remy, just to conclude on what we discussed about live, while you describe is possible, I would strongly encourage you to send these commands over the serial port.

  26. This article should update install.sh file in Quick Start section

    . Some packets required in Simulation Part did not mention in this file. 

    Thank you

  27. Thang Phan Duy, thank for catching this! I have updated the install.sh file (smile)

  28. Hi everyone, iam running this tutorial with simulated network, but i have some troubles when im trying to ping the motes. i can't ping the motes i don't know why. I thing the created interface tun0 is not in the same network or some like that, but has the correct ip direction bbbb::1\64. I look with wireshark and see the pings with "no response found". Any suggestions? I have no errors

  29. Hi Carlos Ramart, are you using the Ubuntu 16.04 version? we have captured the issue when openwsn running on this version:  SW-248 - Getting issue details... STATUS

    Currently it's fixed and there is a pull request for that issue, it will be merged soon. Or if you want test it now on your local, you can try the code in this branch https://github.com/openwsn-berkeley/openwsn-sw/tree/develop_SW-248

  30. Carlos Ramart, the Pull Request is just merged. You can do a pull on your develop branch and try again now

  31. Tengfei Chang i pull and that solve the issue, thanks for your help, now i can ping the motes. For general information im running Ubuntu 14.04.5 LTS with the latest kernel update version 4.4.0-38-generic
    Thks again.

  32. Hi everyone


    i'm using telosb motes, when running the build command on windows i get this problem : 

    C:\Users\an37090\Desktop\openwsn-fw>scons board=telosb toolchain=mspgcc bootload=COM4 oos_openwsn
    scons: Reading SConscript files ...

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

    none
    scons: done reading SConscript files.
    scons: Building targets ...
    Dynifying build\telosb_mspgcc\openapps\openapps_dyn.c
    Compiling build\telosb_mspgcc\bsp\boards\telosb\cc2420\cc2420.o
    C:\Users\an37090\AppData\Local\Temp\ccrQLOwq.s: Assembler messages:
    C:\Users\an37090\AppData\Local\Temp\ccrQLOwq.s:153: Error: odd operand: 125
    scons: *** [build\telosb_mspgcc\bsp\boards\telosb\cc2420\cc2420.o] Error 1
    scons: building terminated because of errors.



    I tried the same thing on ubuntu 14.04 on vmware and i get this problem 

    hamza@ubuntu:~/Desktop/openwsn/openwsn-fw$ sudo scons board=telosb toolchain=mspgcc bootload=/dev/ttyUSB0 oos_openwsn
    [sudo] password for hamza:
    scons: Reading SConscript files ...

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

    none
    scons: done reading SConscript files.
    scons: Building targets ...
    Compiling build/telosb_mspgcc/openstack/02a-MAClow/IEEE802154E.o
    build/telosb_mspgcc/openstack/02a-MAClow/IEEE802154E.c: In function ‘ieee154e_asnDiff’:
    build/telosb_mspgcc/openstack/02a-MAClow/IEEE802154E.c:162:4: error: unknown type name ‘__istate_t’
    scons: *** [build/telosb_mspgcc/openstack/02a-MAClow/IEEE802154E.o] Error 1
    scons: building terminated because of errors.

    Thank you in advance

  33. Hi Taieb,

    It seems this is related to your mspgcc installation. Do you install your mspgcc toolchain according to the tutorial: 

    https://openwsn.atlassian.net/wiki/display/OW/mspgcc 

    Try to uninstall your mspgcc and reinstall it from here https://sourceforge.net/projects/mspgcc/files/Windows/mingw32/ as shown in the tutorial 


    Before trying to compile it again, clean the built objects with command:

    scons board=telosb toolchain=mspgcc oos_openwsn -c 

    then compile again. 

    Let me if this doesn't work for you.

    1. Hi Tengfei Chang

      i downloaded this package mspgcc-20120406-p20120911.zip from  https://sourceforge.net/projects/mspgcc/files/Windows/mingw32/.

      I created a directory C:\mspgcc\mspgcc-20120406-p20120911 and unzipped the downladed file.

      Then, in system variable, i appended  at the end in the Path variable this path : C:\mspgcc\mspgcc-20120406-p20120911\bin\

      Before compiling the firmware, i cleaned the build as you said. 

      and i still get the same error. 






      1. Taieb, could you paste the output information with the following command. Just want to make sure the compiler setup. Nothing more. Since the error you got seems relate to the compiler. 

        msp430-gcc --version
        1. C:\Users\an37090\Desktop\openwsn-fw>msp430-gcc --version
          msp430-gcc (GCC) 4.7.0 20120322 (mspgcc dev 20120911)
          Copyright (C) 2012 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.

  34. Taieb, did you download the experimental one ? Try this one: http://netix.dl.sourceforge.net/project/mspgcc/Windows/mingw32/mspgcc-20120406-p20120911.zip

    (This one has more downloading, sorry I didn't mention the specific one)

    This is my output:

    msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 patched to 20120502)
    Copyright (C) 2011 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.


    1. Tengfei Chang Thank you, it seems working now.

      I installed a .exe mspgcc tools from this link and i downloaded the package you mention in youtr last post. I changed the path in the system variables and compiled again. 

      this is the output with 3 telosb motes. 


      C:\Users\an37090\Desktop\openwsn-fw>scons board=telosb toolchain=mspgcc bootload=COM4,COM5,COM6 oos_openwsn
      scons: Reading SConscript files ...

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

      none
      scons: done reading SConscript files.
      scons: Building targets ...
      Dynifying build\telosb_mspgcc\openapps\openapps_dyn.c
      msp430-size build\telosb_mspgcc\projects\common\03oos_openwsn_prog.exe
      text data bss dec hex filename
      48200 0 4760 52960 cee0 build\telosb_mspgcc\projects\common\03oos_openwsn_prog.exe
      telosb_bootload(["build\telosb_mspgcc\projects\common\03oos_openwsn_prog.phonyupload"], ["build\telosb_mspgcc\projects\common\03oos_openwsn_prog.ihex"])
      starting bootloading on COM4
      starting bootloading on COM5
      starting bootloading on COM6
      MMSP430 Bootstrap Loader Version: 1.39-telos-8
      SP430 Bootstrap Loader Version: 1.39-telos-8
      MSP430 Bootstrap Loader Version: 1.39-telos-8
      Mass Erase...
      Mass Erase...
      Mass Erase...
      Transmit default password ...
      Transmit default password ...
      Transmit default password ...
      Invoking BSL...
      Invoking BSL...
      Invoking BSL...
      Transmit default password ...
      Transmit default password ...
      Transmit default password ...
      Current bootstrap loader version: 1.61 (Device ID: f16c)
      Changing baudrate to 38400 ...
      Current bootstrap loader version: 1.61 (Device ID: f16c)
      Changing baudrate to 38400 ...
      Current bootstrap loader version: 1.61 (Device ID: f16c)
      Changing baudrate to 38400 ...
      Program ...
      Program ...
      Program ...
      48200 bytes programmed.
      Reset device ...
      48200 bytes programmed.
      Reset device ...
      48200 bytes programmed.
      Reset device ...
      done bootloading on COM6
      done bootloading on COM5
      done bootloading on COM4
      scons: done building targets.

      1. Congrats Taieb

        Have you tested it without adding the one I mentioned in last comments? If the "Prebuilt GNU toolchain for msp430" also works, I can add this alternative to related toolchain pages document: mspgcc


        1. Unfortunately no, i was thinking that it would be better if i install the prebuilt toolchain along with the pspgcc toolchain. 

  35. Hi Tengfei Chang,

    One quick question about this start program. How does computer communicate with the telosB motes? I think it uses USB and USART, since computer is not equipped with 802.15.4 radio. Is it correct? 

    Another question: do you try to use a more powerful mote (acting as computer) equipped with 802.15.4 radio to communicate with telosB motes, with 802.15.4 radios?

    Thanks a lot.

    1. Hi [~Pengfei] , yes, the mote communicates with computer through the usb.

      The computer acting like a gateway, a powerful mote can be a raspberry Pi connecting with a mote, e.g. a telosb. Raspberry pi is able to act as a such mote.

  36. Hi Tengfei Chang. I work with OpenMote-CC2538. Everything works (I think) but when i try to ping OpenMote do not nothing. Mote's prefix is bb-bb-00-00-00-00-00-00 and EUI-64 is 00-12-4b-00-06-15-a5-f0 but i don't understand how to ping. 

    1. Hi Alberto Ciolini

      First I would like to make sure several things:

      1. have the openwsn-fw and openwsn-sw update to date?
      2. is the mote to ping dagroot or not? it's not ping-able on dagroot
      3. ping a mote which having DAO arrived at dagroot (the information on openvisualizer commandline)
      4. ping command: ping6 -s 2 bbbb::12:4b00:615:a5f0

      Could make sure you have anything done above? If it doesn't work, we can see some other possible reason.

  37. Tengfei Chang

    1. I have update both openwsn-fw and openwsn-sw.
    2. The mote is dagroot. If isn't dagroot the prefix is 00-00-00-00-00-00-00-00
    3. i don't understand this point.
    4. The ping doesn't work. 

    it seems that works fine but i don't understand what's wrong. 

    I wanted to upload a screenshot but i don't know how to do.

    1. Hi Alberto Ciolini,

      Thanks for replying!

      1. Good!
      2. doesn't understand. the dagroot address is bbbb::0:0:0:1, not bbbb::+EUI64b. Before joining the network, mote prefix is all zero, but after one mote is set as dagroot and other mote joins the network, all motes will get prefix bbbb::/64
      3. After toggle one mote as dagroot, the other mote will synchronize to dagroot to join the network. Later, they will send DAO packet (a packet containing routing information) to dagroot. Through the commandline, you will see received DAO information printed out with the ipv6 address of sending mote. Then you can ping the mote with the command I show above.
      4. follow the setup and try again:
        1. program all motes with lastest firmware and connect them through USB to computer
        2. Open openvisualizer through commandline and type in sudo scons runweb
        3. open localhost:8080 and choose one mote and toggle it as dagroot: the prefix will change to bbbb::00:00:00:00
        4. waiting the other mote synchronize to dagroot, (information will be printed out on commandline)
        5. waiting receiving DAO packet from other mote
        6. copy the ip address and ping

      Let me know on which step you failed.Thanks!

  38. Thank a lot Tengfei Chang.

    Now I understand. I've only one OpenMote with OpenBase. That's why doesn't work. Tomorrow I'll take another OpenMote and let you know.

    Thanks again.

  39. Hi Tengfei Chang, it seems that all works fine. 

    I've another question: how oos_sniffer works?

    1. Alberto Ciolini, the oos_sniffer is a firmware used sniffering.

      1. You can download the image with command

      {code}scons board=OpenMote-CC2538 toolchain=armgcc bootload=/dev/ttyUSB0 oos_sniffer{code}

      2. Then connect the mote through USB and open openVisualizer run:  scons runweb

      3. Open browser with address: localhost:8080 and check the box wireshark debugging on eventBus panel. 

      4. open Wireshark and listen on interface OpenWSN interface

      5. type in ``zep'' to filter the IEEE802.15.4e packet

      If everything works, you will see the packet sniffered by the mote you just programme



  40. Tengfei Chang, i did what you wrote, but the window of wireshark is empty. have you any idea?

    Thank you!

    1. Alberto Ciolini, the sniffer firmware only listens one packet on a single channel (by default is 20). As channel hopping is enabled in currently OpenWSN,  it may take a while to hear one packet sending on channel 20.

      If there is no a single packet appears on the wireshark, you can check several things:

      1. I assume you have two motes now, after one mote is toggle to dagroot, are you able to see the other mote synchronized to the dagroot? If yes, at the meanwhile, are you able to see the packet(EB) shown in wireshark? If no, there is something wrong on the firmware side.
      2. If you can see the mote synchronized and there is no packet appearing in wireshark, then wireshark may not setup right. I have said something wrong before. Open wireshark on OpenWSN interface is actually for windows, for linux, once you starts the openvisualizer, there will an temp interface called "tun0" created. Listen on "tun0" interface with wireshark.
      3. Make sure wireshark is opened as administrator (with sudo).

      The scenario should look like this:

      1. There are three nodes: A, B and C.  Node A and B  are programmed with oos_openwsn project, C is programmed with oos_sniffer project. 
      2. connecting all motes to your computer and start openvisualizer, {code}sudo scons runweb{code}
      3. open wireshark on ``tun0'' interface, 
      4. toggle Node A as dagroot and check ``wireshark debugging'' checkbox
      5. wait to Node B synchronized to A and see whether there is packet in wirehsark

      Tengfei




  41. I am using Z1 motes, I am able to compile and flash fw into hardware. But I am not able to get the motes in visualizer. When I open the visualizer I see only /dev/ttyUSB* and I can not react with the node.

    However nodes are communicating with other nodes that are connected to other PCs. It seems that the problem is with serial communication. I am using msp430 v 4.6.3 to flash the motes.


    What might be the problem!? 

    1. Jetmir, I was doubting whether the baudrate is correctly set for Z1. But it seems it's correct by looking at this line: https://github.com/openwsn-berkeley/openwsn-fw/blob/develop/bsp/boards/z1/uart.c#L37

      115200 is the right one to choose. If using a serial communication tool, what you will see from the motes? Could you try and paste the result here?

      1. Tengfei Chang I already tested it and it is only non understandable characters. MIght it be that the mote is misconfigured somehow for serial communication!?

        1. If the format is correctly, you should be able to see something like lots of "non-understandable characters" between like:

          ~S²V«Ü²VC2ÿܲV»» ã×~~S²V "É~~S²V ów~~S²V ü"Ù~~S²V  ÿ öd Z –~~S²V P  P~~S²V Îø~~S²V ö~~S²V X·~~S²V
          Mþù~~S²V €»~~S²V«Ü²VC2ÿܲV»» ã×~~S²V "É~~S²V Ã!~~S²V P~~S²V  ÿ öd h0 N~~S²V Ž ”,~~S²V Îø~~S²V ö~~S²V « ~~S²V
          Mþù~~S²V €»~~S²V«Ü²VC2ÿܲV»» ã×~~S²V "É~~S²Vþ þ à*~~S²V "»~~S²V  ÿ öd vE š~~S²V * <H~~S²V Îø~~S²V ö~~S²V ä~~S²V
          Mþù~~S²V €»~~S²V«Ü²VC2ÿܲV»» ã×~~S²V "É~~S²Vî î Ð|~~S²V *@Ã~~S²V  ÿ Úl ’o P~~S²V º­~~S²V Îø~~S²V ö~~S²V C2ÿÛ¤Q Ì ºß~~S²V
          Mþù~~S²V €»~~S²V«Ü²VC2ÿܲV»» ã×~~S²V "É~~S²VÞ Þ €†~~S²V 5Õ~~DV²6 C2ÿܲVC2ÿÛ¤Qñƒz:C2ÿÛ‘cC2ÿܲV›>ð @ »» C2ÿܲV €»» C2ÿקc ª»» C2ÿÛ¤QÃ~~S²V  ÿ Úm Š† CS~~S²V f~~S²V Îø~~S²V ö~~S²V ×ç~

          They are non-understandable until they are parsed.

          1. No it is not similar with this one. I noticed now that the msp430 v 4.6.3 is not being used to compile the code. Since I had an older version I recently upgraded it. When I flash the mote from another PC it can be recognized in the visualizer as normal one without recognizing it as /dev/ttyUSB*.


            Is there any possibility how to enforce the compilation with the newest version of msp430!? I tired to change the CC flag inside the SConscript but withoput any success!?


            Regards,

            jetmir.

            1. Jetmir, Do you have two version toolchain installed on you machine? If you upgrade, it should replace the old one. You can try to setup the newest version to the PATH environment variable, so it compiles with that one.