HackSpace – September 2019

(Jacob Rumans) #1

TUTORIAL


Let’s learn LoRa!


Figure 6
Beginning to set up
a dashboard on the
myDevices site
Figure 8
Selecting the
CayenneLPP options
for our dashboard

Above
The standard
dashboard showing
our data

Figure 7
Select The Things Network from the left-hand menu

the two lines under the comment ‘//Replace these
with your AppEUI and AppKey‘) So, of course,
copy and paste those entire two lines from your
Device Overview Example Code box to replace the
similar ones in the Arduino sketch.

DECODING THE PAYLOAD
Save your sketch and then click Verify. If the code
compiles correctly, then double-check that your The
Things Uno is still attached correctly as an Arduino
Leonardo, and the correct port is selected, and then

upload the sketch to The Things Uno. Leave The
Things Uno plugged into your laptop for power after
the sketch has uploaded.
You now have a LoRaWAN node with a sensor
hopefully transmitting its payload of the sensor data
on humidity and temperature, if you are within range
of a gateway (it’s worth taking your laptop and The
Things Uno outside to increase chances!) Returning
to The Things Network website, click the applications
tab and select the application you created, and then in
the Application Overview page, select the ‘Data’ tab
from the upper right-hand side. Wait for a short while,
and you should start to see data packets appear
with some information about the data, and most
importantly, the payload in the end columns stating
the temperature and humidity readings from your
sensor (Figure 5). As we set the application to read
the payload as being of the CayenneLPP type, our
payload is decoded and is nicely displayed, labelled
correctly ‘temperature’ and ‘humidity’, instead of just
a raw collection of bytes. If you click on a particular

Our payload is decoded and is nicely displayed,
labelled correctly ‘temperature’ and ‘humidity’,
instead of just a raw collection of bytes


Free download pdf