Ttnmapper integration decoder format

Hello all,
which is the correct decoder payload format to use ttnmapper integration?
I actually use
decoded.latitude=Math.round(lat * 1000000) / 1000000;
decoded.longitude=Math.round(lng * 1000000) / 1000000;
decoded.altitude=alt;
decoded.hdop=hdop;
but seem don’t work.
The documentation say that it must be on json, i tried
decoded.ttnmapper = { “latitude” : lat ,
“longitude” : lng,
“alttitude” : alt,
“hdop” : hdop };
with the correct data in the variable but seem don’t work also.
Please could someone post the correct decoder?
Thanks.

Alberto

1 Like

There is no such thing as a “correct decoder”, it all depends on how your device encodes the data before sending…

I have my decoder at the end of this page, but it only works with the way I encode the data

Thanks Amedee,
I know how reconstruct the data, my demandr was on how put them in the decoded object.
And your reply is the fist format:
decoded.latitude=Math.round(lat * 1000000) / 1000000;
decoded.longitude=Math.round(lng * 1000000) / 1000000;
decoded.altitude=alt;
decoded.hdop=hdop;