Skip to content

Commit f92f4a0

Browse files
committed
Minor spelling fixes
1 parent b78a4ef commit f92f4a0

File tree

1 file changed

+29
-31
lines changed
  • content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/mc-ard-lora

1 file changed

+29
-31
lines changed

content/hardware/04.pro/carriers/portenta-max-carrier/tutorials/mc-ard-lora/content.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Connecting the Portenta Max Carrier to The Things Network
33
description: This tutorial explains how to connect your Portenta Max Carrier to the Things Network(TTN) using its onboard LoRaWAN® module.
44
difficulty: intermediate
55
tags:
6-
- iot
7-
- LoRa®
6+
- IoT
7+
- LoRaWAN®
88
author: Taddy Chung, José Bagur
99
libraries:
1010
- name: MKRWAN
@@ -17,7 +17,7 @@ software:
1717

1818
## Overview
1919

20-
This tutorial explains how to connect your Arduino® Max Carrier, with an [Arduino® Portena H7](https://store.arduino.cc/products/portenta-h7), to The Things Network (TTN) using its onboard LoRaWAN® module. The article will focus on achieving communication between the Max Carrier and an application on TTN.
20+
This tutorial explains how to connect your [Arduino® Max Carrier](http://store.arduino.cc/portenta-max-carrier), with an [Arduino® Portena H7](https://store.arduino.cc/products/portenta-h7) to The Things Network (TTN) using its onboard LoRaWAN® module. The article will focus on achieving communication between the Max Carrier and an application on TTN.
2121

2222
## Goals
2323

@@ -28,10 +28,10 @@ This tutorial explains how to connect your Arduino® Max Carrier, with an [Ardui
2828
### Required Hardware and Software
2929

3030
- [Arduino® Portena H7](https://store.arduino.cc/products/portenta-h7).
31-
- Arduino® Portenta Max Carrier.
31+
- [Arduino® Portenta Max Carrier](http://store.arduino.cc/portenta-max-carrier).
3232
- 868-915 MHz antenna with SMA connector.
3333
- USB-C cable (either USB-A to USB-C or USB-C to USB-C).
34-
- [Arduino IDE 2.0](https://www.arduino.cc/en/software).
34+
- Arduino IDE ([online](https://create.arduino.cc/) or [offline](https://www.arduino.cc/en/main/software)).
3535
- [Arduino MKRWAN library](https://github.com/arduino-libraries/MKRWAN).
3636
- An active account in [TTN](https://www.thethingsnetwork.org/).
3737

@@ -41,7 +41,7 @@ The Arduino® Portenta Max Carrier provides you with an unlimited range of appli
4141

4242
![CMWX1ZZABZ-078 LoRaWAN® module in the Portenta Max Carrier.](assets/mc_ard_ttn_module.png)
4343

44-
***For more in-depth information about LoRa® and LoRaWAN®, please read [The Arduino Guide to LoRa® and LoRaWAN®](https://docs.arduino.cc/learn/communication/lorawan-101).***
44+
***For more in-depth information about LoRa® and LoRaWAN®, please read [The Arduino Guide to LoRa® and LoRaWAN®](/learn/communication/lorawan-101).***
4545

4646
## Connecting to TTN
4747

@@ -65,25 +65,25 @@ Begin by attaching the Arduino® Portenta H7 board to the high-density connector
6565

6666
![CMWX1ZZABZ-078 LoRaWAN® module in the Portenta Max Carrier.](assets/mc_ard_hd_ttn_connectors.png)
6767

68-
To power the CMWX1ZZABZ-078 LoRaWAN® module of the Portenta Max Carrier, you can use the **DC power jack** (with a 4.5V to 36V external DC power supply) of the Portenta Max Carrier or a **18650 3.7V Li-Ion battery**, connected to the Portenta Max Carrier battery clips; you can power the module also directly from the USB-C connector of the Portenta H7 board. **Also, do not forget to attach an 868-915 MHz antenna to the SMA connector (J9) in the Max Carrier**.
68+
To power the CMWX1ZZABZ-078 LoRaWAN® module of the Portenta Max Carrier, you can use the **DC power jack** (with a 4.5V to 36V external DC power supply) of the Portenta Max Carrier or a **18650 3.7V Li-Ion battery**, connected to the Portenta Max Carrier battery clips; you can power the module also directly from the USB-C connector of the Portenta H7 board. **Also, do not forget to attach an 868-915 MHz antenna to the SMA connector (J9) on the Max Carrier**.
6969

7070
![Power sources and LoRa® antenna connector in the Portenta Max Carrier.](assets/mc_ard_ttn_power.png)
7171

7272
***Using the LoRaWAN® module of the Portenta Max Carrier without an antenna may damage it. Please, do not forget to connect a suitable antenna to the dedicated SMA connector (J9) on the Portenta Max Carrier.***
7373

74-
Now you can connect the Portenta H7 board to your computer using a USB-C cable. **Don't forget to change the position of the BOOT DIP switch** (SW1), **from BOOT SEL to BOOT**; otherwise, you will not be able to program your Portenta H7 board when attached to the Portenta Max Carrier.
74+
Now you can connect the Portenta H7 board to your computer using a USB-C cable. **Don't forget to change the position of the BOOT DIP switch (SW1) to OFF** ; otherwise, you will not be able to program your Portenta H7 board when attached to the Portenta Max Carrier.
7575

7676
![Power sources and LoRa® antenna connector in the Portenta Max Carrier.](assets/mc_ard_ttn_boot_sel.png)
7777

7878
### 2. Setting up the Software
7979

80-
You can use several Arduino libraries with the CMWX1ZZABZ-078 LoRaWAN® module from Murata®; we recommend the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN), developed by the Arduino Team. The MKRWAN library provides you the APIs to communicate with LoRa® and LoRaWAN® networks using the CMWX1ZZABZ-078 module. You can use this library in the Arduino IDE, both [online](https://create.arduino.cc/editor) and [offline](https://www.arduino.cc/en/software).
80+
You can use several Arduino libraries with the CMWX1ZZABZ-078 LoRaWAN® module from Murata®; we recommend the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN), developed by the Arduino Team. The MKRWAN library provides you with the APIs to communicate with LoRa® and LoRaWAN® networks using the CMWX1ZZABZ-078 module. You can use this library in the Arduino IDE, both [online](https://create.arduino.cc/editor) and [offline](https://www.arduino.cc/en/software).
8181

82-
If you are using the online IDE, you don't need to do anything; the library is already installed and ready to be used. If you are using the offline IDE, you must install the library **manually**. Installing the library can be done quickly by navigating to **Tools > Manage Libraries...** and then in the **Library Manager** search for **MKRWAN** library by Arduino; remember to install the latest version of the libraries. You can also access the Library Manager using the left toolbar of the IDE, as shown in the image below:
82+
If you are using the online IDE, you don't need to do anything; the library is already installed and ready to be used. If you are using the offline IDE, you must install the library **manually**. Installing the library can be done quickly by navigating to **Tools > Manage Libraries...** and then in the **Library Manager** search for **MKRWAN** library by Arduino; remember to install the latest version of the libraries. You can also access the Library Manager using the left toolbar of the IDE, as shown in the image below:
8383

8484
![Library Manager in the Arduino IDE 2.](assets/mc_ard_ttn_library.png)
8585

86-
***Currently, there are two versions of the MKRWAN library. We recommend using the MKRWAN_v1 library since MKRWAN_v2 library is still in beta.***
86+
***Currently, there are two versions of the MKRWAN library. We recommend using the MKRWAN_v1 library since MKRWAN_v2 library is still in beta phase.***
8787

8888
To use the MKRWAN library with the Portenta Max Carrier, you must define `PORTENTA_CARRIER` before the library inclusion, as shown below:
8989

@@ -94,24 +94,24 @@ To use the MKRWAN library with the Portenta Max Carrier, you must define `PORTEN
9494

9595
#### 2.1 Updating the LoRaWAN® Module Firmware
9696

97-
The LoRaWAN® module firmware of the Portenta Max Carrier **must be updated** before its first use. This can be done using the example sketch `MKRWANFWUpdate_standalone` of the MKRWAN library. You can open this example by navigating to **Files > Examples MKRWAN**; before uploading the sketch into the Portenta H7 board, open the `MKRWANFWUpdate_standalone.ino` file and define `PORTENTA_CARRIER` before the library inclusion, as shown in the image below:
97+
The LoRaWAN® module firmware of the Portenta Max Carrier **must be updated** before its first use. This can be done using the example sketch `MKRWANFWUpdate_standalone` of the MKRWAN library. You can open this example by navigating to **File > Examples > MKRWAN**. Before uploading the sketch to the Portenta H7 board, open the `MKRWANFWUpdate_standalone.ino` file and define `PORTENTA_CARRIER` before the library inclusion, as shown in the image below:
9898

9999
![Library Manager in the Arduino IDE 2.](assets/mc_ard_ttn_firmware_1.png)
100100

101-
Upload the sketch, open the Serial Monitor and wait for the firmware update to finish. You should see a confirmation message when the process is done as shown in the image below:
101+
Upload the sketch, open the Serial Monitor and wait for the firmware update to finish. You should see a confirmation message when the process is done.
102102

103103

104104
### 3. Provisioning the Arduino® Portenta Max Carrier
105105

106-
Device provisioning is a process comparable to bank card numbering. Let's think about bank cards; bank cards numbers start with a six-digit vendor ID number that indicates who allocated and controls the card's security; the remaining digits are unique numbers associated with a specific card. Devices with LoRa® and LoRaWAN® capabilities have a similar system; the Join Server Unique Identifier (usually referred to as `JoinEUI`) is a number that manages the security and authorizes the device in a network, while the **Device Unique Identifier** (usually referred to as `DevEUI`) is a unique number that identifies the device. The `JoinEUI` and `DevEUI` numbers, are required to send information to TTN; the `JoinEUI` number is provided by the network (in this case TTN) while the `DevEUI` is provided by the manufacturer of the device's LoRa® module.
106+
Device provisioning is a process comparable to bank card numbering. Let's think about bank cards; bank cards numbers start with a six-digit vendor ID number that indicates who allocated and controls the card's security; the remaining digits are unique numbers associated with a specific card. Devices with LoRa® and LoRaWAN® capabilities have a similar system; the **Join Server Unique Identifier** (usually referred to as `JoinEUI`) is a number that manages the security and authorizes the device in a network, while the **Device Unique Identifier** (usually referred to as `DevEUI`) is a unique number that identifies the device. The `JoinEUI` and `DevEUI` are required to send information to TTN; the `JoinEUI` number is provided by the network (in this case TTN) while the `DevEUI` is provided by the manufacturer of the device's LoRa® module.
107107

108108
The following sketch let's you find out what is the `DevEUI` of your Portenta Max Carrier:
109109

110110
```arduino
111111
#define PORTENTA_CARRIER
112112
#include <MKRWAN.h>
113113
114-
_lora_band region = US915;
114+
auto region = US915;
115115
116116
LoRaModem modem(Serial1);
117117
@@ -124,21 +124,20 @@ void setup() {
124124
while(1) {}
125125
}
126126
127-
Serial.print("Your Portenta Max Carrier DevEUI is: ");V
127+
Serial.print("Your Portenta Max Carrier DevEUI is: ");
128128
Serial.println(modem.deviceEUI());
129129
}
130130
131-
void loop() {
132-
}
131+
void loop() {}
133132
```
134133

135134
The only line you may need to change before uploading the code is the one that sets the frequency:
136135

137136
```arduino
138-
_lora_band region = US915;
137+
auto region = US915;
139138
```
140139

141-
Set the frequency designator according to your country if needed. You can find more information about frequency plans definitions used in TTN [here](https://www.thethingsnetwork.org/docs/lorawan/frequency-plans/). After you upload the sketch into your Portenta H7 board, you should see the Portenta Max Carrier `DevEUI` in the Arduino IDE Serial Monitor as shown below:
140+
Set the frequency designator according to your country. You can find more information about frequency plans definitions used in TTN [here](https://www.thethingsnetwork.org/docs/lorawan/frequency-plans/). After you upload the sketch to your Portenta H7 board, you should see the Portenta Max Carrier `DevEUI` in the Arduino IDE Serial Monitor as shown below:
142141

143142
```arduino
144143
Your Portenta Max Carrier DevEUI is: a861XXXXXXXXXXXX
@@ -152,7 +151,7 @@ To send information to TTN, first we need to **create an application and registe
152151

153152
![TTN console welcome page.](assets/mc_ard_ttn_console_1.png)
154153

155-
Now click in **Create an application**. You will need to add the following information:
154+
Now click on **Create an application**. You will need to add the following information:
156155

157156
* **Owner**: the person or organization that owns the application.
158157
* **Application ID**: a unique identifier for your application (must be lowercase and without spaces).
@@ -182,7 +181,7 @@ Leave the **Cluster settings** option unchecked. Then continue with the followin
182181
* **DevEUI**: fill it with the `DevEUI` number of your Portenta Max Carrier you found [before](#3-provisioning-the-arduino-portenta-max-carrier).
183182
* **AppEUI**: fill it with zeros or enter your own.
184183
* **AppKey**: generate one or enter your own.
185-
* **Device ID**: must be lowercase and without spaces.
184+
* **Device ID**: A custom identifier for your board, must be lowercase and without spaces.
186185

187186
Click on **Register end device**; this will take you to a **Device Overview** page where you will see all the information related to the device. Now, you will use some of this information with your Portenta Max Carrier to send data to TTN.
188187

@@ -197,7 +196,7 @@ Now, let's start sending information to TTN. The following sketch enables you to
197196
#include <MKRWAN.h>
198197
#include "arduino_secrets.h"
199198
200-
_lora_band region = US915;
199+
auto region = US915;
201200
202201
LoRaModem modem(Serial1);
203202
@@ -234,12 +233,11 @@ void setup() {
234233
235234
delay(5000);
236235
237-
int err;
238236
modem.setPort(3);
239237
modem.beginPacket();
240238
modem.print("HelLoRa World!");
241-
err = modem.endPacket(true);
242-
if (err > 0) {
239+
int errorCode = modem.endPacket(true);
240+
if (errorCode > 0) {
243241
Serial.println("Data sent correctly!");
244242
} else {
245243
Serial.println("Error sending data...");
@@ -254,16 +252,16 @@ void loop() {
254252
}
255253
```
256254

257-
The `arduino_secrets.h` file which contains AppEUI and AppKey numbers for the TTN applications can be defined as following code. AppEUI and AppKey information is found on the End device page of the Application of TTN.
255+
The `arduino_secrets.h` file which contains AppEUI and AppKey numbers for the TTN applications can be defined as following code. AppEUI and AppKey information is found on the End device page of the TTN Application.
258256

259257
```arduino
260258
String appEui = "xxxxxxxxxxxxxxxx";
261259
String appKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
262260
```
263261

264-
If data was sent correctly to TTN, you should see the following messages in the Arduino IDE Serial Monitor:
262+
If data was sent correctly to TTN, you should see the following messages in the Arduino IDE Serial Monitor: `Data sent correctly!`
265263

266-
In your device overview dashboard in TTN, you should see changes in data activity every time a new message is sent:
264+
In your device overview dashboard on TTN, you should see changes in data activity every time a new message is sent.
267265

268266
## Conclusion
269267

@@ -278,5 +276,5 @@ You have now successfully configured and used the onboard LoRaWAN® module of yo
278276
While working on the sketch or when tried to upload the sketch, the Arduino IDE might show some errors preventing to proceed on the development. You can try the following troubleshooting tips to solve the commonly known issues:
279277

280278
* If the sketch upload process fails, check if your Portenta H7 is in bootloader mode. To put the Portenta H7 into Bootloader mode, double-press its RESET button and verify that the green LED is waving. After this, you can try re-uploading the sketch.
281-
* Check the position of the BOOT DIP switch of the Portenta Max Carrier. If the Portenta H7 gets into bootloader mode immediately after power-on, including when connected via USB-C, change the position of the BOOT DIP switch from BOOT SEL to BOOT.
282-
* If the Arduino IDE fails to compile the sketch, check if you have defined `PORTENTA_CARRIER` before MKRWAN library inclusion.
279+
* Check the position of the BOOT DIP switch of the Portenta Max Carrier. If the Portenta H7 gets into bootloader mode immediately after power-on, including when connected via USB-C, change the position of the BOOT DIP switch to OFF.
280+
* If the Arduino IDE fails to compile the sketch, check if you have defined `PORTENTA_CARRIER` before the MKRWAN library inclusion.

0 commit comments

Comments
 (0)