# TTN Mapper payload decode problem

**URL:** <https://www.thethingsnetwork.org/forum/t/ttn-mapper-payload-decode-problem/59485>\
**Category:** End Devices (Nodes)\
**Created:** [October 19, 2022, 11:05pm UTC](https://www.thethingsnetwork.org/forum/t/ttn-mapper-payload-decode-problem/59485 "2022-10-19T23:05:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![littleplumbbob](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/littleplumbbob/32/35697_2.png) [@littleplumbbob](https://www.thethingsnetwork.org/forum/u/littleplumbbob)\
**Post date:** [October 19, 2022, 11:06pm UTC](https://www.thethingsnetwork.org/forum/t/ttn-mapper-payload-decode-problem/59485/1 "2022-10-19T23:06:00Z")

</div>

I have a Tbeam running [GitHub - kizniche/ttgo-tbeam-ttn-tracker: TTGO T-Beam Tracker for TTN Mapper and TTN Tracker using US (915 MHz) and EU (868 MHz) frequencies](https://github.com/kizniche/ttgo-tbeam-ttn-tracker)  
It seems to be working and I get a payload showing up in my Live data but I can not get the payload decoded by the script. I am unsure what is wrong.

Example Payload D674D00CF6DF0010090B

Script  
function Decoder(bytes, port) {  
var decoded = {};

```
decoded.latitude = ((bytes[0]<<16)>>>0) + ((bytes[1]<<8)>>>0) + bytes[2];
decoded.latitude = (decoded.latitude / 16777215.0 * 180) - 90;

decoded.longitude = ((bytes[3]<<16)>>>0) + ((bytes[4]<<8)>>>0) + bytes[5];
decoded.longitude = (decoded.longitude / 16777215.0 * 360) - 180;

var altValue = ((bytes[6]<<8)>>>0) + bytes[7];
var sign = bytes[6] & (1 << 7);
if(sign) decoded.altitude = 0xFFFF0000 | altValue;
else decoded.altitude = altValue;

decoded.hdop = bytes[8] / 10.0;
decoded.sats = bytes[9];

return decoded;

```

}

---

<div class="post-metadata">

**Author:** ![drsash](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/drsash/32/48299_2.png) [@drsash](https://www.thethingsnetwork.org/forum/u/drsash)\
**Post date:** [August 9, 2026, 9:37am UTC](https://www.thethingsnetwork.org/forum/t/ttn-mapper-payload-decode-problem/59485/2 "2026-08-09T09:37:39Z")

</div>

maybe try this one, its working:

[https://raw.githubusercontent.com/g6094199/TTN-mapper/refs/heads/main/decoder.js](https://raw.githubusercontent.com/g6094199/TTN-mapper/refs/heads/main/decoder.js)
