This guide explains the LoRaWAN modules features and functions. These products were designed for Waspmote
v12 and Plug & Sense! v12 and continue with no changes for Waspmote v15 and Plug & Sense! v15. There are
no great variations in this library for our new product lines Waspmote v15 and Plug & Sense! v15, released on
October 2016.
Anyway, if you are using previous versions of our products, please use the corresponding guides, available on our
Development website.
You can get more information about the generation change on the document “New generation of Libelium product
lines”.
The Libelium LoRaWAN module has been integrated into the main sensor lines Waspmote OEM and Plug & Sense!,
so now you can create your own Low Power Wide Area Network (LPWAN).
LoRaWAN is a new, private and spread-spectrum modulation technique which allows sending data at extremely low
data-rates to extremely long ranges. The low data-rate (down to few bytes per second) and LoRaWAN modulation
lead to very low receiver sensitivity (down to -136 dBm), which combined to an output power of +14 dBm means
extremely large link budgets: up to 150 dB, what means more than 22 km (13.6 miles) in LOS links and up to 2
km (1.2 miles) in NLOS links in urban environment (going through buildings).
Figure: Waspmote LoRaWAN
Libelium’s LoRaWAN EU/433 module works in both 868 and 433 MHz ISM bands and the LoRaWAN US module
works in 900 MHz ISM band, which makes them suitable for virtually any country. Those frequency bands are
lower than the popular 2.4 GHz band, so path loss attenuation is better in LoRaWAN. In addition, 433, 868 and
900 MHz are bands with much fewer interference than the highly populated 2.4 GHz band. Besides, these low
frequencies provide great penetration in possible materials (brick walls, trees, concrete), so these bands get less
loss in the presence of obstacles than higher bands.
-5-v7.6
Introduction
With the LoRaWAN modules we can send the data directly to any Base Station (BS) that is LoRaWAN compatible.
Gemteck, ExpEmb, Embedded Planet, Calao, RFI, etc. In order to visualize the information we will need also a
Cloud platform where the data has to be sent. Normally when you acquire a BS you can install your preferred
SW packet in order to make it work against the Cloud platform. We tested the LoRaWAN radios with three Cloud
platforms: Actility, Orbiwise and Loriot, you can nd more information about the conguration in this tutorial.
Figure: LoRaWAN network
Libelium currently oers two options of this type of radio technology: LoRa (“raw”) and LoRaWAN:
•LoRa contains only the link layer protocol and is perfect to be used in P2P communications between nodes.
You can set a topology of a maximum of 10 nodes to the same Gateway as LoRa does not make packet
management.
•LoRaWAN can handle hundreds of connections at the same time.
•LoRaWAN includes the network layer too so it is possible to send the information to any LoRaWAN Base
Station already connected to a Cloud platform. LoRaWAN modules may work in the 868/900/433 MHz bands.
•LoRa is available for the Waspmote OEM v15 platform but not for Plug & Sense! v15.
•LoRaWAN is available for both Waspmote OEM v15 and Plug & Sense! v15.
•Plug & Sense! with LoRaWAN radio is certied for Europe (CE), USA (FCC) and Canada (IC), while LoRa is not
certied.
As well as the LoRaWAN to Base Station mode, the modules may be used in two dierent more congurations.
•P2P Mode - Direct Communication between nodes (LAN Interface)
•In the P2P Mode nodes may connect directly among them and send messages directly at no cost (as they
are not using the LoRaWAN Network but just direct radio communication). This is useful as we can create
secondary networks at any time as we don’t need to change the rmware but just use specic AT Commands
in the current library. This mode works without the need of a Base Station or a Cloud account so in case
you don’t want to purchase any license (or renew the license after the initial period) you will be able to keep
on using the modules this way. For more info go to the section P2P Mode.
Figure: P2P mode
In the Hybrid Mode we use a combination of the LoRaWAN and P2P modes allowing to send just certain messages
using the LoRaWAN Network. In this case we use one node as GW of the network (P2P + LoRaWAN mode) and the
rest of the nodes in P2P mode. This mode may work using just one LoRaWAN License. For more info go to the
section Hybrid Mode.
Figure: P2P mode
-7-v7.6
Introduction
Important:
•All documents and any examples they contain are provided as-is and are subject to change without notice.
Except to the extent prohibited by law, Libelium makes no express or implied representation or warranty of
any kind with regard to the documents, and specically disclaims the implied warranties and conditions of
merchantability and tness for a particular purpose.
•The information on Libelium’s websites has been included in good faith for general informational purposes
only. It should not be relied upon for any specic purpose and no representation or warranty is given as to its
accuracy or completeness.
-8-
v7.6
Introduction
1.1. Technology overview
LoRaWAN is a Low Power Wide Area Network (LPWAN) specication 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.
Communication between end-devices and gateways is spread out on dierent frequency channels and data
rates. The selection of the data rate is a trade-o between communication range and message duration. Due to
the spread spectrum technology, communications with dierent 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 enddevices 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.
National wide networks targeting Internet of Things such as critical infrastructure, condential personal data or
critical functions for the society has a special need for secure communication. This has been solved by several
layer of encryption:
•Network Session Key (128-bit key) ensures security on network level
The LoRaWAN module is managed via UART and it can be connected to SOCKET0 or SOCKET1.
2.1.1. LoRaWAN EU
The main features of the module are listed below:
•Manufacturer: Microchip
•Model: RN2483
•Protocol: LoRaWAN 1.0, Class A
•LoRaWAN-ready
•Frequency: EU 863-870 MHz and EU 433 MHz ISM frequency bands.
•TX power: up to +14 dBm
•Sensitivity: down to -136 dBm
•Range: >15 km at suburban and >5 km at urban area. Typically, each base
station covers some km. Check the LoRaWAN Network in your area.
•Chipset consumption: 38.9 mA
•Radio bit rate: from 250 to 5470 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Figure: LoRaWAN EU module
Hardware
Figure: LoRaWAN EU module with antenna
-10-
v7.6
2.1.2. LoRaWAN US
The main features of the module are listed below:
•Manufacturer: Microchip
•Model: RN2903
•Protocol: LoRaWAN 1.0, Class A
•LoRaWAN-ready
•Frequency: US 902-928 MHz ISM band
•TX power: up to +18.5 dBm
•Sensitivity: down to -136 dBm
•Range: >15 km at suburban and >5 km at urban area. Typically, each base
station covers some km. Check the LoRaWAN Network in your area.
•Chipset consumption: 124.4 mA
•Radio bit rate: from 250 to 12500 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Hardware
Figure: LoRaWAN US module
Figure: LoRaWAN US module with antenna
-11-v7.6
2.1.3. LoRaWAN AU
The main features of the module are listed below:
•Manufacturer: Microchip
•Model: RN2903
•Protocol: LoRaWAN 1.0.1, Class A
•LoRaWAN-ready
•Frequency: AU 915-928 MHz ISM band
•TX power: up to +18.5 dBm
•Sensitivity: down to -136 dBm
•Range: >15 km at suburban and >5 km at urban area. Typically, each base
station covers some km. Check the LoRaWAN Network in your area.
•Chipset consumption: 124.4 mA
•Radio bit rate: from 250 to 12500 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Hardware
Figure: LoRaWAN AU module
Figure: LoRaWAN AU module with antenna
-12-
v7.6
2.1.4. LoRaWAN IN
The main features of the module are listed below:
•Manufacturer: Microchip
•Model: RN2903
•Protocol: LoRaWAN 1.0.1, Class A
•LoRaWAN-ready
•Frequency: IN 865-867 MHz ISM band
•TX power: up to +18.5 dBm
•Sensitivity: down to -136 dBm
•Range: >15 km at suburban and >5 km at urban area. Typically, each base
station covers some km. Check the LoRaWAN Network in your area.
•Chipset consumption: 124.4 mA
•Radio bit rate: from 250 to 12500 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Hardware
Figure: LoRaWAN IN module
Figure: LoRaWAN IN module with antenna
-13-v7.6
2.1.5. LoRaWAN ASIA-PAC / LATAM
The main features of the module are listed below:
•Manufacturer: Microchip
•Model: RN2903
•Protocol: LoRaWAN 1.0.1, Class A
•LoRaWAN-ready
•Frequency: AS 923 MHz ISM band
•TX power: up to +18.5 dBm
•Sensitivity: down to -136 dBm
•Range: >15 km at suburban and >5 km at urban area. Typically, each base
station covers some km. Check the LoRaWAN Network in your area.
•Chipset consumption: 124.4 mA
•Radio bit rate: from 250 to 12500 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Hardware
Figure: LoRaWAN AU module
Figure: LoRaWAN ASIA-PAC / LATAM module with antenna
Note: The user must check the allowed bands, channels and transmission power, in order to respect the regulations
in the operation country.
Libelium commercializes dierent items depending on the band the user wants to use. In the case of 868 and 433,
the module is the same, but the antenna is dierent for each band. The module for EU (868) and 433 MHz includes 2
RP-SMA connectors for the antenna. One is for the 868 band and the other for the 433 band. A sticker on the bottom
of the modules species clearly where to screw the antenna.
Note: Any LoRaWAN module is provided with a special antenna (for 433 or for 868 or for 900 MHz), which enables
maximum range.
Note: Due to the propagation characteristics of the sub-GHz bands, the near eld eect could make that 2 modules
cannot communicate if they are placed very close (< 1 m). We suggest to keep a minimum distance of 3 or 4 meters
between modules.
-14-
v7.6
2.1.6. LoRaWAN JP / KR
The main features of the module are listed below:
•Manufacturer: Murata
•Model: CMWX1ZZABZ
•Protocol: LoRaWAN 1.0.1, Class A
•LoRaWAN-ready
•Frequency: AS 923 MHz ISM band and KR 920-923 MHz ISM band
•TX power: up to +16 dBm
•Sensitivity: down to -135.5 dBm
•Range: >15 km at suburban and >5 km at urban area.
Typically, each base station covers some km.
Check the LoRaWAN Network in your area.
•Chipset consumption: 96.7 mA
•Radio bit rate: from 250 to 5470 bps
•Receiver: purchase your own base station or use networks from LoRaWAN operators
Figure: LoRaWAN JP / KR module
Hardware
Figure: Bottom of the LoRaWAN JP / KR and module with antenna
Note: The user must check the allowed bands, channels and transmission power, in order to respect the regulations
in the operation country.
Libelium commercializes dierent items depending on the band the user wants to use. In the case of 868 and 433,
the module is the same, but the antenna is dierent for each band. The module for EU (868) and 433 MHz includes 2
RP-SMA connectors for the antenna. One is for the 868 band and the other for the 433 band. A sticker on the bottom
of the modules species clearly where to screw the antenna.
Note: Any LoRaWAN module is provided with a special antenna (for 433 or for 868 or for 900 MHz or for 916 MHz
[JP / KR]), which enables maximum range
-15-v7.6
Hardware
Note: Due to the propagation characteristics of the sub-GHz bands, the near eld eect could make that 2 modules
cannot communicate if they are placed very close (< 1 m). We suggest to keep a minimum distance of 3 or 4 meters
between modules.
2.2. Region standards
The LoRaWAN Specication settled by the LoRa Alliance establishes the parameters that must be complied for
every region. Check the compatibility table below, showing the areas supported by our LoRaWAN versions for the
moment.
RegionSupported by
EU 863-870 MHz ISM Band (Europe)LoRaWAN EU
US 902-928 MHz ISM Band (United States)LoRaWAN US
CN 779-787 MHz ISM Band (China)Not supported
AU 915-928 MHz ISM Band (Australia)LoRaWAN AU
CN 470-510 MHz ISM Band (China)Not supported
AS 923 MHz ISM Band (ASEAN)LoRaWAN ASIA-PAC / LATAM
AS 923 MHz ISM Band (ASEAN)
KR 920-923 MHz ISM Band (South Korea)LoRaWAN JP / KR
INDIA 865-867 ISM Band (India)LoRaWAN IN
Figure: Regional compatibility table
LoRaWAN ASIA-PAC / LATAM
LoRaWAN JP / KR (special for Japan)
-16-
v7.6
Hardware
2.3. Power consumption
2.3.1. LoRaWAN EU
The LoRaWAN EU module is powered at 3.3 V. The next table shows the module’s average current consumption
in dierent states of the module.
StatePower Consumption
On2.8 mA
Transmitting data38.9 mA
Receiving data14.2 mA
Figure: Power consumption table
2.3.2. LoRaWAN US
The LoRaWAN US module is powered at 3.3 V. The next table shows the module’s average current consumption
in dierent states of the module.
StatePower Consumption
On2.7 mA
Transmitting data124.4 mA
Receiving data13.5 mA
Figure: Power consumption table
2.3.3. LoRaWAN AU
The LoRaWAN AU module is powered at 3.3 V. The next table shows the module’s average current consumption
in dierent states of the module.
StatePower Consumption
On2.7 mA
Transmitting data124.4 mA
Receiving data13.5 mA
Figure: Power consumption table
2.3.4. LoRaWAN IN
The LoRaWAN IN module is powered at 3.3 V. The next table shows the module’s average current consumption
in dierent states of the module.
StatePower Consumption
On2.7 mA
Transmitting data124.4 mA
Receiving data13.5 mA
Figure: Power consumption table
-17-v7.6
Hardware
2.3.5. LoRaWAN ASIA-PAC / LATAM
The LoRaWAN ASIA-PAC / LATAM module is powered at 3.3 V. The next table shows the module’s average current
consumption in dierent states of the module.
StatePower Consumption
On2.7 mA
Transmitting data124.4 mA
Receiving data13.5 mA
Figure: Power consumption table
2.3.6. LoRaWAN JP / KR
The LoRaWAN JP / KR module is powered at 3.3 V. The next table shows the module’s average current consumption
in dierent states of the module.
Figure: Power consumption table
StatePower Consumption
On1.1 mA
Transmitting data96.1 mA
Receiving data27 mA
-18-
v7.6
Hardware
2.4. Time consumption
The elapsed periods dened in this chapter take into account the following steps depending on the case:
•Join to a network and send unconrmed data
•Join to a network and send conrmed data
These periods of time depend on the data rate set which is dened by the spreading factor and signal bandwidth
congured.
Transmit modeTime elapsed
Send unconrmed at 5470 bps~ 2.8 seconds
Send unconrmed at 250 bps~ 4.2 seconds
Send conrmed at 5470 bps~ 1.7 seconds
Send conrmed at 250 bps~ 4.2 seconds
Note: When transmitting in ISM frequency bands, the user must ensure that the communication is not exceeding the
permitted time using the chosen frequency channel (for example, 1% of time). This depends on the local regulations
(CE, FCC, etc). It is the responsibility of the user to know the allowed time of use in the occupied frequency band and
respect it. Ignoring this, could lead to considerable penalties. Also, a LoRaWAN back-end operator could cut o the
service or apply extra fees, it they detect that the user is exceeding the maximum number of frames or data in a
period of time.
2.5. How to connect the module
This module can be connected to both SOCKET0 and SOCKET1 on the Waspmote board.
Figure: Module connected to Waspmote in SOCKET0
In order to connect the module to the SOCKET1, the user must use the Expansion Radio Board.
-19-v7.6
Hardware
2.6. Expansion Radio Board
The Expansion Board allows to connect two communication modules at the same time in the Waspmote sensor
platform. This means a lot of dierent combinations are possible using any of the wireless radios available for
Waspmote: 802.15.4, ZigBee, DigiMesh, 868 MHz, 900 MHz, LoRa, WiFi, GPRS, GPRS+GPS, 3G, 4G, Sigfox, LoRaWAN,
Bluetooth Pro, Bluetooth Low Energy and RFID/NFC. Besides, the following Industrial Protocols modules are
available: RS-485/Modbus, RS-232 Serial/Modbus and CAN Bus.
Some of the possible combinations are:
•LoRaWAN - GPRS
•802.15.4 - Sigfox
•868 MHz - RS-485
•RS-232 - WiFi
•DigiMesh - 4G
•RS-232 - RFID/NFC
•WiFi - 3G
•CAN Bus - Bluetooth
•etc.
Remark: GPRS, GPRS+GPS, 3G and 4G modules do not need the Expansion Board to be connected to Waspmote. They
can be plugged directly in the socket1.
In the next photo you can see the sockets available along with the UART assigned. On one hand, SOCKET0 allows
to plug any kind of radio module through the UART0. On the other hand, SOCKET1 permits to connect a radio
module through the UART1.
Figure: Use of the Expansion Board
The API provides a function called ON() in order to switch the module on. This function supports a parameter
which permits to select the SOCKET. It is possible to choose between SOCKET0 and SOCKET1.
Selecting SOCKET0: LoRaWAN.ON(SOCKET0);
Selecting SOCKET1: LoRaWAN.ON(SOCKET1);
-20-
v7.6
Hardware
The rest of functions are used the same way as they are used with older API versions. In order to understand
them, we recommend to read this guide.
Warnings:
•Avoid to use DIGITAL7 pin when working with the Expansion Board. This pin is used for setting the XBee into
sleep mode.
•Avoid to use DIGITAL6 pin when working with the Expansion Board. This pin is used as power supply for the
Expansion Board.
•Incompatibility with Sensor Boards:
-Agriculture v30 and Agriculture PRO v30: Incompatible with Watermark and solar radiation sensors
-Events v30: Incompatible with interruption shift register
-Gases v30: DIGITAL6 is incompatible with CO2 (SOCKET_2) and DIGITAL7 is incompatible with NO2
(SOCKET_3)
-Smart Water v30: DIGITAL7 incompatible with conductivity sensor
-Smart Water Ions v30: Incompatible with ADC conversion (sensors cannot be read if the Expansion Board
is in use)
-Gases PRO v30: Incompatible with SOCKET_2 and SOCKET_3
-Cities PRO v30: Incompatible with SOCKET_3. I2C bus can be used. No gas sensor can be used.
-21-v7.6
Software
3. Software
The Waspmote device communicates with the LoRaWAN module via UART. So dierent commands are sent from
the microcontroller unit to the module so as to perform dierent tasks.
3.1. Waspmote libraries
3.1.1. Waspmote LoRaWAN les
The les related to the LoRaWAN libraries for these modules are:
WaspLoRaWAN.h
WaspLoRaWAN.cpp
It is mandatory to include the LoRaWAN library when using these modules. So the following line must be added
at the beginning of the code:
#include <WaspLoRaWAN.h>
3.1.2. Class constructor
To start using the Waspmote LoRaWAN library, an object from the WaspLoRaWAN class must be created. This object,
called LoRaWAN, is already created by default inside Waspmote LoRaWAN library. It will be used through this guide
to show how Waspmote works.
When using the class constructor, all variables are initialized to a default value.
3.1.3. API constants
The API constants used in functions are:
ConstantDescription
LORAWAN_ANSWER_OK
LORAWAN_ANSWER_ERROR
LORAWAN_NO_ANSWER
LORAWAN_INIT_ERROR
LORAWAN_LENGTH_ERROR
LORAWAN_SENDING_ERROR
LORAWAN_NOT_JOINED
LORAWAN_INPUT_ERROR
LORAWAN_VERSION_ERROR
RN2483_MODULE
RN2903_MODULE
RN2903_IN_MODULE
RN2903_AS_MODULE
ABZ_MODULE
BAND_JP923
BAND_KR920
Successful response to a function
Erratic response to a function
No response to a function
Required keys to join to a network were not initialized
Data to be sent length limit exceeded
Server did not response
Module has not joined a network
Invalid input parameter
The module does not support this function
LoRaWAN module plugged is LoRaWAN EU
LoRaWAN module plugged is LoRaWAN US
LoRaWAN module plugged is LoRaWAN IN
LoRaWAN module plugged is LoRaWAN ASIA-PAC / LATAM
LoRaWAN module plugged is LoRaWAN JP / KR
LoRaWAN module is using the AS923 band
LoRaWAN module is using the KR920-923 band
-22-
v7.6
3.1.4. API variables
The variables used inside functions and Waspmote codes are:
ConstantDescription
_buffer
_length
_def_delay
_baudrate
_uart
_adr
_ar
_eui
_devEUI
_appEUI
_nwkSKey
_appSKey
_appKey
_devAddr
_band
_margin
_gwNumber
_freq
_radioFreq
_radioFreqDev
_preambleLength
_dCycle
_drrMin
_drrMax
_dCyclePS
_crcStatus
_powerIndex
_dataRate
_retries
_upCounter
The buer of memory used for storing the responses from the
module
The useful length of the buer
The time to wait after sending every command until listen for a
response
The baudrate to be used when the module is switched on
The selected UART (regarding the socket used: SOCKET0 or
SOCKET1)
The adaptive data rate state (on or o)
The automatic reply state (on or o)
The buer used for storing the preprogrammed globally unique
identier from the module's hardware
The buer used for storing the globally unique identier for the
module (software programmable)
The buer used for storing the application identier for the
module
The buer used for storing the network session key for the module
The buer used for storing the application session key for the
module
The buer used for storing the application key for the module
The buer used for storing network device address for module
The buer used for storing the frequency band
The demodulation margin received in the last Link Check Answer
frame
The number of gateways successfully received the last Link Check
Answer frame
The buer used for storing the operating frequency for every
channel
The transceiver operating frequency
The transceiver frequency deviation
The preamble length for transceiver
The buer used for storing the operating duty cycle for every
channel
The minimum operating data rate range for every channel
The maximum operating data rate range for every channel
The duty cycle prescaler (which can only be congured by the
server)
The CRC status to determine if it is to be included during operation
The output power to be used on LoRaWAN transmissions
The data rate to be used on LoRaWAN transmissions
The number of retransmissions for an uplink
The value of the uplink frame counter
Software
-23-v7.6
Software
_downCounter
_radioPower
_radioSF
_radioRxBW
_radioCR
_radioWDT
_radioBW
_radioSNR
_radioMode
_radioBitRate
_supplyPower
_rx2DataRate
_rx2Frequency
_rx1Delay
_macStatus
_status
_data
_port
_dataReceived
_version
_bandABZ
The value of the downlink frame counter
The output power level used by the transceiver
The spreading factor to be used by the transceiver
The receiving bandwidth used by the transceiver
The coding rate used by the transceiver
The time to be used by the transceiver watchdog timer
The value used for the transceiver bandwidth
The SNR value for the last received packet by the transceiver
The buer to save the operative radio mode
The operative radio bit rate
The voltage level read by the module
The second receiving window data rate
The second receiving window frequency
The rst receiving window delay
The MAC status register from the module
The status of every LoRaWAN channel
The buer of memory used for storing data received from the
back-end
The port where data was received
The ag used to inform if any data was received
The version of the module plugged into Waspmote
Band used for the LoRaWAN JP / KR type module
3.1.5. API functions
Through this guide there are lots of examples of using functions. In these examples, API functions are called to
execute the commands, storing in their related variables the parameter value in each case. The functions are
called using the predened object LoRaWAN.
All public functions return one of these possible values:
•LORAWAN_ANSWER_OK = 0
•LORAWAN_ANSWER_ERROR = 1
•LORAWAN_NO_ANSWER = 2
•LORAWAN_INIT_ERROR = 3
•LORAWAN_LENGTH_ERROR = 4
•LORAWAN_SENDING_ERROR = 5
•LORAWAN_NOT_JOINED = 6
•LORAWAN_INPUT_ERROR = 7
•LORAWAN_VERSION_ERROR = 8
-24-
v7.6
Loading...
+ 53 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.