LoRa Basics™ Modems: Walk-through
LoRa Basics™ Modem-E (LR1110 chip)¶
The LoRa Basics™ Modem-E is an easy-to-use LoRaWAN® stack running directly on the LoRa Edge™ LR1110 chip. LoRa Basics Modem-E releases the host microcontroller unit (MCU) from timing and memory constraints, and enables developers to focus on their applications, making connectivity easy.
In addition, the modem provides convenient monitoring and management features that are linked to the LoRa Cloud™ Modem & Geolocation Services. The modem includes support for the following:
LoRaWAN Standard version 1.0.3, Class A
EU868 & US915 regional parameters
Geolocation with GNSS and Wi-Fi passive scanning
LoRa Cloud Large File Upload and streaming services
Over-the-Air (OTA) almanac update service for GNSS
Periodic device management status messages and device monitoring
Remote reset and re-keying
Clock Sync service
The LR1110 chip can be converted from a transceiver to a LoRa Basics Modem-E and back by using this tool.
The host microcontroller unit (MCU) uses SPI to communicate with the LR1110 chip.
Developers can choose to use Semtech’s LoRa Cloud Join Server to securely manage connections without exposing the AppKey (if the LoRaWAN network server is compatible), or can export the AppKey to use the modem with a different server.
Wi-Fi and GNSS Solvers¶
The LoRa Cloud Modem & Geolocation Services server provides Wi-Fi and GNSS solvers. These services will answer to a GNSS NAV message or a Wi-Fi scan from the LR1110 with a geolocation position.
As GNSS NAV messages and the size of Wi-Fi scan results may vary, and may be greater than the maximum LoRaWAN payload size, we recommend that you use the streaming feature. When you use this feature, the modem will take care of fragmentation and add forward error correction data, so that the LoRa Cloud Modem & Geolocation server will be able to reconstruct the stream, even if some uplinks are lost.
LoRa Basics™ Modem-E Evaluation Kit¶
The LoRa Basics™ Modem-E Evaluation Kit (the “Kit”) is built with the LoRa Edge™ LR1110 chip. This application is compatible with Semtech’s LoRa Cloud Modem & Geolocation Services.
End Node Hardware and Software Requirements¶
The following hardware is required:
Modem: LR1110 Modem PCB_E592V01A shield
Development Board: Nucleo-L476RG and DisplayModule DM-TFT28-116
Cable: Mini-USB cable
Computer with one of the following operating systems: Windows 7 or above, Linux, or macOS
The following software is required:
Node-RED application server (See Node-RED installation)
The Node-RED application runs as the LoRaWAN® application server for the modem.
Connecting the Components¶
Connect the Mbed shield to the Arduino connector on the Nucleo board.
Connect the mini-USB cable from the host PC to the Nucleo board. The cable provides power for both boards.
Flashing the Application Firmware onto the Nucleo Board¶
To flash the application firmware onto the Nucleo board:
Ensure that the board is connected to the computer via the mini-USB cable. A temporary drive, NODE_L476RG, should be created automatically.
Download the latest application firmware binary, lr1110_evk_vX.Y.Z.bin, here.
Move the lr1110_evk_vX.Y.Z.bin file to the temporary drive. (You can use the drag-and-drop method).
If the drive is not mounted under Windows, the necessary ST-Link driver may be missing. To obtain this driver, visit ST’s Nucleo-L073RZ product page.
LoRa Basics Modem-E Evaluation Kit Demo¶
In this demo, we scan Wi-Fi and GNSS data, then send the data to the Node-RED application server. The application server resolves the position of the end node in conjunction with the LoRa Cloud Modem & Geolocation Services server. Once resolved, the position is displayed on a map.
After boot, the Kit displays the splash screen. On the splash screen you can tap About to display the page that has the licensing information and the modem’s version information.
To open the menu, tap Start.
Figure 2: LoRa Basics Modem-E Evaluation Kit splash screen
The main menu displays
Figure 3: LoRa Basics Modem-E Evaluation Kit main menu
Retrieving PIN and EUIs¶
To retrieve the device PIN and the EUIs:
On the main menu, across from “EUI” at the bottom of the list, tap GO!
Write down the DevEUI, JoinEUI and PIN.
Connecting the Kit to a LoRaWAN Network¶
Before attempting to connect to a LoRaWAN network, make sure that the device is correctly registered with the network server. (See Working With a LoRaWAN network server.) You also need to make sure that the Node-RED application server is both running correctly and is properly connected to the LoRaWAN network server. Finally, make sure that the Node-RED application server is running on a machine accessible from your computer; for example, if Node-RED is installed locally, it should be accessible at address 127.0.0.1:1880.
To connect the Kit to a LoRaWAN network, open the Connectivity menu, and tap Join. The modem will start to connect to your LoRaWAN network. The connectivity indicator at the top right portion of the screen will turn from red to yellow, indicating that a connection is being established.
The Kit can be connected as a class A or class C device through the LoRaWAN class dropdown list. Note that the selected class must match the configuration on your network server.
After the modem receives the JoinAccept event, the connectivity indicator turns green, indicating that the device has successfully connected to the network.
Figure 3: LoRa Edge™ Platform chip Evaluation Kit connectivity
Unexpected behavior has been observed when using the Adaptive Data Rate (ADR) network-controlled configuration with some LoRaWAN network servers. In some cases, the LoRa Basics Modem-E and the network enter into an infinite loop of MAC command exchanges. To stop this loop, simply set the ADR configuration to Mobile LR.
To see the scanning features in action, open the main menu, tap Demonstrations and then tap Geoloc Demos.
When the Geoloc Demos menu page displays, only the Wi-Fi scanning demo will be active at first. To enable the GNSS demonstration, you must join the Kit to a LoRaWAN network. You also need to make sure that the time on the device is synchronized via the MGS Clock Sync service. This is handled automatically by the Kit, Node-RED Application Server, and the LoRa Cloud Modem & Geolocation Services server.
Figure 4: LoRa Basics Modem-E Evaluation Kit geolocation demonstration; no network connection
Figure 5: LoRa Basics Modem-E Evaluation Kit geolocation demonstration; connected to a LoRaWAN network
The duration between receiving the JoinAccept message, and the Clock Sync update can range from few seconds to two minutes.
To run the scan demo:
Open the main menu and tap Demonstrations.
Tap then Geoloc Demos.
Tap Go next to the type of scan you want to run.
The modem will start the selected scanning operation. The orange LED will turn on while the scanning operation is running. Once the scanning operation stops, a summary of the results is displayed. The detailed results can be obtained by pressing Results.
Figure 6: LoRa Edge™ Platform Wi-Fi scan results
Figure 7: LoRa Edge™ Platform GNSS scan results
The results can then be sent to the application server by tapping Send. This triggers an uplink from the modem to the Node-RED application server. If the end node has been successfully located, the result will be visible on a map you can access via the Node-RED application server; see the Geolocation section of this document.
Considerations Regarding Operating in U.S. Regions¶
The LoRaWAN Regional Parameters specification defines 64 channels for the U.S. region. However, it is possible to use an eight-channel gateway. When an eight-channel gateway is used, end devices on a LoRaWAN network cannot know in advance which channel the gateway is listening to before receiving the channel mask from the network. In this case, an end device is likely to send uplinks on channels that will not be received.
This situation may occur with any end device operating on a LoRaWAN network. However the LoRa Basics Modem-E can automatically send uplinks to comply with the user configuration. For instance, when Clock Sync is enabled, the Modem will automatically send Clock Sync request uplinks. Understand, though, that uplink loss due to the limited number of channels monitored by the gateway may artificially degrade the behavior of some modem features.
It is possible to overcome this situation by detecting when the modem has received the channel mask, and then enabling the LoRa Basics Modem feature (Clock Sync, for instance) only after the channel mask has been taken into account. LoRa Basics Modem-E does not send an event to the host MCU when a channel mask has been received from the network. Nevertheless, it is possible to use the ADR feature because the Modem sends a NewLinkADR event when it receives an ADR configuration from the network.
To enable this LoRa Basics Modem-E feature, take the following steps:
Configure the ADR profile with Network Control.
Start the Join procedure.
Once the JoinAccept event is received, start sending uplinks. (Note: Most of the uplinks will be lost while the channel mask is unknown to the Modem.)
At some point, one uplink will be received by the network. This triggers a MAC command downlink with the channel mask.
Upon receiving the MAC command, the Modem sends the NewLinkADR event to the host MCU.
The host MCU can then enable the LoRa Basics Modem-E features it requires (Clock Sync, for instance) and reconfigure the ADR profile.
Some networks send the channel mask in the same downlink as the JoinAccept message. Therefore, LoRa Basics Modem-E knows upon receipt of the JoinAccept message which channels to use for the uplink. In this case, there is no need to follow the procedure described above.