Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 37b5142

Browse files
committed
Fix content issues in TTN tutorial
1 parent dee4395 commit 37b5142

File tree

1 file changed

+37
-45
lines changed
  • content/tutorials/portenta-h7/vs-ard-ttn

1 file changed

+37
-45
lines changed
Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
11
# Connecting the Vision Shield to TTN using LoRa
22
## Overview
33

4-
This tutorial explains how to connect your Portenta H7 to The Things Network (TTN) using the the Vision Shield's Lora Connectivity feature. A data communication channel will be enabled between the H7 and a TTN application that will be configured on your TTN console.
4+
This tutorial explains how to connect your Portenta H7 to The Things Network (TTN) using the the Vision Shield's LoRa Connectivity feature. A data communication channel will be enabled between the H7 and a TTN application that will be configured on your TTN console.
55

6-
[note]
7-
8-
**Note:** In order to connect your Portenta to the TTN you need to ensure that you are within range (10 Km) from an available Lora Gateway. It is recommended that you check Lora Gateway availability on [The Things Network map](https://www.thethingsnetwork.org/map) before you try this tutorial.
9-
10-
[/note]
6+
***In order to connect your Portenta to the TTN make sure you are within the range (max. 10 Km) from an available LoRa Gateway. Indoor gateways will have a much shorter range. It is recommended that you check LoRa Gateway availability on [The Things Network map](https://www.thethingsnetwork.org/map) before you try this tutorial.***
117

128
### You Will Learn
139

14-
- About LoRaWAN® and The Things Network,
15-
- About creating a TTN application,
16-
- How to establish a connection between the H7 and the TTN,
10+
- About LoRaWAN® and The Things Network,
11+
- About creating a TTN application,
12+
- How to establish a connection between the H7 and the TTN,
1713

1814
### Required Hardware and Software
1915

20-
- [Portenta H7 board](https://store.arduino.cc/portenta-h7)
21-
- [Portenta Vision Shield - LoRa](https://store.arduino.cc/portenta-vision-shield-lora)
22-
- [1x Dipole Pentaband antenna](https://store.arduino.cc/antenna) or a UFL Antenna of the H7
23-
- Arduino [offline](https://www.arduino.cc/en/main/software) IDE or Arduino ([Web Editor](https://create.arduino.cc/)
24-
- USB C cable (either USB A to USB C or USB C to USB C)
25-
- An [account](https://account.thethingsnetwork.org/users/login) with The Things Network
16+
- [Portenta H7 board](https://store.arduino.cc/portenta-h7)
17+
- [Portenta Vision Shield - LoRa](https://store.arduino.cc/portenta-vision-shield-lora)
18+
- [1x Dipole Pentaband antenna](https://store.arduino.cc/antenna) or a UFL Antenna of the H7
19+
- Arduino [offline](https://www.arduino.cc/en/main/software) IDE or Arduino ([Web Editor](https://create.arduino.cc/)
20+
- USB C cable (either USB A to USB C or USB C to USB C)
21+
- An [account](https://account.thethingsnetwork.org/users/login) with The Things Network
2622

2723
## Connecting to the TTN
2824

2925
The Portenta Vision Shield - LoRa can be connected to the TTN and can transmit data to other devices connected to this network through a secure channel. This channel is nothing but an applicaiton on the TTN network dedicated for your board. In this tutorial, you will be guided through a step-by-step process of setting up your Portenta board and the Vision Shield Lora to communicate with a TTN application. As stated before, to be able to follow this guide, to be under coverage of one of the TTN gateways. You can check for [the coverage](https://www.thethingsnetwork.org/map) now if you have not done so yet.
3026

31-
### 1. Setting up the Environment
27+
### 1. Setting up the Environment
3228

3329
Start by pointing your browser to www.thethingsnetwork.org and use the Sign Up button to setup an account. Next, then fill all the required fields to complete a new registration (if you already have a TTN account, skip this step and continue by signing in).
3430

3531
![The Things Network homepage](assets/vs_ard_ttn_home.png)
3632

3733
### 2. Creating an app on TTN
3834

39-
Once you have created an account with TTN, you need to create a TTN [application](https://www.thethingsnetwork.org/docs/applications/). This(?) application provides a way to aggregate data from different devices, and then use these data with other online / offline tools. Go to your [console](https://console.thethingsnetwork.org), and click on **Applications**
35+
Once you have created an account with TTN, you need to create a TTN [application](https://www.thethingsnetwork.org/docs/applications/). An application provides a way to aggregate data from different devices, and then use these data with other 3rd party integrations. Go to your [console](https://console.thethingsnetwork.org), and click on **Applications**
4036

4137
![Select Applications on the Console](assets/vs_ard_ttn_app.png)
4238

@@ -46,8 +42,8 @@ Here you'll have a list of all your applications. Now create your first app by p
4642

4743
You have now to fill only the first two fields:
4844

49-
* The first one is the **ID** of your app: this must be lowercase and without spaces.
50-
* The second one is a **Description** of your app, and there's no restrictions on formatting
45+
- The first one is the **ID** of your app: this must be lowercase and without spaces.
46+
- The second one is a **Description** of your app, and there's no restrictions on formatting
5147

5248
![Adding a application](assets/vs_ard_ttn_app_param.png)
5349

@@ -57,46 +53,42 @@ After completing these two fields, press on the "Add application" button located
5753

5854
Let's take a closer look at these sections:
5955

60-
* **Application Overview** and Application EUIS: in order to use this app, you'll need the Application ID and its EUIs. An EUI is a globally unique identifier for networks, gateways applications and devices. The EUIs are used to identify all parts of the LoRaWAN inside the backend server.
61-
* **Devices**: here you can see and manage all the associated devices (e.g. your Portenta H7 with Vision Shield Lora, Arduino MKR WAN 1300 or MKR WAN 1310), or proceed with the registration of new one.
62-
* **Collaborators**: here you can see and manage all the app collaborators. To integrate with other collaborative platforms or to manage access rights to the app with other TTN registered profiles.
63-
* **Access keys**: it's the most sensible information. It is basically the key to gain access to your app, so keep it safe.
56+
- **Application Overview** and Application EUIS: in order to use this app, you'll need the Application ID and its EUIs. An EUI is a globally unique identifier for networks, gateways applications and devices. The EUIs are used to identify all parts of the LoRaWAN inside the backend server.
57+
- **Devices**: here you can see and manage all the associated devices (e.g. your Portenta H7 with Vision Shield Lora, Arduino MKR WAN 1300 or MKR WAN 1310), or proceed with the registration of new one.
58+
- **Collaborators**: here you can see and manage all the app collaborators. To integrate with other collaborative platforms or to manage access rights to the app with other TTN registered profiles.
59+
- **Access keys**: it's the most sensible information. It is basically the key to gain access to your app, so keep it safe.
6460

6561
### 3. Configuring the Vision Shield
6662

6763
It's now time to connect your Portenta H7 and Lora Vision Shield to TTN. You'll need to upload code to the board, so as you probably already know, there are two options:
6864

69-
* Use the [Arduino Web Editor](https://create.arduino.cc/editor)
70-
* Use the [Arduino IDE](https://www.arduino.cc/en/software), (this is the option this guide will follow)
65+
- Use the [Arduino Web Editor](https://create.arduino.cc/editor)
66+
- Use the [Arduino IDE](https://www.arduino.cc/en/software), (this is the option this guide will follow)
7167

7268
Plug the Portenta Vision Shield - LoRa to the Portenta H7 and them to your PC through the USB port. Be sure to have selected the right board "Arduino Portenta H7 (M7 core)" and the right port.
7369

7470
![Select port M7 Core](assets/vs_ard_select_port.png)
7571

76-
The LoRa module on the Vision Shield can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)( if you can't find it in your examples list, you can go to **tools > library manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa and LoRaWAN networks and can be Installed from the library Manager. The first code you need to upload and run is from the **MKRWAN** library, and its name is _FirstConfiguration_.
72+
The LoRa module on the Vision Shield can be accessed by using the [MKRWAN library](https://github.com/arduino-libraries/MKRWAN)( if you can't find it in your examples list, you can go to **tools > library manager** and type "MKRWAN library" to install it). This library provides all the APIS to communicate with LoRa and LoRaWAN networks and can be Installed from the library Manager. The first code you need to upload and run is from the **MKRWAN** library, and its name is **FirstConfiguration**.
7773

7874
![Upload code to IDE](assets/vs_ard_select_example.png)
7975

8076
The only line you may need to change before uploading the code is the one that sets the frequency. Set the frequency code according to your country if needed. You can find more information about frequency by country at [this TTN link](https://www.thethingsnetwork.org/docs/lorawan/frequency-plans.html).
8177

8278
```cpp
83-
... // change this to your regional band (eg. US915, AS923, ...)
79+
// change this to your regional band (eg. US915, AS923, ...)
8480
if (!modem.begin(EU868)) { ...
8581
```
86-
87-
[note]
88-
89-
**Note:** Consider that in Australia the boards connect correctly to TTN gateways on AS923 frequencies; AU915 frequencies requires the selection of sub band 2, not yet implemented in the firmware.
90-
91-
[/note]
82+
***Consider that in Australia the boards connect correctly to TTN gateways on AS923 frequencies; AU915 frequencies requires the selection of sub band 2, not yet implemented in the firmware.***
9283
9384
Once you have added to the sketch the frequency according to your country, you can upload it to the board. Then, once the upload is completed open the Serial Monitor. The following details will show:
9485
95-
```cpp
86+
```text
9687
Your module version is: ARD-078 1.2.1
9788
Your device EUI is: a8xxxxxxxxxxxxxx
9889
Are you connecting via OTAA (1) or ABP (2)?
9990
```
91+
10092
In order to select the way in which the board is going to connect with TTN (OTAA or ABP) we need to configure it on the TTN portal. We will see which option we should select in the following steps.
10193

10294
### 4. Registring the Portenta on TTN
@@ -106,7 +98,7 @@ Before your Portenta H7 can start communicating with the TTN you need to [regist
10698
![Registering a Device](assets/vs_ard_ttn_click_register.png)
10799

108100
On the registration page, fill in **Device ID** and **EUI**.
109-
**Note**: The Device ID must be lowercase and without spaces. The **EUI** should be copied from the Serial Monitor.```
101+
**Note**: The Device ID must be lowercase and without spaces. The **EUI** should be copied from the Serial Monitor.
110102

111103
![Entering the device EUI](assets/vs_ard_ttn_register_device.png)
112104

@@ -118,13 +110,13 @@ After pressing the Register button, your board will show up on the **Device Over
118110

119111
Once your board has been registered you can send information to TTN. Let's come back to the Serial Monitor and proceed. It will ask for:
120112

121-
* activation mode (that, in this case, is OTAA as you can see in the screenshot above),
122-
* the Application EUI
123-
* the App Key.
113+
- Activation mode (that, in this case, is OTAA as you can see in the screenshot above),
114+
- The Application EUI
115+
- The App Key.
124116

125117
Lets start by making a connection through the OTAA. Enter "1" in the Serial Monitor input box and press ENTER. Then, find the EUI and the App key from TTN **Device Overview** page. You can read more into OTA vs ABP activation mode at [this link](https://www.thethingsnetwork.org/docs/devices/registration.html)
126118

127-
```cpp
119+
```text
128120
Your module version is: ARD-078 1.1.9
129121
Your device EUI is: a8xxxxxxxxxxxx0a
130122
Are you connecting via OTAA (1) or ABP (2)?
@@ -134,7 +126,7 @@ Enter your APP KEY
134126

135127
Next, introduce the **APP EUI** and the **APP KEY** in the Serial Monitor. If this process is done successfully, you will see this message:
136128

137-
```cpp
129+
```text
138130
Message sent correctly!
139131
```
140132

@@ -145,9 +137,9 @@ If you recieve this message, you have managed to configure the Portenta H7 and t
145137

146138
### Next Steps
147139

148-
- Try sending uplink and downlink messages between Portenta and your TTN application with _LoraSendAndReceive_ sketch from the MKRWAN library.
149-
- Experiment your Vision Shield's capabilities with OpenMV and the examples from the dedicated library for Arduino. You can continue with [this tutorial](https://www.arduino.cc/pro/tutorials/portenta-h7/por-openmv-bt) from the Arduino Pro site.
150-
- Combine LoRaWAN protocol with an OpenMV example to develop your own IoT application. Take advantage of the Vision Shield's camera to detect, filter, classify images, read QR codes or more.
140+
- Try sending uplink and downlink messages between Portenta and your TTN application with **LoraSendAndReceive** sketch from the MKRWAN library.
141+
- Experiment your Vision Shield's capabilities with OpenMV and the examples from the dedicated library for Arduino. You can continue with [this tutorial](https://www.arduino.cc/pro/tutorials/portenta-h7/por-openmv-bt) from the Arduino Pro site.
142+
- Combine LoRaWAN protocol with an OpenMV example to develop your own IoT application. Take advantage of the Vision Shield's camera to detect, filter, classify images, read QR codes or more.
151143

152144
## Troubleshooting
153145

@@ -156,5 +148,5 @@ The most common issue is that the device cannot connect to a TTN gateway. Again,
156148
If we are within good range of a gateway, we should also try to move our device and antenna to a window, and even hold it out the window and move it around. This has proven successful on numerous accounts, as the signal can travel less obstructed.
157149

158150
**Authors:** Lenard George, Ignacio Herrera
159-
**Reviewed by:** Jose Garcia, Linnea Åkerberg [02.02.2021]
160-
**Last revision:** Lenard George [27.3.2020]
151+
**Reviewed by:** Jose Garcia, Linnea Åkerberg [2021-02-02]
152+
**Last revision:** Sebastian Romero [2021-02-05]

0 commit comments

Comments
 (0)