Recent Changes - Search:

How to Write Applications for Waspmote Devices


The SmartSantander platform is composed of thousands of devices which have low powered communication capabilities. Most of the devices deployed for experimentation in SmartSantander use a Waspmote board in its 1.1 version ( Each experimentation node has a 802.15.4 interface ( as well as some specific sensors (e.g. Temperature, CO, Luminosity, noise). In addition, Waspmote nodes have another communication interface, intended for platform and control management. The Waspmote board is powered by an ATmega1281 (

Platform Structure Considerations

SmartSantander offers different kind of devices and, taking into account their nature, the platform can be divided in two main groups:

  • Fixed nodes are deployed on facades and streetlamps and are composed with the static sensors spread throughout the city. They are the backbone upon which the SmartSantander platform relies. As explained before, these nodes have to support experimentation and service provision at the same time. Therefore, to manage both at the same time, the experimenter has to be aware that, in some point of the execution, the processor will be locked to send service sensor data (with a minimum frequency of 5 minutes, depending on the node). Also, watchdog interrupts will manage times transparently. Depending on the node, different measures can be accessed to experiment together with the 802.15.4 interface:
    • Temperature
    • Luminous intensity
    • Noise
    • CO
    • Relative Humidity
    • Soil Moisture
    • Soil Temperature
  • Mobility nodes: the SmartSantander project, during the second phase, has also included mobility nodes. They have been deployed on top of the public transport vehicles (such us buses). In this case, node sensors are controlled by a central computer (CLV) which will send the data to the Waspmote. Thus, the board will be controlled to only receive data from sensors every ten seconds through a serial port, allowing the experimenter to access the most recent information and use these data along with the 802.15.4 interface. Measurements gathered from this sensors includes:
    • CO
    • Suspended Particles
    • Temperature
    • Humidity
    • Ozone (O3)
    • Nitrogen Dioxide (NO2)

As well as other parameters related to the node movement:

  • GPS position.
  • Altitude.
  • Speed.
  • Course.
  • Odometer.

For both fixed and mobility nodes, the 802.15.4 interface is included relying on Waspmote boards. One library manages the behaviour for both, fixed and mobile nodes, transparently for the experimenter. In this library, a set of functions have been deployed and available to the experiementers. These set of functions can be found described in this wiki, and gives the opportunity to send, receive and modify some of the params from the xbee module (such as channel, PanID, etc).

Experimenter API

The SmartSantander experimenter API provides a set of funtions that allow send and receive data through the 802.15.4 interface. In addition, this class allows to the experimenter to retrieved last measured sensor values. The functions available for the experimenters are described following next link:


Setting up the environment

In order to test the applications before being sent to SmartSantander team to be deployed, an arduino IDE modification has been carried out to test them. Following steps are simple explanations to download and install the IDE. First, the software can be downloaded from here. At the time being it is working on windows. Next releases will work in linux as well.

Once the software has been downloaded and unzipped, the IDE can be executed by clicking on arduino.exe. In order to start an application, please choose an example from this wiki and copy that on top of the IDE code space (

The IDE is divided in four parts:

  • Ide options: this part is the configuration menu. It allows the Waspmote IDE configuration as well as the board or port we are using.
  • Buttons: this part is a button menu for compiling and uploading a code to the board. Following image shows the buttons to compile and to upload the code.
  • Main Code: this part contains the main code that will be compiled and checked for errors, following a structure divided into two parts: 'setup' and 'loop'. 'setup' is only executed once, when the program starts, and 'loop' is executed indefinitely.
  • Output messages: this part shows some output messages as error messages (compilation or upload) or success messages (compiling or uploading properly done).

It is possible to test the programs in other Waspmotes. The configuration deployed in Santander is composed by one waspmote board (in its hardware version v1.1) with two XBees. In the UART1 has to be placed a native 802.15.4 XBee while in the UART0 has to be placed a Digimesh XBee. More details can be found in the webpage To load the new programs in the waspmote board, the Micro-USB port of the waspmote is used, connected to the USB port of the PC. However, before trying to load the code, it is necessary to unplug the xbee digimesh from the board and plug, at least (if the three ones are placed it perfectly works), the two jumpers as shown in the image below. The last thing would be to select the correct serial port inside the IDE options “/Tools/Serial Port” and press the “upload” button.

Edit - History - Print - Recent Changes - Search
Page last modified on March 16, 2015, at 11:23 AM