Kickstart Windows

Kickstart Windows

If you are completely new to OpenWSN, and you are using Windows, 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 Windows. This page is written with Windows 7 Professional.

  • 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!

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.

Download OpenWSN

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

Oops!

Before you can go on, you need to install a Git client. Any client will do, but we will use tortoisegit.

Once you've installed it, it will integrate nicely with your Windows explorer.

We will download these repositories side-by-side on your desktop using Git:

You now have:

At any time you can make sure you are running the latest code by right-clicking on each folder, and choosing Git Pull....

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 mingw, which gives you all of the build tools to build the firmware:

  • Download from http://www.mingw.org/

  • Use the following installation options:

    • Install at C:\MingGW\

    • Mark the following packages for installation:

      • ming32-base

      • msys-base

    • Select "Installation > Apply Changes" to download and install those packages. This will download and install the packages.

  • Add C:\MinGW\bin to your PATH environment variable

  • Verify you can call the gcc command:

    C:\Users\Tengfei>gcc --version gcc (GCC) 4.8.1 Copyright (C) 2013 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.

Oops!

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

  • Download Python 2.7.x from https://www.python.org/ (NOT Python 3!)

  • Add the following directories to your PATH environment variable:

    • C:\Python27

    • C:\Python27\Scripts

  • Verify you can call python:

    C:\Users\Tengfei>python --version Python 2.7.9
  • Install pywin32, an extension for Windows. You will need it to interact with the TAP virtual interface

  • Install the Microsoft 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):

    C:\Users\Tengfei\Desktop\openvisualizer> pip install -r requirements.txt C:\Users\Tengfei\Desktop\coap> pip install -r requirements.txt
  • Install SCons, the build environment:

    C:\Users\Tengfei\Desktop\openvisualizer> pip install --egg scons