Quick Start Guide


  1. Setting the Waspmote Environment
  2. Testing the motes
  3. Uploading a new program to Waspmote


1.- Setting the Waspmote Environment


This is a quick reference guide to get a first contact with the Waspmote platform.

1.1- Downloading the Waspmote IDE
Waspmote-IDE can be run over Windows, Linux or Mac-OS. It includes the Waspmote API and the compiler (both released as open source code).

1.2- Installing Waspmote IDE
Installing Waspmote is as simple as extracting the downloaded file in the chosen folder. Inside this folder there will be a file called 'waspmote'. Execute it and the Waspmote IDE will be launched.

NOTE: some applications or drivers may be necessary, please refer to Waspmote Technical Guide to get more details about Waspmote installation.

1.3- Waspmote IDE Overview
Waspmote IDE is divided in four main parts that can be seen in the Figure 1.



Figure 1.- Waspmote IDE Structure




  • 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, opening, storing or uploading a code to the board. Figure 2 shows the different buttons and their function.




Figure 2.- Button menu


  • Main Code: this part contains the main code that will be uploaded to Waspmote board, following a structure divided in 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).



1.4- Configuring Waspmote IDE
Previous to be able to compile and upload a program to Waspmote, some configurations parameters must be changed for the first time (this changes will be kept by Waspmote IDE).
1.Select 'Wasp v01' in 'Tools/Board' inside IDE options menu. 2.Select the port where Waspmote board has been connected in 'Tools/Serial Port' inside IDE options menu. 3.Configuring folder where store our programs: this folder is called ' sketchbook' and its path can be configured in 'File/Preferences'. When opening this menu a new window will be opened and the 'sketchbook' path should be entered. 4.Reset Waspmote IDE to apply the changes.



2.- Testing the motes


Waspmote comes from factory preconfigured with a program which lets you check the right operation of the device.

  1. Connect the antennas and the rest of the desired components to Waspmote and Waspmote Gateway (manual chapter 1.4).



    Figure 3.- Connecting antenna




    Figure 4.- Connecting XBee to Waspmote gateway




    Figure 5.- Connecting XBee to Waspmote




  2. Connect the Waspmote Gateway to the USB port on the computer (manual chapter 14.1).



    Figure 6.- Connecting Waspmote Gateway




  3. Launch the serial monitor application (manual chapters 14.2, 14.3 and 14.4) and set the next parameters:

    • USB port: 38000bps
    • 8bits
    • 1 bit stop
    • no parity setting


  4. Connect the battery to the Waspmote.



    Figure 7.- Connecting the battery to Waspmote




  5. Switch Waspmote to the ON position (manual chapter 1.4).



    Figure 8.- Switching Waspmote ON




When the program starts, it executes sequentially these actions:

  • State 1 – Leds ON for 5 seconds
  • State 2 – Leds blinking for 3 seconds
  • State 3 – Sending messages

State 1 and 2 are only executed once (when program starts) whereas state 3 will loop indefinitely every 3 seconds (if we reset Waspmote, the program starts again).

Every packet contains a message with the MAC address of the XBee module. Example:

~\0x00U\0x80\0x00}3\0xa2\0x00@U3\0xdf=\0x02R\0x01#\0x01\0x00}3\0xa2\0x00@U3\0xdf
--hello, this is Waspmote. MAC address: 0013A200405533DF--\0xc1

Initially there are some hexadecimal characters followed by the message. In the above example the message is

--hello, this is Waspmote. MAC address: 0013A200405533DF--

Where 0013A200405533DF matches with the 64 bits MAC address of the XBee module included in the Waspmote which sent the packet.


The rest of the characters match with the parameters included in the application header established in the Waspmote XBee library (for extended information see the section 13.6). These parameters are sent in hexadecimal format.

These hexadecimal parameters are used by the Waspmote devices for making control tasks in the network layer. When we make an application for Waspmote these information is extracted and analyzed by each node and only the real message is sent to the next node in the network. However, in this case the Waspmote Gateway shows the whole content in the packet received.



3.- Uploading a new program to Waspmote


Inside the folder where Waspmote IDE has been extracted, there is a folder which contains a test program ('test.pde') to get started using Waspmote and Waspmote IDE. This program must be copied into the 'sketchbook' folder.

This test program blinks LEDs and shows the output message 'Hello World, this is Waspmote!'.

Press 'Open' button in 'Button Menu' and select the test program 'test.pde'. The code program will appear in 'Main Code' part. To upload the code to Waspmote, press 'Upload' button. When the code has been uploaded properly a success message will appear in 'Output messages' part. If there are some errors while compiling, an error message in red color will appear in 'Output messages'.

Once the code has been properly uploaded to Waspmote, the LED will start blinking and the output message will appear if we press 'Serial Monitor' button. This button opens a new window that captures the serial output from Waspmote board.

3.1 - Creating our first program: "hello world!"
The steps to create our first program are:


  1. Create the code. This code is written inside 'Main Code' part and it has to follow the structure previously explained : 'setup' and 'loop'. We are going to use the code explained in the previous chapter. This code is shown below:


  2.     
        
    {
        void setup()
        {
          // Opening UART to show messages using 'Serial Monitor'
          USB.begin();
        }
    
        void loop()
        {
          // Blinking LEDs
          Utils.blinkLEDs(1000);
          // Printing a message, remember to open 'Serial Monitor'
          // to be able to see this message
          USB.println("Hello World, this is Waspmote!");
          // A little delay
          delay(2000);
        }
    }
        
        

  3. Once we have created our code we press 'Compile' button to check there are no errors. If no errors, an output message 'Done compiling' will appear.


  4. Save the code. We have to press the 'Save' button and a new window will appear to specify the name and the path where store the code.


  5. Check Waspmote board and port where Waspmote is connected are correctly configured in 'Tools/Board' and 'Tools/Serial Port'.


  6. Press 'Upload' button and uploading process will start.


  7. After a few seconds, if no errors an output message will appear indicating the correct uploading.


  8. Press 'Serial Monitor' button to capture the serial output from Waspmote.


  9. LEDs will blink and 'Hello World, this is Waspmote!' message will appear in 'Serial Monitor' window. This process will repeat all the time till Waspmote was powered down.



© 2009 Libelium Comunicaciones Distribuidas S.L.

| Terms of use