Waspmote - v6.3 - 07/2016
Waspmote - v6.3 - 07/2016
Technical Guide
Index
INDEX
1. Waspmote Kit........................................................................................................................................ 6
1.1. General and safety information...............................................................................................................................................6
1.2. Conditions of use..........................................................................................................................................................................7
1.3. Assembly..........................................................................................................................................................................................9
3. Hardware............................................................................................................................................. 40
3.1. Modular Architecture............................................................................................................................................................... 40
3.2. Specifications.............................................................................................................................................................................. 40
3.3. Block Diagram............................................................................................................................................................................. 41
3.4. Electrical Data.............................................................................................................................................................................. 42
3.5. I/O ................................................................................................................................................................................................... 43
3.5.1. Analog.............................................................................................................................................................................44
3.5.2. Digital..............................................................................................................................................................................44
3.5.3. PWM.................................................................................................................................................................................44
3.5.4. UART................................................................................................................................................................................45
3.5.5. I2C.....................................................................................................................................................................................45
3.5.6. SPI.....................................................................................................................................................................................45
3.5.7. USB...................................................................................................................................................................................45
-2- v6.3
Index
5. Interruptions....................................................................................................................................... 50
6. Energy System.................................................................................................................................... 52
6.1. Concepts....................................................................................................................................................................................... 52
6.2. Sleep mode.................................................................................................................................................................................. 53
6.3. Deep Sleep mode...................................................................................................................................................................... 54
6.4. Hibernate mode......................................................................................................................................................................... 54
7. Sensors................................................................................................................................................ 56
7.1. Sensors in Waspmote............................................................................................................................................................... 56
7.1.1. Temperature..................................................................................................................................................................56
7.1.2. Accelerometer..............................................................................................................................................................57
7.2. Integration of new sensors..................................................................................................................................................... 61
7.3. Sensor Boards.............................................................................................................................................................................. 62
7.4. Power.............................................................................................................................................................................................. 66
8. 802.15.4/ZigBee.................................................................................................................................. 67
8.1. XBee-802.15.4............................................................................................................................................................................. 67
8.2. XBee - ZigBee.............................................................................................................................................................................. 70
8.3. XBee - 868..................................................................................................................................................................................... 72
8.4. XBee - 900..................................................................................................................................................................................... 74
8.5. XBee-DigiMesh........................................................................................................................................................................... 75
9. LoRaWAN............................................................................................................................................. 77
10. LoRa................................................................................................................................................... 78
10.1. RSSI............................................................................................................................................................................................... 80
11. Sigfox................................................................................................................................................. 81
12. WiFi.................................................................................................................................................... 82
12.1. WiFi Topologies......................................................................................................................................................................... 82
12.1.1. Access Point................................................................................................................................................................82
12.1.2. When is recommended to use Meshlium instead a standard WiFi router?.........................................84
-3- v6.3
Index
15. GSM/GPRS......................................................................................................................................... 91
16. GPRS+GPS........................................................................................................................................ 93
17. 3G + GPRS.......................................................................................................................................... 95
18. RFID/NFC........................................................................................................................................... 97
-4- v6.3
Index
-5- v6.3
Waspmote Kit
1. Waspmote Kit
1.1. General and safety information
•• In this section, the term “Waspmote” encompasses both the Waspmote device itself and its modules and sensor boards.
•• Please read carefully through the document “General Conditions of Libelium Sale and Use”.
•• Do not let the electronic parts come into contact with any steel elements, to avoid injuries and burns.
•• NEVER submerge the device in any liquid.
•• Keep the device in a dry place and away from any liquids that might spill.
•• Waspmote contains electronic components that are highly sensitive and can be accessed from outside; handle the devi-
ce with great care and avoid hitting or scratching any of the surfaces.
•• Check the product specifications section for the maximum allowed power voltage and amperage range and always use
current transformers and batteries that work within that range. Libelium will not be responsible for any malfunctions
caused by using the device with any batteries, power supplies or chargers other than those supplied by Libelium.
•• Keep the device within the range of temperatures stated in the specifications section.
•• Do not connect or power the device with damaged cables or batteries.
•• Place the device in a location that can only be accessed by maintenance operatives (restricted area).
•• In any case, keep children away from the device at all times.
•• If there is an electrical failure, disconnect the main switch immediately and disconnect the battery or any other power
supply that is being used.
•• If using a car lighter as a power supply, be sure to respect the voltage and current levels specified in the “Power Supplies”
section.
•• When using a battery as the power supply, whether in combination with a solar panel or not, be sure to use the voltage
and current levels specified in the “Power supplies” section.
•• If a software or hardware failure occurs, consult the Libelium Web Development section
•• Check that the frequencies and power levels of the radio communication modules and the integrated antennas are ap-
propriate for the location in which you intend to use the device.
•• The Waspmote device should be mounted in a protective enclosure, to protect it from environmental conditions such
as light, dust, humidity or sudden changes in temperature. The board should not be definitively installed “as is”, because
the electronic components would be left exposed to the open-air and could become damaged. For a ready-to-install
product, we advise our Plug & Sense! line.
DO NOT TRY TO RECHARGE THE NON-RECHARGEABLE BATTERY. IT MAY EXPLODE AND CAUSE INJURIES AND
DESTROY THE EQUIPMENT. DEVICES WITH NON-RECHARGEABLE BATTERIES MUST BE PROGRAMMED THROUGH
THE USB CABLE WITHOUT THE BATTERIES CONNECTED. PLEASE DOUBLE CHECK THIS CONDITION BEFORE
CONNECTING THE USB. DO NOT CONNECT EITHER UNDER ANY CIRCUMSTANCE THE SOLAR PANEL TO A DEVICE
WITH A NON-RECHARGEABLE BATTERY AS IT MAY EXPLODE AND CAUSE INJURIES AND DESTROY THE EQUIPMENT.
The document “General Conditions of Libelium Sale and Use” can be found at:
http://www.libelium.com/development/waspmote/technical_service
-6- v6.3
Waspmote Kit
•• Read the “General and Safety Information” section carefully and keep the manual for future reference.
•• Read carefully the “General Conditions of Sale and Use of Libelium”. This document can be found at:
http://www.libelium.com/development/waspmote/technical_service. As specified in the Warranty document, the client
has 7 days from the day the order is received to detect any failure and report that to Libelium. Any other failure reported
after these 7 days may not be considered under warranty.
•• Use Waspmote in accordance with the electrical specifications and in the environments described in the “Electrical Data”
section of this manual.
•• Waspmote and its components and modules are supplied as electronic boards to be integrated within a final product.
This product must have an enclosure to protect it from dust, humidity and other environmental interactions. If the pro-
duct is to be used outside, the enclosure must have an IP-65 rating, at the minimum. For a ready-to-install product, we
advise our Plug & Sense! line.
•• Do not place Waspmote in contact with metallic surfaces; they could cause short-circuits which will permanently dama-
ge it.
Specific:
•• Reset and ON/OFF button: Handle with care, do not force activation or use tools (pliers, screwdrivers, etc) to handle it.
•• Battery: Only use the original lithium battery provided with Waspmote.
•• Mini USB connection: Only use mini USB, mod. B, compatible cables.
•• Solar panel connection: Only use the connector specified in the Power supplies section and always respect polarity.
•• Lithium battery connection: Only use the connector specified in the Battery section and always respect polarity.
•• Micro SD card connection: Only use 2GB maximum micro SD cards. HC cards are not compatible. There are many SD
card models; any of them has defective blocks, which are ignored when using the Waspmote’s SD library. However,
when using OTA, those SD blocks cannot be avoided, so that the execution could crash. Libelium implements a special
process to ensure the SD cards we provide will work fine with OTA. The only SD cards that Libelium can assure that
work correctly with Waspmote are the SD cards we distribute officially.
•• Micro SD card: Make sure Waspmote is switched off before inserting or removing the SD card. Otherwise, the SD card
could be damaged.
•• Micro SD card: Waspmote must not be switched off or reseted while there are ongoing read or write operations in the
SD card. Otherwise, the SD card could be damaged and data could be lost.
•• GSM/GPRS board connection: Only use the original Waspmote GSM/GPRS board.
•• 3G/GPRS board connection: Only use the original Waspmote 3G/GPRS board.
•• XBee module connection: Waspmote allows the connection of any module from the XBee family, respect polarity when
connecting (see print).
•• Antenna connections: Each of the antennas that can be connected to Waspmote (or to its boards) must be connected
using the correct type of antenna and connector in each case, or using the correct adaptors.
•• USB voltage adaptors: To power and charge the Waspmote battery, use only the original accessories: 220V AC – USB
adaptor and 12V DC (car cigarette lighter) – USB adaptor
-7- v6.3
Waspmote Kit
The rechargeable, ion-lithium batteries, like the ones provided by Libelium (capacity of 6600 mAh), have certain characteristics
which must be taken into account:
•• Charge the batteries for 24 hours before a deployment. The aim is to have the charge of the batteries at 100% of their
capacity before a long period in which they must supply current, but it is not necessary to improve the performance.
•• It is not advised to let the charge of the batteries go below 20% of capacity, since they suffer stress. Thus, it is not advised
to wait for the battery to be at 0% to charge it.
•• Any battery self-discharges: connected to Waspmote or not, the battery loses charges by itself.
•• Maximum capacity loss: as the charge and discharge cycles happen, the maximum charge capacity is reduced.
•• Batteries work better in cool environments: their performance is better at 10 ºC than at 30 ºC.
•• At temperatures below 0 ºC, batteries can supply current (discharge), but the charge process cannot be done. In parti-
cular:
-- discharge range = [-10, 60] ºC
-- charge range = [0, 45] ºC
It is not reccommended to have the non-rechargeable batteries (13000, 26000, 52000 mA·h) connected to Waspmote when the
USB cable is conneted too. The reason is, Waspmote will try to inject current in them if the USB is connected. This is dangerous
for the good working of a non-rechargeable battery. It could be damaged or even damage Waspmote. That is to say, when you
need to upload code to Waspmote via USB, disconnect the battery if it is non-rechargeable. That applies to Waspmote OEM, but
not to the Plug & Sense! line, since its hardware is modified to avoid this.
Libelium may provide the nodes with enclosures which are suitable to operate outdoors. The user, as final installer, must take
great care when handling the product. We advise to read the Plug & Sense! Technical Guide to enlarge the life of your devices.
Remember that inappropriate use or handling of Waspmote will immediately invalidate the warranty.
-8- v6.3
Waspmote Kit
1.3. Assembly
•• Connect the antenna to the wireless module
-9- v6.3
Waspmote Kit
-10- v6.3
Waspmote Kit
•• Switch it on
-11- v6.3
Waspmote Kit
Insert the pick on the slot of the battery connector and pull straight out.
Do not pull the battery cables.
-12- v6.3
Waspmote Kit
-13- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Note: For a complete reference guide download the “Waspmote Plug & Sense! Technical Guide” in the Development section of the
Libelium website.
-14- v6.3
Waspmote Plug & Sense! - Encapsulated Line
For the internal option, the solar panel is embedded on the front of the enclosure, perfect for use where space is a major
challenge.
-15- v6.3
Waspmote Plug & Sense! - Encapsulated Line
The basic programming is done from the USB port. Just connect the USB to the specific external socket and then to the computer
to upload the new firmware.
-16- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Over the Air Programming is also possible once the node has been installed. With this technique you can reprogram wirelessly
one or more Waspmote sensor nodes at the same time by using a laptop and the Waspmote Gateway.
- km - Typical
868, 900 and 433 MHz
LoRaWAN LoRaWAN up to 18.5 dBm -136dBm base station
bands
range
LoRa RF 868 and 900 MHz 14 dBm -137dBm 21+Km
- km - Typical
Sigfox Sigfox 868MHz 14 dBm -126dBm base station
range
WiFi 802.11b/g 2.4GHz 0dBm - 12dBm -83dBm 50m-500m
850MHz/900MHz/ 2W(Class4) 850MHz/900MHz, - Km - Typical
GPRS Pro and GPRS+GPS - -109dBm
1800MHz/1900MHz 1W(Class1) 1800MHz/1900MHz carrier range
Europe version: Dual-
band UMTS, tri-band
GSM/GPRS/EDGE UMTS 0.25 W,
- Km - Typical
3G/GPRS - America/Australia GSM 2 W, -106dBm
carrier range
version: Dual-Band: DCS/PCS 1 W
UMTS, quad-Band GSM/
GPRS/EDGE
Bluetooth v.4.0 /
Bluetooth Low Energy 2.4GHz 3dBm -103dBm 100m
Bluetooth Smart
-17- v6.3
Waspmote Plug & Sense! - Encapsulated Line
http://www.libelium.com/development/plug_&_sense/sdk_and_applications/code_generator
Thanks to Meshlium’s new feature, the Sensor Parser, now it is easier to receive any frame, parse it and store the data into a local
or external Data Base.
Figure: Meshlium
-18- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2.1.8. Models
There are some defined configurations of Waspmote Plug & Sense! depending on which sensors are going to be used. Waspmote
Plug & Sense! configurations allows connecting up to six sensor probes at the same time.
Each model takes a different conditioning circuit to enable the sensor integration. For this reason each model allows to connect
just its specific sensors.
This section describes each model configuration in detail, showing the sensors which can be used in each case and how to
connect them to Waspmote. In many cases, the sensor sockets accept the connection of more than one sensor probe. See the
compatibility table for each model configuration to choose the best probe combination for the application.
It is very important to remark that each socket is designed only for one specific sensor, so they are not interchangeable.
Always be sure you connected probes in the right socket, otherwise they can be damaged.
-19- v6.3
Waspmote Plug & Sense! - Encapsulated Line
-20- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Temperature 9203
Humidity 9204
B
Atmospheric pressure 9250
Oxygen - O2 9231
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-21- v6.3
Waspmote Plug & Sense! - Encapsulated Line
-22- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-23- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Note: The probes attached in this photo could not match the final location. See next table for the correct configuration.
-24- v6.3
Waspmote Plug & Sense! - Encapsulated Line
As we see in the figure below, thanks to the directionable probe, the presence sensor probe (PIR) may be placed in different
positions. The sensor can be focused directly to the point we want.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-25- v6.3
Waspmote Plug & Sense! - Encapsulated Line
The Smart Water Ions line is complementary for these kinds of projects, enabling the control of concentration of ions like
Ammonium (NH4+), Bromide (Br-), Calcium (Ca2+), Chloride (Cl-), Cupric (Cu2+), Fluoride (F-), Iodide (I-), Lithium (Li+), Magnesium
(Mg2+), Nitrate (NO3-), Nitrite (NO2-), Perchlorate (ClO4-), Potassium (K+), Silver (Ag+), Sodium (Na+) and pH. Take a look to the Smart
Water Ions line in the next section.
-26- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-27- v6.3
Waspmote Plug & Sense! - Encapsulated Line
The Smart Water line is complementary for these kinds of projects, enabling the control of parameters like turbidity, conductivity,
oxidation-reduction potential and dissolved oxygen. Take a look to the Smart Water line in the previous section. Refer to Libelium
website for more information.
There are 3 variants for Smart Water Ions: Single, Double and PRO. This is related to the type of ion sensor that each variant can
integrate. Next section describes each configuration in detail.
-28- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Single
This variant includes a Single Junction Reference Probe, so it can read all the single type ion sensors.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, single variant
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-29- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Double
This variant includes a Double Junction Reference Probe, so it can read all the double type ion sensors.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, double variant
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-30- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Pro
This special variant integrates extreme quality sensors, with better performance than the Single or Double lines. In this case,
there is only one type of reference probe and up to 16 different ion parameters can be analyzed in 4 sockets.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, PRO variant
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-31- v6.3
Waspmote Plug & Sense! - Encapsulated Line
-32- v6.3
Waspmote Plug & Sense! - Encapsulated Line
As we see in the figure below, thanks to the directionable probe, the ultrasound sensor probe may be placed in different
positions. The sensor can be focused directly to the point we want to measure.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-33- v6.3
Waspmote Plug & Sense! - Encapsulated Line
The node benefits from Sigfox and LoRaWAN technologies (868 and 900 MHz bands), getting ubiquitous coverage with few
base stations. The device is very optimized in terms of power consumption, resulting in a long battery life. Its small size and the
robust and surface-mount enclosure enables a fast installation, without the need of digging a hole in the ground. Finally, the
developer does not need to program the node, but just configure some key parameters. Remote management and bidirectional
communication allow to change parameters from the Cloud.
There are specific documents for parking applications at Libelium website. Refer to Smart Parking Technical Guide to see
typical applications for this model and how to make a good installation.
-34- v6.3
Waspmote Plug & Sense! - Encapsulated Line
The main applications for this Waspmote Plug & Sense! model are precision agriculture, irrigation systems, greenhouses, weather
stations, etc. Refer to Libelium website for more information.
Two variants are possible for this model, normal and PRO. Next section describes each configuration in detail.
-35- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Normal
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
PRO
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-36- v6.3
Waspmote Plug & Sense! - Encapsulated Line
-37- v6.3
Waspmote Plug & Sense! - Encapsulated Line
As we see in the figure below, thanks to the directionable probe, the Luminosity sensor (Luxes accuracy) probe may be placed
in different positions. The sensor can be focused directly to the light source we want to measure.
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-38- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
-39- v6.3
Hardware
3. Hardware
3.1. Modular Architecture
Waspmote is based on a modular architecture. The idea is to integrate only the modules needed in each device. These modules
can be changed and expanded according to needs.
3.2. Specifications
•• Microcontroller: ATmega1281
•• Frequency: 14.7456 MHz
•• SRAM: 8KB
•• EEPROM: 4KB
•• FLASH: 128KB
•• SD Card: 2GB
•• Weight: 20gr
•• Dimensions: 73.5 x 51 x 13 mm
•• Temperature Range: [-10ºC, +65ºC]
-40- v6.3
Hardware
-41- v6.3
Hardware
Power signals:
-42- v6.3
Hardware
3.5. I/O
Waspmote can communicate with other external devices through the using different input/output ports.
Sensor connector:
-43- v6.3
Hardware
3.5.1. Analog
Waspmote has 7 accessible analog inputs in the sensor connector. Each input is directly connected to the microcontroller. The
microcontroller uses a 10 bit successive approximation analog to digital converter (ADC). The reference voltage value for the
inputs is 0V (GND). The maximum value of input voltage is 3.3V which corresponds with the microcontroller’s general power
voltage.
To obtain input values, the function analogRead(analog input) is used, the function’s input parameter will be the name of
the input to be read “ANALOG1, ANALOG2…” (see sensor connector figure). The value obtained from this function will be an
integer number between 0 and 1023, 0 corresponds to 0 V and 1023 to 3.3 V.
The analog input pins can also be used as digital input/output pins. If these pins are going to be used as digital ones, the
following correspondence list for pin names must be taken into account:
{
val = analogRead(ANALOG1);
}
3.5.2. Digital
Waspmote has digital pins which can be configured as input or output depending on the needs of the application. The voltage
values corresponding to the different digital values would be:
-- 0V for logic 0
-- 3.3V for logic 1
{
// set DIGITAL3 pin as input and read its value
pinMode(DIGITAL3, INPUT);
val = digitalRead(DIGITAL3);
3.5.3. PWM
DIGITAL1 pin can also be used as output PWM (Pulse Width Modulation) with which an analog signal can be “simulated”. It
is actually a square wave between 0V and 3.3V for which the proportion of time when the signal is high can be changed (its
working cycle) from 0% to 100%, simulating a voltage of 0V (0%) to 3.3V (100%).The resolution is 8 bit, so up to 255 values
between 0-100% can be configured. The instruction to control the PWM output is analogWrite(DIGITAL1, value); where
value is the analog value (0-255).
{
analogWrite(DIGITAL1, 127);
}
-44- v6.3
Hardware
3.5.4. UART
There are two UARTs in Waspmote: UART0 and UART1. Besides, there are several ports which might be connected to these
UARTs through two different multiplexers, one for each UART.
•• UART0 is shared by the USB port and the Socket0. This socket is used for XBee modules, LoRaWAN module, LoRa module,
Sigfox module, RFID/NFC module, Bluetooth modules, WiFi module, RS-485 module, etc. The multiplexer in this UART
controls the data signal which by default is always switched to Socket0. When the USB needs to send info through the
UART0, the multiplexer is momentarily switched to the USB port and set back again to Socket0 after printing.
•• UART1 is shared by four ports: Socket1, Auxiliar1 and Auxiliar2 sockets. It is possible to select in the same program which
of the four ports is connected to UART1 in the microcontroller. UART1 multiplexer configuration is carried out using the
following instructions:
{
Utils.setMuxAux1(); // set Auxiliar1 socket
Utils.setMuxAux2(); // set Auxiliar2 socket
Utils.setMuxGPS(); // set GPS socket
Utils.setMuxSocket1(); // set Socket1
}
3.5.5. I2C
The I2C communication bus is also used in Waspmote where two devices are connected in parallel: the accelerometer and the
RTC . In all cases, the microcontroller acts as master while the other devices connected to the bus are slaves.
3.5.6. SPI
The SPI port on the microcontroller is used for communication with the micro SD card. All operations using the bus are performed
clearly by the specific library. The SPI port is also available in the SPI/UART connector.
3.5.7. USB
USB is used in Waspmote for communication with a computer or compatible USB devices. This communication allows the
microcontroller’s program to be loaded.
For USB communication, microcontroller’s UART0 is used. The FT232RL chip carries out the conversion to USB standard.
“Sleep for 1h 20 min and 15sec, then wake up and perform the following action”
“Wake on the 5th of each month at 00:20 and perform the following action”
All RTC programming and control is done through the I2C bus.
Alarms:
Alarms can be programmed in the RTC specifying day/hour/minute/second. That allows total control about when the mote
wakes up to capture sensor values and perform actions programmed on it. This allows Waspmote to be in the saving energy
modes (Deep Sleep and Hibernate) and makes it wake up just at the required moment.
As well as relative alarms, periodic alarms can be programmed by giving a time measurement, so that Waspmote reprograms its
alarm automatically each time one is triggered.
-45- v6.3
Hardware
The RTC chosen is the Maxim DS3231SN, which operates at a frequency of 32.768Hz (a second divisor value which allows it to
quantify and calculate time variations with high precision).
The DS3231SN is one of the most accurate clocks on the market because of its internal compensation mechanism for the
oscillation variations produced in the quartz crystal by changes in temperature (Temperature Compensated Crystal Oscillator
– TCXO).
Most RTCs on the market have a variation of ± 20ppm which is equivalent to a 1.7s loss of accuracy per day (10.34min/year),
however, the model chosen for Waspmote has a loss of just ± 2ppm, which equates to variation of 0.16s per day (1min/year).
Source: Maxim-ic.com
The first figure above shows the temperature variation curve in a typical commercial clock, and the second figure, that for the
DS3231SN model built into Waspmote. As can be seen, variations in accuracy are practically zero at room temperature and
minimal when moved to the ends of the temperature scale.
(For more information about clock calibrating methods in real time, consult web page:
http://www.maxim-ic.com/appnotes.cfm/an_pk/3566)
The recalibration process of the oscillation crystal is carried out thanks to the data received by the RTC’s internal temperature
sensor. The value of this digital sensor can be accessed by Waspmote through the I2C bus, which lets it know the temperature
of the board at anytime in the range of -40ºC to +85ºC with an accuracy of 0.25°C. For more information about the acquisition
of this value by the microprocessor, see the section “Sensors in Waspmote → Temperature”.
Note: the RTC’s internal temperature sensor is only meant for the time derive compensation, but not for common air temperature
sensing (we advise our Sensor Boards for that).
The RTC is powered by the battery. When the mote is connected, the RTC is powered through the battery, but take into account
that if the battery is removed or out of load, then time data will be not maintained. That is why we suggest to use RTC time like
‘relative’ and not ‘absolute’ (see Programming Guide for more info).
A coin or button battery is not needed. They have a limited life and therefore Waspmote can have a much longer power life
expectancy. This is so because the RTC is powered from the “main” battery which has a much bigger charge.
The RTC is responsible for waking Waspmote up from 2 of the maximum energy saving modes Deep Sleep and Hibernate. This
makes possible for the Waspmote to use its battery just to power the RTC in sleep modes. The RTC controls when it has to wake
Waspmote up and perform a particular action. This allows a consumption of 0.06μA to be obtained in the Hibernate mode. See
sections “Energy System” → Sleep mode and Deepsleep mode”.
-46- v6.3
Hardware
3.7. LEDs
Programming
LED0 and LED1 are programmable. The functions for handling these LEDs are Utils.setLED(LED_SELECTED, LED_MODE)
and Utils.getLED(LED_SELECTED) and Utils.blinkLEDs() (see the API manual for more information about these
functions).
The other two LEDs switch on and off automatically according to their function.
{
Utils.setLED(LED0, LED_ON);
Utils.setLED(LED1, LED_OFF);
Utils.blinkLEDS(1000);
}
-47- v6.3
Architecture and System
When Waspmote is connected and starts the bootloader, there is a waiting time (62.5ms) before beginning the first instruction,
this time is used to start loading new compiled programs updates. If a new program is received from the USB during this time,
it will be loaded into the FLASH memory (128KB) substituting already existing programs. Otherwise, if a new program is not
received, the last program stored in the memory will start running.
The structure of the codes is divided into 2 basic parts: setup and loop. Both parts of the code have sequential behaviour,
executing instructions in the set order.
The setup is the first part of the code, which is only run once when the code is initialized. In this part it is recommended to
include the initialization of the modules which are going to be used, as well as the part of the code which is only important
when Waspmote is started.
The part named loop runs continuously, forming an infinite loop. Because of the behavior of this part of the code, the use of
interruptions is recommended to perform actions with Waspmote.
A common programming technique to save energy would be based on blocking the program (either keeping the micro awake
or asleep in particular cases) until some of interruptions available in Waspmote show that an event has occurred. This way, when
an interruption is detected the associated function, which was previously stored in an interruption vector, is executed.
To be able to detect the capture of interruptions during the execution of the code, a series of flags have been created and will
be activated to indicate the event which has generated the interruption (see chapters “Interruptions” and “Energy System”).
When Waspmote is reset or switched on, the code starts again from the setup function and then the loop function.
By default, variable values declared in the code and modified in execution will be lost when a reset occurs or there is no battery.
To store values permanently, it is necessary to use the microcontroller’s EEPROM (4KB) non-volatile memory. EEPROM addresses
from 0 to 1023 are used by Waspmote to save important data, so they must not be over-written. Thus, the available storage
addresses go from 1024 to 4095. Another option is to use of the high capacity 2GB SD card.
-48- v6.3
Architecture and System
4.2. Timers
Waspmote uses a quartz oscillator which works at a frequency of 14.7456 MHz as a system clock. In this way, every 125ns the
microcontroller runs a low level (machine language) instruction. It must be taken into account that each line of C++ code of a
program compiled by Waspmote includes several instructions in machine language.
Waspmote is a device prepared for operation in adverse conditions with regards to noise and electromagnetic contamination,
for this reason, to ensure stable communication at all times with the different modules connected through a serial line to the
UARTs (XBee, GPRS, USB) a maximum transmission speed of 115200bps has been set for XBee, GRPS and USB, so that the success
rate in received bits is 100%.
4.2.1. Watchdog
The Atmega 1281 microcontroller has an internal Enhanced Watchdog Time – WDT. The WDT precisely counts the clock cycles
generated by a 128KHz oscillator. The WDT generates an interruption signal when the counter reaches the set value. This
interruption signal can be used to wake the microcontroller from the Sleep mode or to generate an internal alarm when it is
running ON the mode, which is very useful when developing programs with timed interruptions.
The WDT allows the microcontroller to wake up from a low consumption Sleep mode by generating an interruption. For this
reason, this clock is used as a time-based alarm associated with the microcontroller’s Sleep mode. This allows very precise
control of small time intervals: 16ms, 32ms, 64ms, 128ms, 256ms, 500ms, 1s, 2s, 4s, 8s. For intervals over 8s (Deep Sleep
mode) the RTC is used.
More information about the interruptions generated by the Watchdog can be found in Energy chapter.
All information about their programming and operation can be found in the document: Energy and Power Programming Guide.
All the documentation is located in the Development section in the Libelium website.
4.2.2. RTC
As shown in the Hardware chapter, Waspmote has a real time clock (RTC) running a 32KHz (32.786Hz) which allows to set an
absolute time.
Alarms can be programmed in the RTC specifying day/hour/minute/second. This allows total control when the mote wakes up
to capture values and perform actions programmed on it. Also, the RTC allows Waspmote to function in the maximum energy
saving modes (Deep Sleep and Hibernate) and to wake up just at the required moment.
The RTC allows the microcontroller to be woken from the low consumption state by generating an interruption. For this reason,
it has been associated to the microcontroller’s Deep Sleep and Hibernate modes, making it possible to put the microcontroller
to sleep, and wake it up by activating an alarm in the RTC. Sleeping intervals can go from 8s, to minutes, hours or even days.
More information about the interruptions generated by the RTC and DeepSleep and Hibernate modes can be found in the Energy
management chapter.
All information about the RTC programming and operation can be found in the document: RTC Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-49- v6.3
Interruptions
5. Interruptions
Interruptions are signals received by the microcontroller which indicate it must stop the task is doing to attend to an event that
has just happened. Interruption control frees the microcontroller from having to control sensors all the time. It also makes the
sensors warn Waspmote when a determined value (threshold) is reached.
•• Synchronous Interruptions
They are programmed by timers. They allow to program when we want them to be triggered. There are two types of timer
alarms: periodic and relative.
-- Periodic Alarms are those to which we specify a particular moment in the future, for example: “Alarm programmed for
every fourth day of the month at 00:01 and 11 seconds”, they are controlled by the RTC.
-- Relative alarms are programmed taking into account the current moment, eg: “Alarm programmed for 5 minutes and 10
seconds”, they are controlled through the RTC and the microcontroller’s internal Watchdog.
•• Asynchronous Interruptions
These are not programmed so it is not known when they will be triggered. Types:
-- Sensors: the sensor boards can be programmed so that an alarm is triggered when a sensor reaches a certain threshold.
-- Accelerometer: The accelerometer that is built into the Waspmote can be programmed so that certain events such as
a fall or change of direction generate an interruption.
-- XBee module (Digimesh protocol only): Digimesh protocol allows the XBee to set cyclic sleep modes which can
interrupt Waspmote each time the module wakes up. This permits to set up cyclic sleep networks. So, Digimesh XBees
can wake up when certain internal timeout expires (however not when other node sends frames).
All interruptions, both synchronous and asynchronous can wake Waspmote up from the Sleep and the Deep Sleep mode.
However, only the synchronous interruption by the RTC is able to wake it up from the Hibernate mode.
The Hibernate mode totally disconnects the Waspmote power, leaving only the battery powering the RTC to wake Waspmote
up when the time alarm is reached. Because of this disconnection, when the RTC generates the corresponding alarm, the power
in Waspmote is reconnected and the code starts again from the setup.
-50- v6.3
Interruptions
The way of detecting whether a reboot from the Hibernate mode has happened is to check whether the corresponding flag
has been activated. Activation of this flag happens when the ifHibernate() function is called, which must be done at the
beginning of the setup part of the code. This way, when Waspmote starts, it tests if it is a normal start or if it is an start from the
Hibernate mode.
All information about the programming and operation of interruptions can be found in the document: Interruption Programming
Guide.
-51- v6.3
Energy System
6. Energy System
6.1. Concepts
Waspmote has 4 operational modes.
•• Sleep: In this mode some module functions are stopped and passed to asynchronous use, normally guided by events. It
functions differently in each module and is specific to each one (programmed by the manufacturer).
•• Hibernate: In this mode all module functions are stopped and passed to asynchronous use, normally guided by events.
It operates differently in each module and is specific to each one (programmed by the manufacturer).
•• OFF: By using digital switches controlled by the microcontroller the module is switched off completely. This mode has
been implemented by Libelium as an independent layer of energy control, so that it can reduce consumption to a
minimum (~0μA) without relegating to techniques implemented by the manufacturer.
For complete information about interruption types and their handling, see the Interruption chapter.
All information about the programming and operation of interruptions can be found in the document: Energy and Power
Programming Guide.
All the documentation is located in the Development section in the Libelium website.
Note: The sleep mode for XBee is not a very useful feature, since the advised action is to switch XBee off after transmission. If the user
puts XBee in sleep mode and also switches Waspmote to sleep or deepsleep, and if the SD card is plugged, there will be an excessive
power consumption: 220 μA or more (instead of the expected 110 μA). This is due to parasite power. To solve that, the user should not
use the XBee sleep mode. Another solution is to call sleep() or deepsleep() with ALL_OFF or SOCKET0_OFF parameters.
-52- v6.3
Energy System
In this mode the microcontroller stops executing the main program. The program stack where all the variables and log values
are stored keep their value, so when Waspmote returns to ON mode, the next instruction is executed and the variable values
are maintained.
The following example would set Waspmote in the Sleep mode for 32ms. The microprocessor would be in a state of minimum
consumption waiting for the synchronous interruption from the Watchdog.
{
PWR.sleep(WTD_32MS, ALL_OFF);
}
-53- v6.3
Energy System
In this mode the microcontroller stops executing the main program. The program stack where all the variables and log values
are stored keep their value, so when Waspmote returns to ON mode, the next instruction is executed and the variable values
are maintained.
In this mode the microcontroller does not store any values from variables or from the program stack. When leaving the Hibernate
state the micro is reset, so the setup and loop routines are run as if the main switch were activated.
-54- v6.3
Energy System
Hibernate mode requires the hibernate switch to be turned off correctly. It is necessary to follow the next steps when executing
the program for first time after uploading it to Waspmote:
The following example would set Waspmote in the Hibernate mode for 2 days, 1 hour and 30 minutes. The microcontroller
would be switched off waiting for the RTC to switch the device on again with a synchronous interruption.
{
PWR.hibernate(“02:01:30:00”, RTC_OFFSET, RTC_ALM1_MODE2);
}
Note: when the hibernate switch is off, RTC alarms must only be used to set the wake up from hibernate. See more details in the
Programming Guides for the RTC and Power Modes.
All information about the programming and operation of sleep modes can be found in the document: Energy and Power
Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-55- v6.3
Sensors
7. Sensors
7.1. Sensors in Waspmote
7.1.1. Temperature
The Waspmote RTC (DS3231SN from Maxim) has a built in internal temperature sensor which it uses to recalibrate itself.
Waspmote can access the value of this sensor through the I2C bus.
{
RTC.getTemperature();
}
The sensor is shown in a 10-bit two’s complement format. It has a resolution of 0.25º C. The measurable temperature range is
between -40ºC and +85ºC.
As previously specified, the sensor is prepared to measure the temperature of the board itself and can thereby compensate for
oscillations in the quartz crystal it uses as a clock. As it is a sensor built in to the RTC, for any application that requires a probe
temperature sensor, this must be integrated from the micro’s analog and digital inputs, as has been done in the case of the
sensor boards designed by Libelium.
More information about the RTC can be found in the “Hardware” and “Energy System” chapters.
All information about their programming and operation can be found in the document: RTC Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-56- v6.3
Sensors
7.1.2. Accelerometer
Waspmote has a built in acceleration sensor LIS3331LDH STMicroelectronics which informs the mote of acceleration variations
experienced on each one of the 3 axes (X,Y,Z).
The integration of this sensor allows the measurement of acceleration on the 3 axes (X,Y,Z), establishing 4 kind of events: Free
Fall, inertial wake up, 6D movement and 6D position which are explained in the Interruptions Programming Guide.
Figure: Accelerometer
The LIS331DLH has dynamically user selectable full scales of ±2g/±4g/±8g and it is capable of measuring accelerations with
output data rates from 0.5 Hz to 1 kHz.
The device features ultra low-power operational modes that allow advanced power saving and smart sleep to wake-up functions.
The accelerometer has 7 power modes, the output data rate (ODR) will depend on the power mode selected. The power modes
and output data rates are shown in this table:
-57- v6.3
Sensors
This accelerometer has an auto-test capability that allows the user to check the functioning of the sensor in the final application.
Its operational temperature range is between -40ºC and +85ºC.
The accelerometer communicates with the microcontroller through the I2C interface. The pins that are used for this task are the
SCL pin and the SDA pin, as well as another INT pin to generate the interruptions.
The accelerometer has 4 types of event which can generate an interrupt: free fall, inertial wake up, 6D movement and 6D
position.
To show the ease of programming, an extract of code about how to get the accelerometer values is included below:
{
ACC.ON();
ACC.getX();
ACC.getY();
ACC.getZ();
}
Some figures with possible uses of the accelerometer are shown below:
-58- v6.3
Sensors
Vibration:
Acceleration:
Free fall:
-59- v6.3
Sensors
Crash:
More information about interruptions generated by the accelerometer can be found in the chapter “Interruptions” and in the
Interruptions Programming Guide.
All information about their programming and operation can be found in the document: Accelerometer Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-60- v6.3
Sensors
The management of sensor board’s two power lines (described in more depth in the section ”Sensors” → Power) is carried out
through two solid state switches which allow the continuous passage of a current of up to 200mA and whose control can be
programmed using the functions included in the WaspPWR library, described in the files WaspPWR.h and WaspPWR.cpp.
The input and output voltage values for both digital and analog pins will be between 0/ and 3.3V, logic zero (‘0’) being found
in values less than 0.5V and logic one (‘1’) in values higher than 2.30V. To read analog signals, the microprocessor has a 10-bit
analog-to-digital converter which allows a resolution of 3mV. Waspmote also has one 8-bit resolution PWM output pin for the
generation of analog signals. Information on the libraries and instructions used for reading and writing on these pins can be
found in the API manual.
Waspmote includes 2 interruption pins, a low level (TXD1) one and a high level (RXD1) one, which offer an alternative to
reading the sensors by survey, allowing the microprocessor to be woken up when an event occurs (such as exceeding a certain
threshold in a comparator) which generates a change in a digital signal connected to one of the above pins, facilitating the
sensor reading only at the moments when a remarkable event occurs.
This option is especially recommended for low consumption sensors that may remain active for long periods of time. Reading
by survey (switched on and cyclical sensor reading after a set time) is more appropriate for those that, in addition to showing
greater consumption, do not require monitoring that generates an alarm signal. The interruptions can be managed using the
warning functions and vectors (flags) defined in the Winterruptions library, file Winterruptions.c. More can be learnt about their
use in the Interruptions Programming Guide.
Sensors reading can generate three types of response: storage of collected data (on the SD card), wireless transmission of
data (using a radiofrequency signal through the XBee/LoRaWAN/LoRa/Sigfox module or through the mobile communications
network using the GRPS module) or automatic activation through an actuator directly controlled by the microprocessor’s output
signals or through a switch or relay.
-61- v6.3
Sensors
-62- v6.3
Sensors
• Security • Pressure/Weight
Hall effect (doors and windows), person • Hall Effect
detection PIR • Temperature (+/-)
• Emergencies • Liquid Presence
Presence detection and water level • Liquid Level
sensors, temperature • Liquid flow
• Control of goods in logistics • Luminosity
• Presence (PIR)
-63- v6.3
Sensors
-64- v6.3
Sensors
It is possible to find more detailed information in the manual for each board at:
http://www.libelium.com/development/waspmote/documentation
-65- v6.3
Sensors
7.4. Power
In the sensor connector there are also several power pins, specifically GND, SENSOR POWER and 5V SENSOR POWER.
•• SENSOR POWER: 3.3V power voltage (200 mA maximum) which is controlled from the Waspmote execution code.
•• 5V SENSOR POWER: 5V power voltage (200 mA maximum) which is controlled from the Waspmote execution code.
-66- v6.3
802.15.4/ZigBee
8. 802.15.4/ZigBee
Waspmote integrates the Digi XBee modules for communication in the ISM (Industrial Scientific Medical) bands.
These modules communicate with the microcontroller using the UART_0 and UART_1 at 115200bps.
There are 4 possible XBee modules distributed by Libelium for integration in Waspmote.
* Line of sight and Fresnel zone clearance with 5dBi dipole antenna
These modules have been chosen for their high receiving sensitivity and transmission power, as well as for being 802.15.4
compliant (XBee-802.15.4 model) and ZigBee-Pro v2007 compliant (XBee-ZB model).
The XBee and LoRa modules integrated in Waspmote include RPSMA antenna connectors.
8.1. XBee-802.15.4
Module Frequency TX power Sensitivity Channels Distance
PRO 2,405 – 2,465GHz 63.1mW -100dBm 12 7000m
The frequency used is the free band of 2.4GHz, using 12 channels with a bandwidth of 5MHz per channel.
-67- v6.3
802.15.4/ZigBee
The XBee 802.15.4 modules comply with the standard IEEE 802.15.4 which defines the physical level and the link level (MAC
layer). The XBee modules add certain functionalities to those contributed by the standard, such as:
•• Node discovery: certain information has been added to the packet headers so that they can discover other nodes on the
same network. It allows a node discovery message to be sent, so that the rest of the network nodes respond indicating
their data (Node Identifier, @MAC, @16 bits, RSSI).
•• Duplicated packet detection: This functionality is not set out in the standard and is added by the XBee modules.
With a view to obtain frames totally compatible with the IEEE802.15.4 standard and enabling inter-operability with other
chipsets, the XBee.setMacMode(m) command has been created to select at any time if the modules are to use a totally
compatible heading format, or conversely enable the use of extra options for node discovery and duplicated packets detection.
Encryption is provided through the AES 128b algorithm. Specifically through the AES-CTR type. In this case the Frame Counter
field has a unique ID and encrypts all the information contained in the Payload field which is the place in the 802.15.4 frame
where data to be sent is stored.
The way in which the libraries have been developed for the module programming makes encryption activation as simple as
running the initialization function and giving it a key to use in the encryption process.
{
xbee802.setEncryptionMode(1);
xbee802.setLinkKey(key);
}
Extra information about the encryption systems in 802.15.4 and ZigBee sensor networks can be accessed in the Development
section of the Libelium website, specifically in the document: “Security in 802.15.4 and ZigBee networks”
The classic topology of this type of network is a star topology, as the nodes establish point to point connections with brother
nodes through the use of parameters such as the MAC or network address.
-68- v6.3
802.15.4/ZigBee
Regarding the “Energy” section, the transmission power can be adjusted to several values:
Parameter Tx XBee-PRO
0 10dBm
1 12dBm
2 14dBm
3 16dBm
4 18dBm
-69- v6.3
802.15.4/ZigBee
As ZigBee is supported in the IEEE 802.15.5 link layer, it uses the same channels as described in the previous section, with the
peculiarity that the XBee-ZB-PRO model limits the number of channels to 13.
The XBee-ZB modules comply with the ZigBee-PRO v2007 standard. These modules add certain functionalities to those
contributed by ZigBee, such as:
•• Node discovery: some headings are added so that other nodes within the same network can be discovered. It allows a
node discovery message to be sent, so that the rest of the network nodes respond indicating their specific information
(Node Identifier, @MAC, @16 bits, RSSI).
•• Duplicated packet detection: This functionality is not set out in the standard and is added by the XBee modules.
The topologies in which these modules can be used are: star and tree.
-70- v6.3
802.15.4/ZigBee
Regarding the “Energy” section, the transmission power cannot be adjusted, because it is always set to 17 dBm
-71- v6.3
802.15.4/ZigBee
Note: The XBee 868 MHz module is provided with 4.5dBi antenna, which enables maximum range.
The frequency used is the 869MHz band (Europe), using 1 single channel. The use of this module is only allowed in Europe. In
the chapter “Certifications”, more information can be obtained about the Certifications.
Encryption is provided through the AES 128b algorithm. Specifically through the type AES-CTR. In this case the Frame Counter
field has a unique ID and encrypts all the information contained in the Payload field which is the place in the link layer frame
where the data to be sent is stored.
The way in which the libraries have been developed for module programming means that encryption activation is as simple as
running the initialization function and giving it a key to use in the encryption.
{
xbee868.setEncryptionMode(1);
xbee868.setLinkKey(key);
}
The classic topology for this type of network is a star topology, as the nodes can establish point to point connections with
brother nodes through the use of the MAC address.
-72- v6.3
802.15.4/ZigBee
Regarding the “Energy” section, the transmission power can be adjusted to several values:
-73- v6.3
802.15.4/ZigBee
Note: The XBee 868 MHz module is provided with 4.5dBi antenna, which enables maximum range.
The frequency used is the 900MHz band, using 12 channels with a bandw idth of 2.16MHz per channel and a transmission
rate of 156.25kbps. The use of this module is only allowed in the United States and Canada. In the chapter “Certifications”, more
information can be obtained about the Certifications.
Encryption is provided through the AES 128b algorithm. Specifically through the type AES-CTR. In this case the Frame Counter
field has a unique ID and encrypts all the information contained in the Payload field which is the place in the link layer frame
where the data to be sent is stored.
The way in which the libraries have been developed for module programming means that encryption activation is as simple as
running the initialization function and giving it a key to use in the encryption.
{
xbee900.setEncryptionMode(1);
xbee900.setLinkKey(key);
}
-74- v6.3
802.15.4/ZigBee
The classic topology for this type of network is a star topology, as the nodes can establish point to point connections with
brother nodes through the use of parameters such as the MAC address or that of the network.
All information about their programming and operation can be found in the document: 900MHz Networking Guide.
All the documentation is located in the Development section in the Libelium website.
8.5. XBee-DigiMesh
The XBee-802.15.4 and XBee-900 modules can use an optional firmware (DigiMesh) so that they can create mesh networks
instead of the usual point to point topology. This firmware has been developed by Digi aimed for allowing modules to sleep,
synchronize themselves and work on equal terms, avoiding the use of node routers or coordinators that have to be permanently
powered on. Characteristics of the implemented protocol:
•• Self Healing: any node can join or leave the network at any moment.
•• All nodes are equal: there are no father-son relationships.
•• Silent protocol: reduced routing heading due to using a reactive protocol similar to AODV (Ad hoc On-Demand Vector
Routing).
•• Route discovery: instead of keeping a route map, routes are discovered when they are needed.
•• Selective ACKs: only the recipient responds to route messages.
•• Reliability: the use of ACKs ensures data transmission reliability.
•• Sleep Modes: low energy consumption modes with synchronization to wake at the same time.
-75- v6.3
802.15.4/ZigBee
The classic topology of this type of network is mesh, as the nodes can establish point to point connections with brother nodes
through the use the MAC address doing multi-hop connections when it is necessary.
DigiMesh 2.4GHz
The XBee DigiMesh modules share the hardware module with the XBee-802.15.4. So it is possible to change the firmware of this
kind of modules from one to another and vice versa. For this reason, the characteristics relating to the hardware are the same,
changing those related with the protocol used.
The XBee DigiMesh modules are based on the standard IEEE 802.15.4 that supports functionalities enabling mesh topology use.
DigiMesh 900MHz
The XBee DigiMesh modules share the hardware module with the XBee-900. So it is possible to change the firmware of this
kind of modules from one to another and vice versa. For this reason, the characteristics relating to the hardware are the same,
changing those related with the protocol used.
All information about their programming and operation can be found in the document: DigiMesh Networking Guide.
All the documentation is located in the Development section in the Libelium website.
-76- v6.3
LoRaWAN
9. LoRaWAN
LoRaWAN is a Low Power Wide Area Network (LPWAN) specification intended for wireless battery operated devices in regional,
national or global network. LoRaWAN target key requirements of Internet of things such as secure bi-directional communication,
mobility and localization services. This standard will provide seamless interoperability among smart Things without the need
of complex local installations and gives back the freedom to the user, developer, businesses enabling the role out of Internet of
Things.
LoRaWAN network architecture is typically laid out in a star-of-stars topology in which gateways is a transparent bridge relaying
messages between end-devices and a central network server in the back-end. Gateways are connected to the network server
via standard IP connections while end-devices use single-hop wireless communication to one or many gateways.
Figure: LoRaWAN module with normal antenna Figure: LoRaWAN module with 0 dBi antenna
Communication between end-devices and gateways is spread out on different frequency channels and data rates. The selection
of the data rate is a trade-off between communication range and message duration. Due to the spread spectrum technology,
communications with different data rates do not interfere with each other and create a set of “virtual” channels increasing the
capacity of the gateway. To maximize both battery life of the end-devices and overall network capacity, the LoRaWAN network
server is managing the data rate and RF output for each end-device individually by means of an adaptive data rate (ADR)
scheme.
-77- v6.3
LoRa
National wide networks targeting internet of things such as critical infrastructure, confidential personal data or critical functions
for the society has a special need for secure communication. This has been solved by several layer of encryption.
All the information about their programming and operation can be found in the LoRaWAN Networking Guide available at
Development section of Libelium website.
10. LoRa
•• Protocol: Own, developed at Libelium. Not compatible with LoRaWAN.
•• Model: Semtech SX1272
•• Frequencies available: 860-1000 MHz, fits both 868 (Europe) and 915 MHz (USA) ISM bands
•• Max TX power: 14 dBm
•• Sensitivity: -137 dBm
•• Range:
-- Line of Sight: 21+ km / 13.4+ miles (LoS and Fresnel zone clearance)
-- Non Line of Sight: 2+ km / 1.2+ miles (nLoS going through buildings, urban
environment)
•• Antenna:
-- 868 / 915 MHz: 0 / 4.5 dBi
-- Connector: RPSMA
•• Encryption: AES 128/192/256b (performed by Waspmote API)
•• Control Signal: RSSI
Figure: LoRa module
•• Topology: Star
•• Receiver/Central node: Meshlium LoRa, special Gateway LoRa (SPI) or another Waspmote or Plug & Sense! unit
Note: The XBee 868 MHz module is provided with 4.5dBi antenna, which enables maximum range.
This is the radio with the best range performance, thanks to the excellent receiver sensitivity that the LoRa™ technology offers.
Besides, Libelium developed a library which enables addressable, reliable and robust communications with ACK, re-tries or
time-outs strategies.
The user can set any frequency in the 868 and 900MHz bands, with pre-defined channels. The use of this module is allowed in
virtually any country.
-78- v6.3
LoRa
-79- v6.3
LoRa
Encryption is implemented in the application level, thanks to the Waspmote’s AES library. The payload inside the wireless packet
is encrypted so only nodes knowing the key can read the content. The encryption activation is as simple as running one of our
LoRa with AES encryption examples.
The topology for this type of network is a star topology, as the nodes can establish point to point connections with brother
nodes, normally with the central one.
All information about programming the LoRa module can be found in the document SX1272 LoRa Networking Guide.
All the documentation is located in the Development section in the Libelium website.
10.1. RSSI
The RSSI parameter (Received Signal Strength Indicator) indicates the signal quality of the last packet received. The XBee
modules provide this information in all protocol and frequency variants.
One of the most common functionalities in the use of RSSI is the creation of indoor localization systems by signal triangulation.
In Waspmote this value is obtained simply by executing the function (i.e. XBee-802.15.4):
{
xbee802.getRSSI();
}
-80- v6.3
Sigfox
11. Sigfox
Sigfox is a private company that aims to build a worldwide network especially designed for IoT devices. The network is cellular,
with thousands of base stations deployed in each country. Sigfox technology offers very long ranges for low-power, battery-
constrained nodes. Sigfox is great for very simple and autonomous devices which need to send small amounts of data to this
ubiquitous network, taking advantage on the Sigfox infrastructure.
So Sigfox is similar to cellular (GSM-GPRS-3G-4G) but is more energy-efficient, and the annual fees are lower.
Sigfox uses a UNB (Ultra Narrow Band) based radio technology to connect devices to its global network. The use of UNB is key to
providing a scalable, high-capacity network, with very low energy consumption, while maintaining a simple and easy to rollout
star-based cell infrastructure.
The network operates in the globally available ISM bands (license-free frequency bands) and co-exists in these frequencies
with other radio technologies, but without any risk of collisions or capacity problems. Sigfox currently uses the most popular
European ISM band on 868MHz (as defined by ETSI and CEPT).
Sigfox is being rolled out worldwide. It is the responsibility of the system integrator to consult the catalog of SNOs (Sigfox
Network Operators) for checking coverage in the deployment area.
The Sigfox back-end provides a web application interface for device management and configuration of data integration, as well
as standards based web APIs to automate the device management and implement the data integration.
-81- v6.3
WiFi
12. WiFi
The WiFi module for the Waspmote platform completes the current connectivity possibilities enabling the direct communication
of the sensor nodes with any WiFi router in the market. As well as this, this radio allows Waspmote to send directly the information
to any iPhone or Android Smartphones without the need of an intermediate router, what makes possible to create WiFi sensor
networks anywhere using just Waspmote and a mobile device as all of them run with batteries.
With this radio, Waspmote can make HTTP connections retrieving and sending information to the web and FTP servers, as well
as using TCP/IP and UDP/IP sockets in order to connect to any server located on the Internet.
Features:
Actions:
All information about their programming and operation can be found in the document: WiFi Networking Guide.
All the documentation is located in the Development section in the Libelium website.
Once associated with the Access Point, the nodes may ask for an IP address by using the DHCP protocol or use a preconfigured
static IP. The AP connection can be encrypted, in this case, you have to specify also the pass-phrase or key to the WiFi module.
The WiFi module supports these security modes: WEP-128, WPA2-PSK , WPA1-PSK, and WPA-PSK mixed mode.
-82- v6.3
WiFi
Nodes may also connect to a standard WiFi router with DSL or cable connectivity and send the data to a web server located on
the Internet. Then users are able to get this data from the Cloud. This is the typical scenario for companies which want to give
data accessibility services.
As pointed before, the WiFi module can join any standard WiFi router, however the connection may also be performed using
Meshlium instead of a standard WiFi router. Meshlium is the multiprotocol router designed by Libelium which is specially
recommended for outdoor applications as it is designed to resist the hardest conditions in real field deployments.
-83- v6.3
WiFi
Meshlium is also ready to deal with hundreds of nodes at the same time, receiving sensor
data from all of them and storing it in its internal database or sending it to an Internet
server. As well as this, Meshlium may work as a WiFi to 3G/GPRS gateway, giving access
to the internet to all the nodes in the network using the mobile phones infrastructure.
It is also important to mention that the transmission power of the WiFi interface
integrated in Meshlium is many times higher than the ones available in “home oriented”
WiFi routers so the distance we can get increases dramatically from a few meters to
dozens or even hundreds depending on the location of the nodes.
Using Meshlium as WiFi Access Point allows to control and to store the messages received
from the WiFi module, or allows to combine WiFi technology with other protocols such
as ZigBee. Meshlium may work as:
-84- v6.3
Bluetooth Pro
Waspmote may integrate a Bluetooth module for communication in the 2.4GHz ISM (Industrial Scientific Medical) bands.
-85- v6.3
Bluetooth Pro
Bluetooth uses 79 channels with a bandwidth of 1MHz per channel. In addition, Adaptive Frequency Hopping (AFH) is used to
enhance the transmissions.
•• MAC address: It is the unique identification number of the Bluetooth device. It has 12 hexadecimal digits separated by
“:”. One example could be “12:34:56:aa:bb”.
•• Public Name: It is the name that appears when a scan is performed in order to find new devices.
•• Class of Device (CoD): Bluetooth devices are classified according to the device which they are integrated. Therefore a ve-
hicle hands free device will belong to a different class than a pedestrian mobile phone. This parameter has 6 hexadecimal
digit and it allows distinguish if the detected Bluetooth device is a vehicle, a pedestrian, and so on.
•• RSSI (Received Signal Strength Indicator): This parameters shows quality of the radio link. It can be used to know the
distance between the Bluetooth module and the inquired device. It is shown as a negative value between -40 dBm (close
devices) and -90 dBm (far devices).
-86- v6.3
Bluetooth Pro
In the scanning process each Bluetooth device gives its “Class of Device” (CoD) attribute which allows to identify the type of
service it gives. We can differentiate easily the CoD’s generated by the car’s handsfree from the people’s phone ones.
There are seven different power levels which go from -27dBm to +3dBm in order to set different inquiry zones from 10 to 50m.
These zones can also be increased or decreased by using a different antenna for the module as it counts with an standard SMA
connector. The default antenna which comes with the module has a gain of 2dBi.
How do the Bluetooth and ZigBee radios coexist without causing interferences with each other?
ZigBee and Bluetooth work in the 2.4GHz frequency band (2.400 - 2.480MHz), however, the Bluetooth radio integrated in
Waspmote uses an algorithm called Adaptive Frequency Hopping (AFH) which improves the common algorithm used by
Bluetooth (FHSS) and enables the Bluetooth radio to dynamically identify channels already in use by ZigBee and WiFi devices
and to avoid them.
-87- v6.3
Bluetooth Pro
All information on their programming can be found in document: Bluetooth for device discovery Networking Guide.
All the documentation is located in the Development section in the Libelium website.
Note: If you want to detect iPhone and Android devices using the WiFi interface as well as the Bluetooth radio go to the
“Smartphone Detection” section in the Meshlium website: http://www.libelium.com/meshlium
-88- v6.3
Bluetooth Low Energy
BLE modules use the 2.4GHz band (2402MHz – 2480 MHz). It has 37 data channels and 3 advertisement channels, with a 2MHz
spacing and GFSK modulation.
-89- v6.3
Bluetooth Low Energy
In the same way as Bluetooth classic modules, other BLE modules can be identified by their MAC address and public name. Also,
the RSSI is provided to show the quality of each link.
All information on their programming can be found in document: Bluetooth Low Energy Networking Guide.
All the documentation is located in the Development section in the Libelium website.
-90- v6.3
GSM/GPRS
15. GSM/GPRS
Waspmote can integrate a GSM (Global System for Mobile communications) / GPRS (General Packet Radio Service) module to
enable communication using the mobile telephone network.
•• Making/Receiving calls
•• Making ‘x’ second lost calls
•• Sending/Receiving SMS
•• Single connection and multiple connections TCP/IP and UDP/IP clients
•• TCP/IP server.
•• HTTP Service
•• FTP Service (downloading and uploading files)
The functions implemented in the API allow to send information in a simple way, calling functions such as:
{
GPRS_Pro.sendSMS(message, number);
GPRS_Pro.makeLostCall(number, timeCall);
}
-91- v6.3
GSM/GPRS
This model uses the UART_1 at a baudarte of 57600bps speed to communicate with the microcontroller.
All information about their programming and operation can be found in the document: GSM/GPRS Programming Guide.
All the documentation is located in the Development section in the Libelium website.
* Note 1: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-92- v6.3
GPRS+GPS
16. GPRS+GPS
Waspmote can integrate a GSM (Global System for Mobile communications) / GPRS (General Packet Radio Service) module to
enable communication using the mobile telephone network. Also, this module integrates a GPS receiver.
GPRS features:
Quadband: 850MHz/900MHz/1800MHz/1900MHz
TX Power: 2W (Class 4) 850MHz/900MHz, 1W (Class 1) 1800MHz/1900MHz
Sensitivity: -109dBm
Antenna connector: UFL
External Antenna: 0dBi
Consumption in sleep mode: 1mA
Consumption in power off mode: 0mA
GPS features:
-93- v6.3
GPRS+GPS
•• Making/Receiving calls
•• Making ‘x’-second lost calls
•• Sending/Receiving SMS
•• Single connection and multiple connections TCP/IP and UDP/IP clients
•• TCP/IP server.
•• HTTP Service
•• FTP Service (downloading and uploading files)
•• GPS receiver
The functions implemented in the API allow to send information in a simple way, calling functions such as:
{
GPRS_SIM928A.sendSMS(message, number);
GPRS_SIM928A.makeLostCall(number, timeCall);
}
This model uses the UART_1 at a baudarte of 57600bps speed to communicate with the microcontroller.
All information about their programming and operation can be found in the document: GPRS+GPS Programming Guide.
All the documentation is located in the Development section in the Libelium website.
* Note 1: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-94- v6.3
3G + GPRS
17. 3G + GPRS
Waspmote can integrate a UMTS (Universal Mobile Telecommunication System based in WCDMA technology) / GPRS (General
Packet Radio Service) module to enable communication using the 3G/GPRS mobile telephone network.
-95- v6.3
3G + GPRS
The functions implemented in the API allow to send information in a simple way, calling functions such as:
{
_3G.sendSMS(message, number);
_3G.makeLostCall(number, timeCall);
}
This model uses the UART_1 at a baudrate of 115200 speed to communicate with the microcontroller.
All information about programming and operation can be found in the document: 3G + GPRS Networking Guide.
* Note 1: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-96- v6.3
RFID/NFC
18. RFID/NFC
13.56MHz
•• Compatibility: Reader/writer mode supporting ISO 14443A /
MIFARE / FeliCaTM / NFCIP-1
•• Distance: 5cm
•• Max capacity: 4KB
•• Tags: cards, keyrings, stickers
Applications:
•• Access management
•• Electronic prepaid metering (vending machines, public transport)
•• Smartphone interaction (NFCIP-1 protocol)
-97- v6.3
RFID/NFC
-98- v6.3
Industrial Protocols
-99- v6.3
Industrial Protocols
Applications:
•• Industrial Equipment
•• Machine to Machine (M2M) communications
•• Industrial Control Systems, including the most common versions of Modbus and Profibus
•• Programmable logic controllers
•• RS485 is also used in building automation
•• Interconnect security control panels and devices
-100- v6.3
Industrial Protocols
Applications:
•• Dialup modems
•• GPS receivers (typically NMEA 0183 at 4,800 bit/s)
•• Bar code scanners and other point of sale devices
•• LED and LCD text displays
•• Satellite phones, lowspeed satellite modems and other satellite based transceiver devices
•• Flatscreen (LCD and Plasma) monitors to control screen functions by external computer, other AV components or remotes
•• Test and measuring equipment such as digital multimeters and weighing systems
•• Updating Firmware on various consumer devices.
•• Some CNC controllers
•• Uninterruptible power supply
•• Stenography or Stenotype machines
•• Software debuggers that run on a 2nd computer
•• Industrial field buses
-101- v6.3
Industrial Protocols
Applications:
•• Automotive applications
•• Home automation
•• Industrial Networking
•• Factory automation
•• Marine electronics
•• Medical equipment
•• Military uses
-102- v6.3
Industrial Protocols
19.5. Modbus
The Modbus is a software library that can be operated physically on the RS-485 and RS-232 modules. Thus, Modbus is a software
layer which provides with interesting services.
Technical details:
•• Protocol: Modbus
•• Data area: Up to 255 bytes per job
•• Interface: Layer 7 of the ISO-OSI reference model
•• Connector: DB9 (RS-485 / RS-232 modules)
•• Number of possible connections: up to 32 in multi point systems
•• Frame format: RTU
Applications:
Figure: RS-485 module
•• Multiple master-slave applications
•• Sensors and Instruments
•• Industrial Networking
•• Building and infrastructure
•• Transportation and energy applications
{
W485.send(“Data from analog1 input: “);
W485.send(analog1);
}
{
W232.send(“Data from analog1 input: “);
W232.send(analog1);
}
{
// Read the last message received
CAN.getMessage(&CAN.messageRx);
// Print in the serial monitor the received message
CAN.printMessage(&CAN.messageRx);
}
-103- v6.3
Industrial Protocols
All information about their programming and operation can be found in the documents: RS-485 Communication Guide, RS-
232 Communication Guide, CAN Bus Communication Guide, Modbus Communication Guide.
All the documentation is located in the Development section in the Libelium website.
-104- v6.3
Expansion Radio Board
•• LoRaWAN - GPRS
•• 802.15.4 - Sigfox
•• 868 MHz - RS-485
•• RS-232 - WiFi
•• DigiMesh - 3G/GPRS
•• RS-232 - RFID/NFC
•• WiFi - 3G/GPRS
•• CAN bus - Bluetooth
•• etc.
Remark: GPRS Pro, GPRS+GPS and 3G/GPRS modules do not need the Expansion Board to be connected to Waspmote. They can be plugged
directly in the socket1.
Applications:
-105- v6.3
Over the Air Programming (OTA)
Besides, Libelium provides an OTA method based on FTP transmissions to be used with GPRS, GPRS+GPS, 3G and WiFi modules.
Note that the concept of OTA may have some other names such as:
21.2. Benefits
Libelium OTA Benefits:
To know more about OTA benefits and process, please read the Over the Air Programming Guide:
http://www.libelium.com/development/waspmote/documentation/over-the-air-programming-guide-otap/
-106- v6.3
Over the Air Programming (OTA)
21.3. Concepts
There are two different OTA methodologies:
Steps:
Topologies:
•• Direct access: when the nodes are accessed in just one hop (no forwarding of the packets is needed)
•• Multihop: when the nodes are accessed in two or more hops. In this mode some nodes have to forward the packets sent
by the Gateway in order to reach the destination
Protocols supported:
Storage System:
Once we have sent the program to Waspmote it will store it in the internal memory, a 2GB SD card.
If we have into account that the maximum size for a program is 128KB, this means we can store thousands different firmware
versions inside each node.
All the data which is sent in the OTA process can be secured by activating the encryption algorithm AES 128b which works in
the link layer. As well as this, a second pass key is needed to be known by the OTA programmer (the Gateway) in order to be
authenticated and validated by each node before starting with the OTA action requested.
-107- v6.3
Over the Air Programming (OTA)
OTA-Shell:
The OTA-Shell application can be used in Windows, Linux and MacOS. It allows to control in a quick and powerful way all the
options available in OTA. If you are using Meshlium as the Gateway of the network, the OTA-Shell environment comes already
preinstalled and ready to use. This is the recommended way when deploying a real scenario.
Steps:
Topologies:
• Protocols which support FTP transmissions are directly connected to the Network Access Point
Protocols supported:
Storage System:
Once the program is downloaded to Waspmote it is stored into the 2GB SD card
Meshlium provides an FTP server and Manager System plug-in which permits to configure the server automatically by attaching
the program binary file to be used.
-108- v6.3
Over the Air Programming (OTA)
-- Using the ‘scan_nodes’ function we can search for a specific node or send a global query looking for any node which is
ready to be reprogrammed with the OTA process.
-- The nodes which are ready at this moment will answer with a “Ready to OTA” frame.
-109- v6.3
Over the Air Programming (OTA)
-- We can use the ‘send’ command with the unicast, multicast or broadcast option depending on how many nodes we
want to reprogram at the same time.
-- Each node which receives the program sends a message to the gateway to inform of the success of the process.
-110- v6.3
Over the Air Programming (OTA)
-- In order to make the nodes start executing the new program, the gateway needs to send the ‘start_new_program’
command.
-- Each node which receives this packet will copy the program from the SD to the Flash memory and will start running the
new binary.
-111- v6.3
Over the Air Programming (OTA)
The environment needed to execute OTA Shell comes already preinstalled in Meshlium (the Linux router developed by Libelium
which acts as the XBee Gateway of the sensor network. See Meshlium chapter), although it can also be executed in a Linux,
Windows and Mac OS system.
All information on their programming can be found in document: Over the Air Programming (OTA).
All the documentation is located in the Development section in the Libelium website.
In order to know more about OTA including how to download and use the OTA Shell application please go to the Development
section:
http://www.libelium.com/development/waspmote/sdk_applications/
21.5.1. Procedure
The Waspmote reprogramming is done using an FTP server and an FTP client which is Waspmote itself. The FTP server can be
configured by Meshlium. Otherwise, the user will have to setup an FTP server.
-112- v6.3
Over the Air Programming (OTA)
•• Step 1: Waspmote requests a special text file which gives information about the program to update: program name,
version, size, etc.
•• Step 2: If the information given is correct, Waspmote queries the FTP server for a new program binary file and it updates
its flash memory in order to run the new program.
•• Extern user’s FTP server: The user sets up an FTP server following the specific settings which are described within OTA
Guide.
•• Meshlium FTP server: There is a specific plugin which allows the user to setup the FTP server automatically indicating the
new binary to be downloaded.
-113- v6.3
Encryption Libraries
•• Link Layer: In the first one all the nodes of the network share a common preshared key which is used to encrypt the in-
formation using AES 128. This process is carried out by specific hardware integrated in the same 802.15.4/ZigBee radio,
allowing the maximum efficiency of the sensor nodes energy consumption. This first security layer ensures no third party
devices will be able to even connect to the network (access control).
•• Secure Web Server Connection: The second security technique is carried out in Meshlium -the Gateway- where HTTPS
and SSH connections are used to send the information to the Cloud server located on the Internet.
A third optional encryption layer allows each node to encrypt the information using the Public key of the Cloud server. Thus,
the information will be kept confidentially all the way from the sensor device to the web or data base server on the Internet.
-114- v6.3
Encryption Libraries
Note: For more information read the “Encryption Programming Guide” in the Waspmote Development section
-115- v6.3
SD Memory Card
Waspmote uses the FAT16 file system and can support cards up to 2GB. The information that Waspmote stores in files on the
SD can be accessed from different operating systems such as Linux, Windows or Mac-OS. There are many SD card models; any of
them has defective blocks, which are ignored when using the Waspmote’s SD library. However, when using OTA, those SD blocks
cannot be avoided, so that the execution could crash.
Libelium implements a special process to ensure the SD cards we provide will work fine with OTA. The only SD cards that Libelium
can assure that work correctly with Waspmote are the SD cards we distribute officially.
To communicate with the SD module we use the SPI bus. This bus is a communication standard used to transfer information
between electronic devices which accept clock regulated bit flow. The SPI includes lines for the clock, incoming data and
outgoing data, and a selection pin.
The SD card is powered through a digital pin from the microcontroller. It is not therefore necessary to use a switch to cut the
power, putting a low pin value is enough to set the SD consumption to 0μA.
To get an idea of the capacity of information that can be stored in a 2GB card, simply divide its size by the average for what a
sensor frame in Waspmote usually occupies (approx. 100 Bytes):
The limit in files and directories creation per level is 256 files per directory and up to 256 sub-directories in each directory. There
is no limit in the number of nested levels.
-116- v6.3
SD Memory Card
{
SD.create(“FILE.TXT”);
SD.appendln(“FILE.TXT”, “This is a message”);
}
All information about their programming and operation can be found in the document: SD Card Programming Guide.
All the documentation is located in the Development section in the Libelium website.
Note: Make sure Waspmote is switched off before inserting or removing the SD card. Otherwise, the SD card could be damaged.
Note: Waspmote must not be switched off or reseted while there are ongoing read or write operations in the SD card. Otherwise, the
SD card could be damaged and data could be lost.
-117- v6.3
Energy Consumption
XBee
OFF
ON SLEEP SENDING RECEIVING
(Waspmote switches)
XBee 802.15.4 PRO 56,68mA 0,12mA 0μA 187,58mA 57,08mA
XBee ZigBee PRO 45,56mA 0,71mA 0μA 105mA 50,46mA
XBee 868 60,82mA -- 0μA 160mA 73mA
XBee 900 64,93mA 0,93mA 0μA 77mA 66mA
Bluetooth modules
ON OFF Sleep Scanning Sending Receiving
Bluetooth Pro 14 mA 0 mA <0,5 mA 40 mA 34 mA 20 mA
Bluetooth Low Energy 8 mA 0 mA 0.4 μA 36 mA 36 mA 36 mA
GPRS Pro
Connecting ~100mA
Calling ~100mA
Receiving Calls ~100mA
Transmitting GPRS ~100mA
SLEEP 1mA
OFF ~0μA
-118- v6.3
Energy Consumption
GPRS+GPS
Connecting ~100mA
Calling ~100mA
Receiving Calls ~100mA
Transmitting GPRS ~100mA
SLEEP 1mA
OFF ~0μA
GPS acquisition mode 72mA
GPS tracking mode 67mA
3G/GPRS
Connecting ~100mA
Transmitting/Receiving GPRS ~100mA (1.2A – 2A during transmission slot every 4.7ms )
Transmitting/Receiving 3G ~300mA - 500mA
SLEEP 1mA
OFF ~0μA
SD
ON 0.14mA
Reading 0.2mA
Writing 0.2mA
OFF 0μA
Accelerometer
Sleep 0,08mA
Hibernate 0,65mA
OFF ~0μA
-119- v6.3
Power supplies
Waspmote has a control and safety circuit which makes sure the battery charge current is always adequate.
Battery connection
The figure below shows the connector in which the battery is to be connected. The position of the battery connector is unique,
therefore it will always be connected correctly (unless the connector is forced).
-120- v6.3
Power supplies
The following two images show battery discharging and charging curves.
Battery discharging
-121- v6.3
Power supplies
Warning: Batteries with voltage over 3.7V could irreparably damage Waspmote.
Incorrect battery connection could irreparably damage Waspmote.
DO NOT TRY TO RECHARGE THE NON-RECHARGEABLE BATTERY. IT MAY EXPLODE AND CAUSE INJURIES AND
DESTROY THE EQUIPMENT. DEVICES WITH NON-RECHARGEABLE BATTERIES MUST BE PROGRAMMED THROUGH
THE USB CABLE WITHOUT THE BATTERIES CONNECTED. PLEASE DOUBLE CHECK THIS CONDITION BEFORE
CONNECTING THE USB. DO NOT CONNECT EITHER UNDER ANY CIRCUMSTANCE THE SOLAR PANEL TO A DEVICE
WITH A NON-RECHARGEABLE BATTERY AS IT MAY EXPLODE AND CAUSE INJURIES AND DESTROY THE EQUIPMENT.
-122- v6.3
Power supplies
Both the mini USB connector and the solar panel connector allow only one connection position which must be respected
without being forced into the incorrect position. In this way connection polarity is respected.
Solar panels up to 12V are allowed. The maximum charging current through the solar panel is 280mA.
-123- v6.3
Power supplies
-124- v6.3
Power supplies
25.3. USB
-- USB to PC connection
-- USB to 220V connection
-- USB to Vehicle connector connection
-125- v6.3
Power supplies
Figure: 220V AC – USB adapter Figure: 12V DC – USB car lighter adapter
-126- v6.3
Working environment
The Waspmote IDE is based on open source Arduino platform compiler, following the same style of libraries and operation. It
is important to use the version found on the Waspmote website and no other version of the Arduino IDE. This is because the
version available on the Libelium website has been properly tested so we can assure optimum operation.
The Waspmote IDE includes all the API libraries necessary to compile the programs; it is valid for both Waspmote and Waspmote
Plug & Sense! platforms.
The file which contains the compiler and the libraries is called “waspmote-pro-ide-vxx” -<OS>” (xx corresponds to the version
name and OS to the operating system). This file contains a folder with the Waspmote compiler, which must be extracted to the
desired route. The Waspmote libraries are integrated in this folder, being available when the compiler is run.
To be able to run the compilation from a code successfully, a series of applications must be installed on the computer. The
applications to install vary according to the O.S. used.
The API is divided into two different folders: core and libraries. The core folder contains the basic files and the most common
utilities for the Waspmote device. The libraries folder contains the API related to the different modules and features Waspmote
can manage.
In order to update to future library versions, the API must be modified within the “hardware/cores” and “hardware/libraries”
folders found inside the previously unzipped folder.
The next step will be to install the Waspmote IDE. Libelium created a dedicated guide for this task. It is called “Waspmote IDE:
User Guide”, and can be found on Libelium website software section:
http://www.libelium.com/development/waspmote/sdk_applications
This guide will explain in detail how to install the IDE, how to use it, to compile programs or upload sketches. There are details
on the libraries structure too. We advise to read this guide carefully.
If it is the first time you plug a Waspmote on your PC and you are unable to see the proper USB port, maybe you should install
the latest FTDI drivers: http://www.ftdichip.com/Drivers/D2XX.htm
Moreover, if you have troubles installing FTDI drivers and your computer is unable to recognize Waspmote, please follow the
installation guide for your operating system on your next link: http://www.ftdichip.com/Support/Documents/InstallGuides.htm
Steps:
-127- v6.3
Working environment
Every packet contains a message with sensor data formatted as Waspmote Data Frame. For further information, please check
the Waspmote Data Frame Guide in:
http://www.libelium.com/development/waspmote/documentation/programming
Example:
~\0x00I\0x90\0x00}3\0xa2\0x00@z\0xcb\0x92\0xd8\0xd3\0x02<=>\0x80\0x03#35689722#WASPMOTE#7#A
CC:80;10;987#IN_TEMP:22.50#BAT:93#\0xb4
Initially there are some hexadecimal characters, which belong to the API frame, followed by the message. In the above example
the message is:
<=>\0x80\0x03#35689722#WASPMOTE#7#ACC:80;10;987#IN_TEMP:22.50#BAT:93#
In the next chapter is shown how to compile and upload a first program in Waspmote.
26.2. Compilation
To use the Waspmote IDE compiler we must run the executable script called ‘Waspmote’, which is in the folder where the
compiler has been installed.
Waspmote is divided into 4 main parts which can be seen in the following figure.
-128- v6.3
Working environment
•• The first part is the menu which allows configuration of general parameters such as the selected serial port.
•• The second part is a button menu which allows verification, opening, saving or loading the selected code on the board.
•• The third part contains the main code which will be loaded in Waspmote.
•• The fourth part shows us the possible compilation and load errors, as well as the success messages if the process is car-
ried out satisfactorily.
The Waspmote IDE buttons panel allows certain functions to be carried out such as opening a previously saved code, creating a
new one or loading the code on the board. The following figure shows the panel and the functions of each button.
Once the program has been opened correctly some configuration changes must be made so that the programs load correctly
in Waspmote.
In the ‘Tools/Board’ tab the Waspmote board must be selected. This refers to the API selected.
In the ‘Tools/Serial Port’ tab, the USB to which Waspmote has been connected to the computer must be selected.
Once these 2 parameters have been configured we can load a program onto Waspmote. The process will be explained using a
very simple example. A series of examples for learning and familiarizing yourself with the Waspmote environment have been
included in the downloaded file that contains the compiler.
The simplest example is the file called ‘test.pde’. In this example the text string “Hello World!” appears on the screen. The example
shows how to load a program onto Waspmote and how to show information on the screen.
The next step is to configure the folder where the created programs are going to be saved. In the Waspmote IDE this folder is
called ‘sketchbook’ and can be configured by accessing the ‘File/Preferences’ tab. Clicking on this tab will open a new window
where the location of the sketchbook can be indicated. Once the sketchbook folder path is indicated, the downloaded test
program must be saved in this folder.
Waspmote IDE must be closed so that the changes and the newly saved program in the sketchbook folder are reflected.
Run Waspmote again and open the downloaded test program by clicking on ‘Open’.
Select the ‘test.pde’ file in the path where it has been unzipped and open it. As can be seen, it is a very simple code which lights
up a LED every 3 seconds and writes “Hello World!” on the screen.
The next step is to load the program onto Waspmote. To do this Waspmote must be connected to the computer through the
USB and the button ‘upload’ must be clicked. Then, it will start compiling the program. When the program has been compiled
correctly, a message will appear on the lower part of the window indicating this event. Conversely, if a fault occurs, red messages
will appear indicating the bugs in the code. When compiling is over, the code will be loaded onto Waspmote.
When the program has been loaded correctly, a message appears in the Waspmote window indicating ‘Done Uploading’.
Conversely, if some problem occurs during loading, red messages will appear indicating the failures.
Once this program is loaded onto the board, the loaded code will run as was explained in the Architecture and System chapter.
Note: The Gateway is just a UART-USB bridge. This means that the Gateway cannot be programmed and no code can not be uploaded.
Its function is to pass data from the XBee to the USB, and vice-versa.
-129- v6.3
Working environment
26.3. API
An API (Application Programming Interface) has been developed to facilitate applications programming using Waspmote. This
API includes all the modules integrated in Waspmote, as well as the handling of other functionalities such as interruptions or
the different energy modes.
The API has been developed in C/C++, structured in the following way: core folder and libraries folder.
General configuration
Files: WaspClasses.h, WaspVariables.h, WaspConstants.h, Wconstants.h, pins_waspmote.h, pins_waspmote.c, WaspUtils.h, WaspUtils.
cpp, WProgram.h
1. WaspClasses.h: all the types to be run on the Waspmote API are defined. If any new type wants to be added, it will be necessary
to include it in this file for correct compilation.
2. WaspVariables.h: 4 global variables used as flags for interruptions are defined. These variables are accessible from the files in
C, C++ or the main code in the Waspmote compiler.
3. WaspConstants.h: multiple general constants used in the API are defined, as well as all the pins and constants related to the
interruptions.
4. Wconstants.h: more constants are defined.
5. pins_waspmote.h, pins_waspmote.c: the microcontroller’s pins and the names to which they are associated are defined.
6. WaspUtils.h, WaspUtils.cpp: series of functions for generic use such as light up LEDs, number conversions, strings handling,
EEPROM memory, etc.
7. Waspmote.h: is the file which runs when launching the Waspmote compiler. WaspClasses.h and WaspVariables.h are included
in it.
Shared
Files: binary.h, HardwareSerial.h, HardwareSerial.cpp, WaspRegisters.h, WaspRegisters.c, wiring_analog.c, wiring.h, wiring.c, wiring_
digital.c, wiring_private.h, wiring_pulse.c, wiring_serial.c, wiring_shift.c
Generic functions used are defined in these files, such as the treatment of number types, writing in the UARTs, etc.
SD Storage
Files: Sd2Card.h, Sd2Card.cpp, Sd2Fat.h, Sd2FatStructs.h, Sd2File.cpp, Sd2Info.h, Sd2PinMap.h, Sd2Volume.cpp, WaspSD.h, WaspSD.
cpp
The functions needed for storing writing and reading the SD card are defined in these files.
•• Sd2Card.h, Sd2Card.cpp, Sd2Fat.h, Sd2FatStructs.h, Sd2File.cpp, Sd2Info.h, Sd2PinMap.h, Sd2Volume.cpp: files that ma-
nage the SD card at a low level.
•• WaspSD.h, WaspSD.cpp: files that define the necessary functions to read and write information on the SD card.
I2C communication
Files: twi.h, twi.c, Wire.h, Wire.cpp
The functions needed for communication using the I2C bus. These functions are subsequently used by the modules which work
with the I2C, such as the accelerometer, the RTC and the sensors.
-130- v6.3
Working environment
Accelerometer
Files: WaspACC.h, WaspACC.cpp
The functions needed for reading the accelerometer are defined in these files. The functions needed to activate or deactivate
interruptions in this sensor are also defined.
Energy Control
Files: WaspPWR.h, WaspPWR.cpp
The functions needed to activate the different low consumption modes (Sleep, Deep Sleep o Hibernate). The functions needed
to obtain the remaining battery value, close the I2C bus and clear interruptions that have been captured are also defined.
RTC
Files: WaspRTC.h, WaspRTC.cpp
The functions needed to obtain the date and time from the internal clock (RTC). The functions needed to activate the alarms and
interruptions generated by this module are also defined.
USB
Files: WaspUSB.h, WaspUSB.cpp
The functions needed to use the USB and send/receive information from the computer.
Interruptions
Files: Winterruptions.c
The functions needed for interruptions activation and their subsequent treatment are defined in this file. The interruption
subroutines that run when interruptions are captured are defined, as well as the functions for interruption activation and
deactivation. Flags corresponding to these functions are marked.
XBee Core
Files: WaspXBeeCore.h, WaspXBee.cpp
The functions that are common to all the XBee modules are defined, such as sending and receiving packets, node discovery or
configuration functions that most XBee modules available on Waspmote have. Besides, there are constants used in the libraries
related to the XBee modules.
GPRS_Pro Core
The functions that are common to GPRS Pro and GPRS+GPS modules are defined, such as send AT commands, HTTP request,
FTP transfers that GPRS modules on Waspmote have. Besides, there are constants used in the libraries related to the GPRS Pro
and GPRS+GPS modules.
GPRS Pro
Files: WaspGPRS_Pro.h, WaspGPRS_Pro.cpp
The functions needed for receiving and sending calls, SMS or data using the GSM/GPRS network.
-131- v6.3
Working environment
GPRS+GPS
Files: WaspGPRS_SIM928A.h, WaspGPRS_SIM928A.cpp
The functions needed for receiving and sending calls, SMS, data using the GSM/GPRS network and manage GPS receiver.
3G/GPRS
Files: Wasp3G.h, Wasp3G.cpp
The functions needed for receiving and sending calls, SMS or data using the 3G/GPRS network and for manage the Video Camera
Sensor Board.
Sensors
Files:
The functions needed to manage the different sensor boards available on Waspmote.
XBee Libraries
The functions needed to set up, control and use a 802.15.4/ZigBee network.
XBee802: WaspXBee802.h, WaspXBee802.cpp: the specific functions of the XBee 802.15.4 and the shared general library
functions are inherited.
XBeeZB: WaspXBeeZB.h, WaspXBeeZB.cpp: the specific functions of the XBee ZigBee modules are defined and the shared
general library functions are inherited.
XBeeDM: WaspXBeeDM.h, WaspXBeeDM.cpp: the specific functions of the XBee DigiMesh and 900MHz are defined, and the
shared general library functions are inherited.
XBee868: WaspXBee868.h, WaspXBee868.cpp: the specific functions of the XBee 868MHz modules are defined and the shared
general library functions are inherited.
XBee900: WaspXBee900.h, WaspXBee900.cpp: the specific functions of the XBee 900MHz modules are defined and the shared
general library functions are inherited.
LoRaWAN
LoRa
-132- v6.3
Working environment
Sigfox
Frame
Files: WaspFrame.h, WaspFrame.cpp
The functions needed to create new data frames by adding different sensor values.
StackEEPROM
Files:WaspStackEEPROM.h, WaspStackEEPROM .cpp
The functions needed to use the EEPROM available memory like an stack.
Bluetooth Pro
Files: WaspBT_Pro.h, WaspBT_Pro.cpp
The functions needed to manage the Bluetooth module for scanning devices.
WiFi
Files: WaspWIFI.h, WaspWIFI.cpp
RFID/NFC
Files: WaspRFID13.h, WaspRFID13.cpp
Industrial Protocols
Files:
-133- v6.3
Working environment
These new versions are downloaded in a file similar to “waspmote-pro-api-vxxx.zip” (xxx being the current version). This file
contains 2 folders: “waspmote-api” and “libraries”. The content of these 2 folders must be overwritten on the IDE folders of the
same name.
Once these folders are replaced, the API is updated to the new version.
It is not possible to have 2 different APIs in the IDE at the same time. The solution is simple: to have several IDEs installed in the
PC, one IDE for each API we want to handle. However, it is not recommended to work with old API versions, new versions are
more stable and offer more features.
-134- v6.3
Interacting with Waspmote
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 “plug” USB A connector, so the receiving device has to have a “receptacle“ 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.
-135- v6.3
Interacting with Waspmote
LEDs
-- USB power LED: indicates that the board is powered through the USB port
-- X 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.
Buttons
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.
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 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.
-136- v6.3
Interacting with Waspmote
Linux Sniffer
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 Meshlium:
gcc sniffer.c -o sniffer
Examples of use:
Note: the speed used for the example is 19200 baud. The final speed will depend on the speed the XBee module has been configured
with (default value 115200).
Code:
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
-137- v6.3
Interacting with Waspmote
if(argc!=2)
{
fprintf(stderr,”Usage: %s [port]\nValid ports: (S0, S1, USB0, USB1)\n”,argv[0], serial-
Port);
exit(0);
}
if (!strcmp(argv[1], s0))
{
fprintf(stderr,”ttyS0 chosen\n...”);
serialPort = serialPort0;
}
if (!strcmp(argv[1], s1))
{
fprintf(stderr,”ttyS1 chosen\n...”);
serialPort = serialPort1;
}
if (!strcmp(argv[1], u0))
{
fprintf(stderr,”ttyUSB0 chosen\n...”);
serialPort = USBserialPort0;
}
if (!strcmp(argv[1], u1))
{
fprintf(stderr,”ttyUSB1 chosen\n...”);
serialPort=USBserialPort1;
}
if (!strcmp(serialPort, ””))
{
fprintf(stderr, ”Choose a valid port (S0, S1, USB0, USB1)\n”, serialPort);
exit(0);
}
-138- v6.3
Interacting with Waspmote
else
{
if (!sd)
{
sd = open(serialPort, O_RDWR | O_NOCTTY | O_NDELAY);
}
//fprintf(stderr,”Serial Port open at: %i\n”, sd);
fcntl(sd, F_SETFL, 0);
}
tcgetattr(sd, &opciones);
cfsetispeed(&opciones, B19200);
cfsetospeed(&opciones, B19200);
opciones.c_cflag |= (CLOCAL | CREAD);
/*No parity*/
// We start filling the string until the end of line char arrives
// or we reach the end of the string. Then we write it on the screen.
if ((c==’\n’) || (j==(MAX-1)))
{
int x;
for (x=0; x<j; x++)
{
write(2, &valor[x], 1);
valor[x] = ’\0’;
}
j = 0;
}
}
close(sd);
}
-139- v6.3
Interacting with Waspmote
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):
-140- v6.3
Interacting with Waspmote
Once these steps have been performed connection with Waspmote has been established, and listening to the serial port begins.
-141- v6.3
Interacting with Waspmote
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.
-142- v6.3
Interacting with Waspmote
27.2. Meshlium
Meshlium is a Linux router which works as the Gateway of the Waspmote Sensor Networks. It can contain 5 different radio
interfaces: WiFi 2.4GHz, WiFi 5GHz, 3G/GPRS, Bluetooth and XBee/LoRa. As well as this, Meshlium can be solar and battery
powered. These features a long with an aluminium IP-65 enclosure allows Meshlium to be placed anywhere outdoor. Meshlium
comes with the Manager System, a web application which allows to control quickly and easily the WiFi, XBee, LoRa, Bluetooth
and 3G/GPRS configurations a long with the storage options of the sensor data received.
Meshlium Xtreme allows you to detect iPhone and Android devices and in general any device which works with WiFi or Bluetooth
interfaces. The idea is to be able to measure the amount of people and cars which are present in a certain point at a specific time,
allowing the study of the evolution of the traffic congestion of pedestrians and vehicles.
-143- v6.3
Interacting with Waspmote
1. Store the sensor data in the Meshlium Local Data Base (MySQL)
2. Store the sensor data in an External Data Base (MySQL)
3. Send the information to the Internet using the Ethernet or WiFi connection
4. Send the information to the Internet using the 3G/GPRS connection
-144- v6.3
Interacting with Waspmote
27.2.3. Capturing and storing sensor data in Meshlium from a Waspmote sensor network
When you buy a kit containing Waspmotes, Gateway and Meshlium, the Waspmotes come already configured to send frames to
the Gateway. Later, once the user has developed the code for transmitting to Gateway, he can switch to Meshlium.
Meshlium will receive the sensor data sent by Waspmote using the wireless radio and it will store the frames in the Local Data
Base. That can be done in an automatic way thanks to the Sensor Parser.
The Sensor Parser is a software system which is able to do the following tasks in an easy and transparent way:
•• receive frames from XBee and LoRa (with the Data Frame format)
•• receive frames from 3G/GPRS, WiFi and Ethernet via HTTP protocol (Manager System version 3.1.4 and above)
•• parse these frames
•• store the data in a local Database
•• synchronize the local Database with an external Database
The initial frames sent by Waspmote contain the next sequence (API frame characters are removed here):
<=>\0x80\0x03#35689722##7#ACC:80;10;987#IN_TEMP:22.50#BAT:93#
They are formed by the accelerometer values, RTC internal temperature value, and battery level. The MAC address is added and
other helpful information.
Meshlium comes with all the radios ready to be used. Just “plug & mesh!”. All the Meshlium nodes come with the WiFi AP ready
so that users can connect using their WiFi devices. Connect the Ethernet cable to your network hub, restart Meshlium and it will
automatically get an IP from your network using DHCP *.
(*) For the Meshlium Mesh AP and for the Meshlium XBee Mesh AP the Internet connection depends on the GW of the network.
Then access Meshlium through the WiFi connection. First of all search the available access points and connect to “Meshlium”.
No password is needed as the network is public (you can change it later in the WiFi AP Interface options). When you select it,
Meshlium will give an IP from the range 10.10.10.10 - 10.10.10.250.
-145- v6.3
Interacting with Waspmote
Now you can open your browser and access to the Meshlium Manager System:
• URL: http://10.10.10.1/ManagerSystem
• user: root
• password: libelium
-146- v6.3
Interacting with Waspmote
Depending the kind of XBee model the parameters to be configured may vary.
Complete list:
-147- v6.3
Interacting with Waspmote
These parameters must be also configured in the Waspmote sensor nodes. Access to all the information related to Waspmote at:
http://www.libelium.com/waspmote
To discover the MAC address of the XBee module just press the “Load MAC” button.
The “Check status” option allows to see if the radio is working properly and if the configuration stored on it matches the values
set in the Manager System.
Both process (“Load MAC” and “Check status”) require the capturer daemon to be stopped. This means no frames will be
received while executing this actions. Be patient this can take up to 1 minute to finish.
-148- v6.3
Interacting with Waspmote
Note: When you buy a Waspmote Developer kit with Meshlium and with the XBee ZB as ZigBee radio both the Waspmote GW and
Meshlium come configured as Coordinator of the network. Take into account that only one of them can be working at the same time.
Note: If the encryption check fails but the rest of parameters are OK, it means the radio has an old version of the firmware but it is
working perfectly.
As said before, in a kit containing Waspmotes, Gateway and Meshlium, the Waspmotes come already configured to send frames
to the Gateway. Later, once the user has developed the code for transmitting to Gateway, he can switch to Meshlium.
Meshlium will receive the sensor data sent by Waspmote using the wireless radio and it will store the frames in the Local Data
Base. That can be done in an automatic way thanks to the Sensor Parser.
The Sensor Parser is a software system which is able to do the following tasks in an easy and transparent way:
•• receive frames from XBee and LoRa (with the Data Frame format)
•• receive frames from 3G/GPRS, WiFi and Ethernet via HTTP protocol (Manager System version 3.1.4 and above)
•• parse these frames
•• store the data in local Database
•• synchronize the local Database with an external Database
The initial frames sent by Waspmote contain the next sequence (API frame characters are removed here):
<=>\0x80\0x03#35689722##7#ACC:80;10;987#IN_TEMP:22.50#BAT:93#
They are formed by the accelerometer values, RTC internal temperature value, and battery level. The MAC address is added and
other helpful information.
In order to add your own sensor frames properly go to the section “Sensors”. All frames captured will be able to stored on Local
Database, however the frame has not been defined is stored in the database. See the picture below in order to see different
frames types and how they are saved in the database.
In order to work with new sensor information added to the frames go to the “Capturing and Storing new sensor data frames”
chapter.
If you change any of the parameters in Waspmote or Meshlium you will have to do it in both platforms so that they still can
communicate.
-149- v6.3
Interacting with Waspmote
We can perform two different storage options with the frames captured:
You can also send the information received to the Internet using the Ethernet, WiFi and 3G/GPRS interfaces.
-150- v6.3
Interacting with Waspmote
Meshlium has a MySQL data base up and running which is used to store locally the information captured. In the “Local Data
Base” tab you can see the connection parameters.
•• Database: MeshliumDB
•• Table: sensorParser
•• IP: localhost / 10.10.10.1 *
•• Port: 3306
•• User: root
•• Password: libelium2007
You can change the password, see the ”Users Manager” section.
Steps:
1. Set the check box “Store frames in the local data base” and press the “Save” button.
From this time Meshlium will automatically perform Scans and will store the results in the Local Data Base. This process will also
continue after restarting Meshlium.
At any time you can see the last “x” records stored. Just set how many insertions you want to see and press the “Show data”
button.
-151- v6.3
Interacting with Waspmote
Meshlium can also store the information captured in an External Data Base.
Steps:
1. Pressing the “Show sql script” you will get the code needed to create the data base along with the table and the right privile-
ges.
3. Fill the Connection Data fields with the information about where the data base is located (IP, Port) and with the authentication
options (Database, Table, User, Password).
-152- v6.3
Interacting with Waspmote
4. Now press the “Check Connection” button to see if the configuration is correct.
-153- v6.3
Interacting with Waspmote
5. Set the check box “Store frames in external database”, you can defined the interval how often to synchronize the local database
with external database and press the “Save” button.
From this time Meshlium will automatically perform Scans and will store the results in the External Data Base each . This process
will also continue after restarting Meshlium.
You can also choose to sync when you want. Just press the “Synchronize Now” button.
-154- v6.3
Interacting with Waspmote
At any time you can see the last “x” records stored. Just set how many insertions you want to see and press the “Show data”
button.
-155- v6.3
Interacting with Waspmote
Show me now!
In the “Show me now!” tab you can see in real time the Scans captured.
You can specify if you want the information to be updated periodically with the defined interval just checking the “Use the
Defined Interval” button.
-156- v6.3
Interacting with Waspmote
Advanced Database
In the “Advanced” tab you can see information about the state in which they are databases.
It displays information about the Loca and Externall database, showing the following information:
From this tab, you can delete all the information contained in the Local database or Remove synchronized data. Before
performing these actions, a confirmation message will be displayed.
Note: Before running these options, it is recommended to have a backup or having synchronized your local database with external
database.
-157- v6.3
Interacting with Waspmote
In addition can display a log of the date of the last synchronization between the local database and external database was
successful.
-158- v6.3
Interacting with Waspmote
First show the “sensor log”, in this logs shows the frames are stored after being processed.
ASCII-35690399-N1-253-198-,STR:XBee frame,BAT:93,IN_TEMP:31.50
secondly shown “Frame Log”, in this logs shows the frames stored as the arrive to Meshlium.
<=>?#35690399#N1#198#STR:XBee frame#BAT:93#IN_TEMP:31.50#
-159- v6.3
Interacting with Waspmote
27.2.5. Sensors
In section “Sensor List”, the user can add new sensors or delete sensors.
By default Meshlium recognize all Libelium official sensors frames. All sensors frames that Meshlium can capture and store must
be specified in an XML file.
The button “update sensors” update the Libelium official sensor. User sensors remaining unchanged.
Users can add and remove sensors in an easy and simple from ManagerSystem.
Once all fields are filled in, click on the button “Add sensor”
-160- v6.3
Interacting with Waspmote
The new user sensors will be added to the new XML file, the file with user sensors is localed in /mnt/lib/cfg/parser/user_sensors.
xml
Note: In “Waspmote data frame guide” document is located more extensive information about how to build the frame.
To delete sensor the user must press the garbage can that appears to the left of the description of the sensor. To complete the
action should accept a confirmation message.
$ /etc/init.d/ZigbeeScanD.sh stop
Now you can execute the ZigBeeSend command. There are several ways to send information to a node:
Send to all the Waspmote devices at the same time - Broadcast mode:
The source code “ZigbeeSend.c” and the reception program to be installed in Waspmote can be downloaded from the Meshlium
Development section: http://www.libelium.com/development/meshlium
You can download these files and change them in order to get new features and sending options.
Compilation:
The compilation can be done in the same Meshlium. Just copy these files in a folder accessing by SSH and execute:
Important: If you want to create a “ZigBee sending” daemon that is executed each time Meshlium starts you have to deactivate the
“ZigBee Capturer” daemon (/etc/init.d/ZigbeeScanD.sh) as the ZigBee radio has to be used by one process at a time.
-161- v6.3
Interacting with Waspmote
-162- v6.3
Documentation Changelog
-163- v6.3
Documentation Changelog
-164- v6.3
Documentation Changelog
-165- v6.3
Certifications
29. Certifications
29.1. CE
In accordance with the 1999/05/CE directive, Libelium Comunicaciones Distribuidas S.L. declares that the Waspmote device
conforms to the following regulations:
EN 55022:1998
EN 55022:1998/A1:2000
EN 55022:1998/A2:2003
EN 61000-4-3:2002
EN 61000-4-3/A1:2002
EN 61000-4-3:2006
UNE-EN 60950-1:2007
Compliant with ETSI EN 301 489-1 V1.6.1, EN 300 328, Date: March 26, 2009
If desired, the Declaration of Conformity document can be requested using the Contact section at:
http://www.libelium.com/contact
Waspmote is a piece of equipment defined as a wireless sensor capture, geolocalization and communication device which allows:
-166- v6.3
Certifications
29.2. FCC
Waspmote models:
Installation and operation of any Waspmote model must assure a separation distance of 20 cm from all persons, to
comply with RF exposure restrictions.
FCC ID OUR-XBEEPRO
The antenna(s) used for this transmitter must be installed to provide the separation distances, as described in this filing, and
must not be co-located or operating in conjunction with any other antenna or transmitter. Grantee must coordinate with OEM
integrators to ensure the end-users of products operating with this module are provided with operating instructions and
installation requirements to satisfy RF exposure compliance. Separate approval is required for all other operating configurations,
including portable configurations with respect to 2.1093 and different antenna configurations. Power listed is continuously
variable from the value listed in this entry to 0.0095W
FCC ID MCQ-XBEEPRO2
OEM integrators and End-Users must be provided with transmitter operation conditions for satisfying RF exposure compliance.
The instruction manual furnished with the intentional radiator shall contain language in the installation instructions informing
the operator and the installer of this responsibility. This grant is valid only when the device is sold to OEM integrators and the
OEM integrators are instructed to ensure that the end user has no manual instructions to remove or install the device.
This device is to be used in mobile or fixed applications only. For other antenna(s) not described in this filing the antenna
gain including cable loss must not exceed 7.3 dBi in the 850 MHz Cellular band and 12.7 dBi in the PCS 1900 MHz band, for
the purpose of satisfying the requirements of 2.1043 and 2.1091. The antenna used for this transmitter must be installed to
provide a separation distance of at least 20 cm from all persons, and must not be co-located or operating in conjunction with
other antennas or transmitters within a host device, except in accordance with FCC multi- transmitter product procedures.
Compliance of this device in all final product configurations is the responsibility of the Grantee. OEM integrators and end-users
must be provided with specific information required to satisfy RF exposure compliance for all final host devices and installations.
-167- v6.3
Certifications
29.3. IC
Waspmote models:
The term “IC:” before the equipment certification number only signifies that the Industry Canada technical specifications were met.
Installation and operation of any Waspmote model must assure a separation distance of 20 cm from all persons, to
comply with RF exposure restrictions.
It is regulated according to EN 301 489-1 v 1.4.1 (202-04) and EN 301 489-17 V1.2.1 (2002-08). The configuration software must
be used to limit to a maximum power of 12’11dBm (PL=0).
The 868MHz XBee module has a maximum transmission power of 27dBm. This module is regulated only for use in Europe.
The 900MHz XBee module has a maximum power of 20dBm. This module is regulated only for use in the United States.
The GSM/GPRS module has a power of 2W (Class 4) for the 850MHz/900MHz band and 1W (Class 1) for the 1800MHz and
1900MHz frequency band.
The 3G/GPRS module has a power of 0.25W for the UMTS 900MHz/2100MHz band, 2W for the GSM 850MHz/900MHz band and
1W DCS1800MHz frequency band.
Important: In Spain the use of the 850MHz band is not permitted. For more information contact the official organisation responsible
for the regulation of power and frequencies in your country.
The cable (pigtail) used to connect the radio module with the antenna connector shows a loss of approximately 0.25dBi for
GSM/GPRS.
-168- v6.3
Certifications
The broadcast power at which the WiFi, XBee 2.4GHz, XBee 868MHz, XBee 900MHz operate can be limited through the
configuration software. It is the responsibility of the installer to choose the correct power in each case, considering the following
limitations:
The broadcast power of any of the modules added to that of the antenna used minus the loss shown by the pigtail and the cable
that joins the connector with the antenna (in the event of using an extra connection cable) must not exceed 20dBm (100mW)
in the 2.4GHz frequency band and 27dBm for the 868MHz band, according to the ETSI/EU regulation.
It is the responsibility of the installer to configure the different parameters of the equipment correctly, whether hardware or
software, to comply with the pertinent regulation of each country in which it is going to be used.
•• In Belgium, outdoor use is only on channels 11(2462MHz), 12(2467MHz) and 13(2472MHz) only. It can be used without
a licence if it is for private use and at a distance less than 300m. Over longer distances or for public use, an I’IBPT licence
is required.
•• In France the use of channels 10(2457MHz), 11(2462MHz), 12(2467MHz) and 13(2472MHz) is restricted. A licence is requi-
red for any use both indoors and outdoors. Contact ARCEP (http://www.arcep.fr) for further information.
•• In Germany a licence is required for outdoor use.
•• In Italy a licence is required for indoor use. Outdoor use is not permitted.
•• In Holland a licence is required to outdoor use.
•• In Norway, use near Ny-Alesund in Svalbard is prohibited. For further information enter Norway Posts and Telecommuni-
cations (http://www.npt.no).
IMPORTANT
It is the responsibility of the installer to find out about restrictions of use for frequency bands in each country and act in
accordance with the given regulations. Libelium Comunicaciones Distribuidas S.L does not list the entire set of standards that
must be met for each country. For further information go to:
CEPT ERC 70-03E - Technical Requirements, European restrictions and general requirements: http://www.erodocdb.dk/
-169- v6.3
Maintenance
30. Maintenance
•• In this section, the term “Waspmote” encompasses both the Waspmote device itself as well as its modules and sensor
boards.
•• Take care when handling Waspmote, do not let it fall, knock it or move it suddenly.
•• Avoid having the devices in high temperature areas as it could damage the electronic components.
•• The antennas should be connected carefully. Do not force them when fitting them as the connectors could be damaged.
•• Do not use any type of paint on the device, it could harm the operation of the connections and closing mechanisms.
-170- v6.3
Disposal and recycling
-171- v6.3