ttn in practice - wirelesswireless.ictp.it/school_2019/slides/ttn_in_practice.pdflogin to...
TRANSCRIPT
TTN IN PRACTICE
TTN: APP AND GATEWAY
TTN: GATEWAY
TTN: GATEWAY
TTN: GATEWAY
SINGLE CHANNEL GATEWAY70 euro
RPi+board
No enclosure
Single Channel
8 CHANNELS GTW
500-1500 euro
Enclosure
8 Channels
8 CHANNELS GTW
200-300 euro
No enclosure
8 Channels
GATEWAY SETUP
Example: https://github.com/ttn-zh/ic880a-gateway/wiki
GATEWAY SETUPLogin to thethingsnetwork.org Console
Click on Gateways -> register gateway
Enable checkbox I'm using the legacy packet forwarder
Enter your Gateway EUI (if is printed on start and end of the installer)
Enter any description
Select Europe 868Mhz as frequency plan
Select the correct antenna placement according to your plans
Confirm clicking Register gateway
IS IT WORKING?Connected!
IS IT WORKING?
It may take 24 hours for the gateway to be shown on
TTNMapper and only if you generate traffic
DO I NEED A GATEWAY?
You don’t need to install a Gateway to use TTN if there
are other Gateways available!
TTN: APP
TTN: APPApplication ID
Description
Handler
TTN: APP
TTN: APP
TTN: COLLABORATORS
TTN: DEVICESName of Device
Device EUI
TTN: DEVICE EUI FOR PYCOM
TTN: DEVICES
TTN: DEVICESAuthentication
Never seen!
TTN: AUTHENTICATION
Credit: https://www.newieventures.com.au/blogtext/2018/2/26/lorawan-otaa-or-abp
TTN: AUTHENTICATION
https://www.newieventures.com.au/blogtext/2018/2/26/lorawan-otaa-or-abp
TTN: DEVICES Settings
TTN: DEVICES
ABP
TTN: DEVICES
TTN: DEVICES DeviceAdd, NetKey, AppKey
TTN: DEVICES
Copy and Paste in the TTN example I provided
TTN: PAYLOAD Payload format
TTN: PAYLOAD
TTN: PAYLOADfunction Decoder(bytes, port) {
var decoded = {};
decoded.latitude = ((bytes[2]<<16)>>>0) + ((bytes[3]<<8)>>>0) + bytes[4];
decoded.latitude = (decoded.latitude / 10000.0);
decoded.longitude = ((bytes[5]<<16)>>>0) + ((bytes[6]<<8)>>>0) + bytes[7];
decoded.longitude = (decoded.longitude / 10000.0);
decoded.altitude = ((bytes[8]<<16)>>>0) + ((bytes[9]<<8)>>>0) + bytes[10];
decoded.altitude = (decoded.altitude / 100.0);
decoded.hdop = ((bytes[11]<<16)>>>0) + ((bytes[12]<<8)>>>0) + bytes[13];
// decoded.hdop = (decoded.hdop / 10000.0);
return decoded;
}
TTN: PAYLOAD
TTN: INTEGRATIONSIntegrations
TTN: INTEGRATIONS
TTN: INTEGRATIONS
TTN: INTEGRATIONS
EXERCISE
1) Create an Application (your own!)
2) Register one device
3) Send some data
4) Try the Ubidots integration!