www.zane.hu
7
TTN device
Label at Configuration Tool
TTN
Device EUI
Set Device EUI
8 bytes
written on the label of zTrack
Tube
Application EUI
8 bytes
Generated by TTN
Device Address
Set DevAddr
Assigned by network server
Network Session Key
Set NwkSKey
16 bytes
Network session key will be
generated
App Session Key
Set AppSKey
16 bytes
App session key will be
generated
After device registration, go back to Configuration Tool
→
“LoraWAN preferences” and fill the form
with the hex strings of yours TTN registration.
After this step, you can receive data from your device.
Payload decoding with TTN
For zTrack One you can use this decoder on TTN. Use custom payload.
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
if (port == 204){
lat = bytes[0] << 16;
lat |= bytes[1] << 8;
lat |= bytes[2];
lat = lat/8388606 * 90;
if (lat > 90) lat -= 180;
decoded.lat = lat;
lon = bytes[3] << 16;
lon |= bytes[4] << 8;
lon |= bytes[5];
lon = lon/8388606 * 180;
if (lat > 180) lon -= 360;
decoded.lon = lon;
alt = bytes[6] << 8;
alt |= bytes[7];
decoded.alt = alt;
Summary of Contents for zTrack One
Page 16: ...www zane hu 16...