Seeed SENSECAP User manual

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
2/ 38
Table of Contents
1. Overview.............................................................................................................................................................. 3
2. Retrieve SenseCAP Credentials............................................................................................................................ 4
3. Power on the Device............................................................................................................................................ 5
4. The Things Network Configuration...................................................................................................................... 7
4.1 Gateway Network Settings & Registration on TTN ........................................................................................ 8
4.1.1 LPS8 Gateway Network Settings......................................................................................................... 8
4.1.2 Gateway Registration on TTN ........................................................................................................... 10
4.2 Configure LPS8 and Connect to TTN............................................................................................................ 13
4.2.1 General Settings................................................................................................................................ 13
4.2.2 Frequency Settings............................................................................................................................ 13
4.2.3 Channel Settings ............................................................................................................................... 15
Please refer to the items in the following image for channel settings. ..................................................... 15
4.3 LoRaWAN Device Registration ............................................................................................................... 17
5. Packet Parsing.................................................................................................................................................... 21
Appendix-Code .......................................................................................................................................................... 25

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
3/ 38
1. Overview
SenseCAP Sensor Nodes are designed on The Things Network LoRaWAN servers, the firmware supports standard
LoRaWAN 1.0 protocol, making it possible to connect to other 3rd-party LoRaWAN gateways and servers.
When using SenseCAP Sensor Nodes with SenseCAP LoRaWAN Gateway, there is no need of complex configuration.
You can use it out-of-the-box, with the cloud platform and API services, saving you time in development. To learn
more about SenseCAP LoRaWAN Gateway, please kindly refer to https://sensecap.seeed.cc.
SenseCAP Sensor Nodes uses OTAA (Over The Air Activation), so theoretically three credentials (EUI, App EUI, App
Key) are needed to configure and adapt the SenseCAP Sensor Nodes to your LoRaWAN network.
This guide will take Dragino’s LPS8 LoRaWAN gateway and Raspberry Pi RHF0M301 LoRaWAN gateway as examples
to configure SenseCAP Sensor Nodes and send data to The Things Network and LoRaServer respectively.
Gateway Links:
LPS8 Indoor LoRaWAN Gateway
https://www.seeedstudio.com/LPS8-Indoor-LoRaWAN-Gateway-Included-SX1308-LoRa-Concentrator-p-4251.html
LoRa/LoRaWAN Gateway - 915MHz for Raspberry Pi 3
https://www.seeedstudio.com/LoRa-LoRaWAN-Gateway-915MHz-for-Raspberry-Pi-3-p-2821.html
LoRa LoRaWAN Gateway - 868MHz Kit with Raspberry Pi 3
https://www.seeedstudio.com/LoRa-LoRaWAN-Gateway-868MHz-Kit-with-Raspberry-Pi-3-p-2823.html

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
4/ 38
2. Retrieve SenseCAP Credentials
Device EUI is on the SenseCAP product label.
Mark down the Device EUI and Device Code (as shown in the image above) for future uses. Use HTTP API to retrieve
App EUI and App Key. You can use any HTTP tools or browser to issue an HTTP GET request.
In the API, replace the nodeEui and deviceCode with your own device EUI and Device Code respectively. And you
will get the following response.
Kind reminder: please mark down the Device EUI and Device Code for future uses.
curl
https://sensecap-
makerapi.seeed.cc/v1/security/device/node/acquirePrivateLorawanDeviceinfo?nodeEui=2cf7f
12204400000&deviceCode=E012780D304A1118
{
"code": "0",
"data": {
"nodeEui": "2cf7f12204400000",
"deviceCode": "E012780D304A1118",
"lorawanInformation": {
"dev_eui": "2cf7f12204400000",
"app_eui": "################",
"app_key": "################"
}
},
"time": 0.01
}

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
5/ 38
3. Power on the Device
1) The switch is hidden inside the device. You can open the device by turning the Sensor Probe part
counterclockwise.
2) After opening the device, flip the switch to “ON”, the LED on the lower-right corner will flash, indicating it’s
powered on. Please wait for 5~10 seconds, and the LED will flash quickly for 2 seconds, indicating it’s
connected to the network.
After powering on the device:
(1) The LED will flash once, and then it’s in OFF status.
(2) Wait for about 5s, it will quick flash for 2s, indicating it’s connected to the network.
(3) Stay OFF to save power consumption after joining the network.
(4) After it’s on for 15s, if the LED doesn’t flash quickly, press RESET to rejoin the network.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
6/ 38
Note: Each device will constantly sync with the cloud within 1 minute after it’s connected to the network. This
process takes up LoRa communication channel. When multiple devices are powered on and connected to the
network at the same time, it might congest the LoRa network, leading to failure in accessing the network. Hence,
we suggest each device is powered on at an interval of 1 minute.
3)After accessing the network, please connect the Sensor Probe back to the Sensor Node Controller by turning it
clockwise. Please note the labels on both sides should be aligned as the image below, or it will not be put back in
the right way. Only when the Sensor Probe is connected to the Sensor Node Controller correctly can the device
upload data.
•Boot and Reboot Sensor Nodes
To reboot the device, we’d suggest using RESET button instead of flipping the power switch. When using the
power switch to reboot the device, turn off the device and please wait for 3 seconds before turning it back on.
When the device is working in the ultra-low-power consumption mode, it can keep working for a while after being
shut down, which will lead to reboot failure if it’s powered on and off within a short interval.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
7/ 38
4. The Things Network Configuration
When choose different LoRa network servers, the configuration might be different. For some network servers, the
gateway can be configured from web service (its LoRa APP server). While for some other network serves, it’s
required to be configured at the gateway (e.g. via SSH command line). Generally, we need to configure the gateway’s
channels (frequencies). While device registration varies with LoRa network servers, one thing in common is that
that all of them provide interface to register devices of OTAA.
There are various plans and regulations for LoRaWAN frequencies in different regions. SenseCAP Sensor Nodes
comply with The Things Network Frequency Plans. To speed up the connection, we reduced SenseCAP Sensor Nodes’
channels in US902-908 and CN470-510.
Here we will use LPS8 LoRaWAN, which is fully adapted to LoRaWAN protocol. Please see its basic architecture below.
You can get more info about this gateway here:
https://www.seeedstudio.com/LPS8-Indoor-LoRaWAN-Gateway-Included-SX1308-LoRa-Concentrator-p-4251.html

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
8/ 38
4.1 Gateway Network Settings & Registration on TTN
4.1.1 LPS8 Gateway Network Settings
LPS8 Gateway supports various network options. For quick connection, we access the network via WAN port.
For other options, please refer to the following documentation:
https://www.seeedstudio.com/LPS8-Indoor-LoRaWAN-Gateway-Included-SX1308-LoRa-Concentrator-p-4251.html
1) Power on LPS8, connect it to the router with an Ethernet cable.
Your PC will search for networks, and you will see an open Wi-Fi: dragino-xxxxxxx
Connect your PC to this Wi-Fi, and your PC will get an address: 10.130.1.xxx, LPS8 will get a default address:
10.130.1.1
2) Enter the Web back end.
Access http://10.130.1.1/ on a browser of your PC, and you will be directed to the log-in page.
Username: root
Password: dragino

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
9/ 38
3)Check network status
If it’s successful in network access, you can see the network status by the following path:“Network”=> “WAN” =>
“Interfaces - WAN”.
Check network validity by this path: “Network”=>“Diagnostics”=>“Ping”.
If it shows info as in the image below, the network is working.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
10 / 38
4.1.2 Gateway Registration on TTN
TTN official website: https://www.thethingsnetwork.org
1) Follow the instruction to create your account, and access “Console”.
2) Get gateway id
Go back to the web back end, follow this path:“Service”=>“LoRawan Gateway”=>“Gateway ID”

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
11 / 38
Here my gateway ID is: a840411d16944150
3) Gateway Registration
Path: GATEWAYS - register gateway:
In Gateway EUI: a840411d16944150, check “I’m using the….” And it will be updated to hex code format.
In Description, give your gateway a name.
In Frequency Plan, choose frequency. Some of the most frequently used frequencies include “China 470-510MHz”,
“Europe 868MHz”, and “United States 915MHz” etc. Since the gateway we use here is 915MHz, we choose “United
States 915MHz”.
In Router, it will automatically choose “ttn-router-us-west”.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
13 / 38
4.2 Configure LPS8 and Connect to TTN
4.2.1 General Settings
First of all, make sure LPS8 is connected to the Internet。
IoT Service:LoRaWan/Raw forwarder
Service Provider: The Things Network
Server Address: ttn-router-us-west (the same as on TTN)
Frequency Plan: Customized Bands
For other items, please choose according to actual needs or choose default settings.
4.2.2 Frequency Settings
For specific parameters, please refer to Appendix at the end of this document.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
17 / 38
4.3 LoRaWAN Device Registration
1) Add Application
Click “Applications” on the upper-right corner of the page.
Choose “add application”.
In Application ID, give your Sensor Node an ID
In Description, give it a description
In Handler registration, it will be assigned based on the frequency. Since we use 915MHz Sensor Nodes here, it’s
been assigned to “ttn-handler-us-west”.
2) Obtain Device EUI, App EUI and App Key.
Please refer to Chapter Two to obtain Sensor Nodes’ Device EUI, App EUI and App Key.
For the Sensor Node we use here, Device EUI, App EUI and App Key are shown as in the image below.
3) Add App EUI
In the afore-created Application, enter “Setting”.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
18 / 38
Path: “Settings” => “EUIs” => “Add EUI”
Fill in the app_eui and click “Add EUI” to save.
4) Add Device
Follow this path: “Devices” – “add device”.
Device ID:
Device EUI: Fill in your “dev_eui”
App Key: fill in your “app_key”
App EUI: fill in your “app_eui”
Click “Add Device” to save.
5) Power on the Sensor Node.
Sensor Node’s power switch is inside the device, please turn clockwise to open the device.

【Technical Document】
© 2008-2019 Seeed Technology Co., Ltd. All rights reserved. www.seeed.cc
19 / 38
After opening the device, flip the power switch to “ON’, the LED on the lower-right corner will flash, indicating it’s
powered on. Please wait for about 10 seconds, and the LED will flash quickly for 2 seconds, indicating it’s connected
to the network.
Entering “Data”page, and you will see the network data (if the data doesn’t show up, please press the RESET
button on the sensor probe to reconnect to the network).
With successful access to the network, please connect the Sensor Probe back to the Sensor Node Controller by
turning it clockwise. Please note the labels on both sides should be aligned as the image below, or it will not be put
back in the right way. When the Sensor Probe is connected to the Sensor Node Controller correctly, the device can
upload data.
Other manuals for SENSECAP
2
Table of contents