Best practices in order to decode the payload

Hi everyone,

my concern is about the payload formatter option of the TTN. Is it better to use the one that provides the TTN or using a webhook or the MQTT Server to get the data and then decode the payload there?

Thanks in advance.

The TTN payload formatter works very well but is subject to a 100ms timeout - which may triggered due to server load rather than anything in your code. This is already happening and TTI are taking measures to limit this from occurring by reducing the size of the formatter that is allowed. If your decoding is intensive it will increase the chances of timeout.

So I use the payload formatter for initial development & debugging but all of the MQTT/WebHook end points for production don’t even look for the fields, they do the decoding themselves. It also means you aren’t waiting for a few more ms whilst the decoder runs (or not) on the TTN server.

I also store the hex from the payload is if it turns out that the decoding code (anywhere) has issue, I can rerun the decoder.

And for extra backup, I turn on Data Storage - whilst it doesn’t give you the meta data, it gives you the most important information, your payload, just in case something bad happens to your end point process or loss of connectivity at some point between TTN and your server.

1 Like

Hi @descartes

thank you very much for your response. I’ll take it into account.
Thanks again and have a nice day.