Interacting with Waspmote
Last updated
Last updated
This device allows to collect data which flows through the sensor network into a PC or device with a standard USB port. Waspmote Gateway will act as a "data bridge or access point" between the sensor network and the receiving equipment. This receiving equipment will be responsible for storing and using the data received depending on the specific needs of the application.
The receiving equipment can be a PC with Linux, Windows or Mac-OS, or any device compatible with standard USB connectivity. The gateway offers a male USB A connector, so the receiving device has to have a female USB A connector.
Once the Gateway is correctly installed, a new communication serial port connecting directly to the XBee module's UART appears in the receiving equipment, which allows the XBee to communicate directly with the device, being able to both receive data packets from the sensor network as well as modify and/or consult the XBee's configuration parameters.
Another important function worth pointing out is the possibility of updating or changing the XBee module's firmware.
Four indicator LEDs are included in the Gateway:
USB power LED: indicates that the board is powered through the USB port
RX LED: indicates that the board is receiving data from the USB port
TX LED: Indicates that the board is sending data to the USB port
I/O 5 configurable LED: associate
The configurable LED connected to the XBee's I/O 5 pin can be configured either as the XBee's digital output or as the XBee's indicator of association to the sensor network.
Reset: allows the XBee module to be reset
I/O - 0: button connected to the XBee's I/O pin 0
I/O - 1: button connected to the XBee's I/O pin 1
RTS - I/O - 6: button connected to the XBee's I/O pin 6
All the buttons connect each one of its corresponding data lines with GND with when pressed. None of these have pull-up resistance so it may be necessary to activate any of the XBee's internal pull-up resistances depending on the required use.
When using Linux it is possible to use various applications to capture the input from the serial port. Libelium recommends to use the 'Cutecom' application.
Once the application is launched, the speed and the USB where Waspmote has been connected must be configured.
The speed that must be selected is 115200 bps which is the standard speed set up for Waspmote.
The USB where Waspmote has been connected must be added the first time this application is run, adding USB0, USB1, etc (up to the USB number of each computer) according to where Waspmote has been connected. For this, the 'Device' window must be modified so that if Waspmote is connected to USB0, this window contains '/dev/ttyUSB0'.
Once these parameters are configured, capture is started by pressing the 'Open Device' button.
As well as using the terminal to see the sensor information, an application which allows this captured data to be dumped to a file or passed to another program to be used or checked has been developed.
File: "sniffer.c"
Compilation on Linux:
Examples of use:
Seeing received data: ./sniffer USB0
Dumping of received data to a file: ./sniffer USB0 >> data.txt
Passing received values to another program: ./sniffer USB0 | program
The speed used for the example is 19200 bps. The final speed will depend on the speed the XBee module has been configured with (default value 115200).
Code:
The code can be downloaded from: http://www.libelium.com/development/waspmote
If Windows is used, the application 'Hyperterminal' can be used to capture the output of the serial port.
This application can be found installed by default in 'Start/Programs/Accessories/Communication', but if it is not available it can be downloaded from: http://hyperterminal-private-edition-htpe.en.softonic.com/
Once this application is launched the connection must be configured. The first step is to give it a name:
The next step is to specify the port on which Waspmote has been connected, in this case the system recognizes it as 'COM9', (this will vary on each computer):
The next step is to specify the speed and configuration parameters:
Once these steps have been performed connection with Waspmote has been established, and listening to the serial port begins.
If Mac OS X is used (version later than 10.3.9) the application 'ZTERM' can be used to capture the serial port output. This application can be downloaded from: http://homepage.mac.com/dalverson/zterm/
This application is configured automatically, establishing the USB on which Waspmote has been connected and the speed.
The following image shows this application capturing Waspmote's output, while the example code 'Waspmote Accelerator Basic Example' is run.