You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/cloud/iot-cloud/tutorials/04.cloud-lora-getting-started/cloud-lora-getting-started.md
+20-16
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ So, what does that mean for you? It means that you can connect to any of the **2
22
22
23
23
In this tutorial we will walk you through the steps needed to successfully provision devices that use the Arduino Cloud & The Things Network, from unboxing your device until viewing data on a dashboard!
24
24
25
+
***Please note that when working with LoRaWAN® devices, data rates are very limited. Messages sent from devices should be limited to once every several minutes. Methods for implementing this are described further down in this article. To read more about limitations using the LoRaWAN® network, please visit [The Things Network Limitations article](https://www.thethingsnetwork.org/docs/lorawan/limitations/).***
26
+
25
27
### Terminology Run-Trough
26
28
27
29
-**LoRa®** - short for **Lo**ng **Ra**nge, and is a modulation technique used to send and receive data over low-power, wide-area networks (LPWAN).
@@ -62,7 +64,6 @@ The goals of this project are:
62
64
-[Arduino MKR WAN 1300](https://store.arduino.cc/mkr-wan-1300) or [Arduino MKR WAN 1310](https://store.arduino.cc/mkr-wan-1310)
63
65
-[Antenna](https://store.arduino.cc/antenna)
64
66
65
-
66
67
## Circuit
67
68
68
69
Follow the wiring diagram below to connect the antenna to the MKR WAN 1300/1310 board.
@@ -166,7 +167,7 @@ After some time, the automatic email sent out by TTI will expire. If the link is
166
167
167
168
## Step 3: Completing Arduino Cloud Setup
168
169
169
-
In this step, we will complete the Arduino Cloud setup that we started earlier by configuring a device. We will create a simple **test variable**, that we will use to send data from the MKR WAN 1300/1310 device. This will just be a counter that updates every 10 seconds, to see if the data can be successfully sent from **end device** to the **Arduino Cloud** via the **The Things Network**.
170
+
In this step, we will complete the Arduino Cloud setup that we started earlier by configuring a device. We will create a simple **test variable**, that we will use to send data from the MKR WAN 1300/1310 device. This will just be a counter that updates **3 minutes**, to see if the data can be successfully sent from **end device** to the **Arduino Cloud** via the **The Things Network**.
170
171
171
172
***At this point, we will need to make sure that we are in reach of a gateway registered to The Things Network. This might take a few attempts, depending on your device's success of transmitting to a nearby gateway. You can check the coverage of your area through either [TTN Map](https://www.thethingsnetwork.org/map) or the [TTN Mapper](https://ttnmapper.org/)***
172
173
@@ -178,20 +179,14 @@ In this step, we will complete the Arduino Cloud setup that we started earlier b
178
179
179
180

180
181
181
-
**3.** Let's head to the **Sketch** tab, and add the following code inside the `void loop()`:
182
-
183
-
```arduino
184
-
test = test + 1;
185
-
delay(10000);
186
-
```
187
-
188
-
This code will simply increase the `test` variable every 10 seconds, which will sync with the variable we just created. That means that every 10 seconds, there's a change in value, which should also be visible in the Arduino Cloud if the data is sent properly.
189
-
190
-
You can take a look at the full code in the snippet below:
182
+
**3.** Let's head to the **Sketch** tab, where you can use the following code:
191
183
192
184
```arduino
193
185
#include "thingProperties.h"
194
186
187
+
unsigned long previousMillis = 0;
188
+
const long interval = 180000; //180 second interval (3 minutes)
189
+
195
190
void setup() {
196
191
// Initialize serial and wait for port to open:
197
192
Serial.begin(9600);
@@ -217,14 +212,23 @@ void setup() {
217
212
218
213
void loop() {
219
214
ArduinoCloud.update();
220
-
// Your code here
221
-
hello = hello + 1;
222
-
Serial.println(hello);
223
-
delay(10000);
224
215
216
+
unsigned long currentMillis = millis();
217
+
218
+
if (currentMillis - previousMillis >= interval) {
219
+
220
+
previousMillis = currentMillis;
221
+
222
+
test +=1;
223
+
224
+
}
225
225
}
226
226
```
227
227
228
+
This code will simply increase the `test` variable every 3 minutes, which will sync with the variable we just created. That means that every 3 minutes, there's a change in value, which should also be visible in the Arduino Cloud if the data is sent properly.
229
+
230
+
***Note that the 180000 milliseconds / 180 seconds interval should be in place to limit the amount of data being sent from the device to the Arduino Cloud. This can also be defined during the variable creation in the Thing interface to update only every 180 seconds.***
231
+
228
232
**4.** Finally, we can upload the sketch to the board. After we have uploaded it, the board will start sending data via The Things Network, to the Arduino Cloud. We can check if we are receiving any data in the **Things overview**, under the **"Last Value / Last Update"** column.
229
233
230
234

0 commit comments