Skip to content

Commit f8cd50f

Browse files
TaddyHCmarqdevx
authored andcommitted
Updated tutorial content
1 parent 40d88d4 commit f8cd50f

File tree

1 file changed

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

1 file changed

+37
-23
lines changed

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

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,53 +180,50 @@ Now, let's start sending information to TTN. The following sketch let's you send
180180
```arduino
181181
#define PORTENTA_CARRIER
182182
#include <MKRWAN.h>
183-
184-
_lora_band region = US915;
183+
#include "arduino_secrets.h"
185184
186185
LoRaModem modem(Serial1);
187186
188-
String appEui;
189-
String appKey;
190-
191187
void setup() {
192188
Serial.begin(115200);
193189
while (!Serial);
194-
Serial.println(F("LoRaWAN + Portenta Max Carrier (OTAA)"));
190+
Serial.println(F("LoRa + Portenta Max Carrier (OTAA)"));
195191
196-
if (!modem.begin(region)) {
197-
Serial.println(F("- Failed to start module!"));
192+
// change this to your regional band (eg. US915, AS923, ...)
193+
if (!modem.begin(US915)) {
194+
Serial.println(F("Failed to start module"));
198195
while (1) {}
199196
};
200197
201-
Serial.print(F("- Your module version is: "));
198+
Serial.print(F("Your module version is: "));
202199
Serial.println(modem.version());
203200
204201
if (modem.version() != ARDUINO_FW_VERSION) {
205-
Serial.println(F("- Please make sure that the latest module firmware is installed."));
206-
Serial.println(F("- To perform a firmware update, use the 'MKRWANFWUpdate_standalone.ino' example sketch."));
202+
Serial.println(F("Please make sure that the latest modem firmware is installed."));
203+
Serial.println(F("To update the firmware upload the 'MKRWANFWUpdate_standalone.ino' sketch."));
207204
}
208205
209-
Serial.print(F("- Your device EUI is: "));
206+
Serial.print(F("Your device EUI is: "));
210207
Serial.println(modem.deviceEUI());
211208
212-
// To use predfined setting for OTAA or use a custom setting
209+
// To Use Predfined Setting for OTAA or use Custom Setting
213210
int mode = 0;
214211
while (mode != 1 && mode != 2) {
215-
Serial.println(F("- Use predefined AppEUI & AppKey settings? (1) Yes | (2) No"));
212+
Serial.println(F("Use predefined appEUI & appKEY Settings? (1) Yes | (2) No"));
216213
while (!Serial.available());
217214
mode = Serial.readStringUntil('\n').toInt();
218215
}
219216
220-
if (mode == 2) {
221-
Serial.println(F("- Enter your AppEUI"));
217+
if (mode == 2){
218+
Serial.println(F("Enter your APP EUI"));
222219
while (!Serial.available());
223220
appEui = Serial.readStringUntil('\n');
224221
225-
Serial.println(F("- Enter your AppKey"));
222+
Serial.println(F("Enter your APP KEY"));
226223
while (!Serial.available());
227224
appKey = Serial.readStringUntil('\n');
228-
} else if (mode == 1) {
229-
Serial.println(F("- Using predefined settings"));
225+
} else if (mode == 1){
226+
Serial.println(F("Using predefined Settings"));
230227
}
231228
232229
appKey.trim();
@@ -235,22 +232,22 @@ void setup() {
235232
int connected = modem.joinOTAA(appEui, appKey);
236233
237234
if (!connected) {
238-
Serial.println("- Something went wrong; are you indoor? Move near a window and retry...");
235+
Serial.println("Something went wrong; are you indoor? Move near a window and retry");
239236
while (1) {}
240237
}
241238
242239
delay(5000);
243240
244-
// Sending packet
241+
// Sending Packet Off
245242
int err;
246243
modem.setPort(3);
247244
modem.beginPacket();
248245
modem.print("HeLoRA world!");
249246
err = modem.endPacket(true);
250247
if (err > 0) {
251-
Serial.println("- Message sent correctly!");
248+
Serial.println("Message sent correctly!");
252249
} else {
253-
Serial.println("- Error sending message :(");
250+
Serial.println("Error sending message :(");
254251
}
255252
}
256253
@@ -264,7 +261,24 @@ void loop() {
264261

265262
## Conclusion
266263

264+
You have now succesfully configured the Portenta Max Carrier with Portenta H7 to power up and use its onboard CMWX1ZZABZ-078 LoRaWAN® communications module. You have learned how to properly setup The Things Network (TTN) and establish a communication using its LoRaWAN® connectivity.
265+
267266
### Next Steps
268267

268+
- Scale up the usage of Portenta Max Carrier by using its additional peripherals and turning into an interesting industrial grade projects, taking the advantage of LoRaWAN® connectivity.
269+
- You can read more about LoRa and LoRaWAN, and get a deeper understanding of how you can adapt your higher grade projects into real world solver [here](https://docs.arduino.cc/learn/communication/lorawan-101).
270+
269271
## Troubleshooting
270272

273+
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.
274+
275+
- If the sketch upload process fails, please put the Portenta H7 into Bootloader mode. To put the Portenta H7 into Bootloader mode, it is required to double-press the RESET button found on the Portenta H7 and verify that the Green LED is waving. After this you can try re-uploading the sketch and it will be successfuly solved.
276+
277+
- If the Portenta H7 gets into Bootloader mode immediately after power on, including when connected via USB-C to a device, please make sure to check the DIP Switch found on the Portenta Max Carrier board. The DIP Switch must be configured to a device address to be powered on. The DIP Switch will allow to configure BOOT_SEL to configure the address. You will be able to upload and run the code without any issue after this.
278+
279+
- If the Arduino IDE fails to compile the sketch, please make sure to have defined for Portenta Max Carrier settings. The following one-line code should be defined above all the sketch that have been written. With this, there should not be any issue compiling sketches designed for Portenta Max Carrier boards.
280+
281+
```cpp
282+
#define PORTENTA_CARRIER
283+
```
284+

0 commit comments

Comments
 (0)