Payload receive with Node-Red

Hi everybody.

I’m new here and try to receive data from my Lora node with NODE-RED

Here is the example code:

grafik

i receive the payload 00 01 02 03:
grafik

but in Node-Red the Payload is

payload: “YFxNASalBgADQf8AAadxAm8=”

grafik

How can I convert this into my data 00 01 02 03 ?

Kind Regards

The payload you’re seeing is the full LoRaWAN packet for a downlink. This has been published by TTN on the MQTT <AppID>/devices/<DevID>/events/down/sent topic. So, it’s not the uplink you’re looking for.

Also, it seems you’re using the deprecated TTN Node-RED library. Don’t use that for new developments, see Why is Node-RED integration no longer supported?

Aside: please don’t post code as images. See also How do I format my forum post? [HowTo]

Arjan, thanks fore quick response. :+1:

I’ll try to use mqtt…

Arjan,

I have try it, the mqtt-in node work’s well.

I’m sendind a raw payload 00 01 02 03 …

grafik

and receive “payload_raw”:“AAECAw==”

grafik

How can I decode it. I dont’ undestand the decoding sequence.

End of the day, I would like to see the e.g. temperature data in the dash board (mqtt dash)

Thanks a lot

I think you need to separate the process in order to help debugging, look at your encode (on the device) and decode function (console payload formats) - there is lots of support on forum already, once you see your decoded data is visible in the console app then move onto Node Red.

Then take a look at the recent Node Red support posts on the forum, in particular the one from @arjanvanb and the great example posted, you can import the entire node setup and have running in seconds.

you mean in my ttn application:
grafik

where/how can I learn very effective how to write the code, can you recommend me something? This is JavaScript or JSON ?

There are loads of examples on this forum honest, below is a thread to start with - once you have the console app data showing your decoded data then you know you can move on to Node Red via MQTT,

Remember the key goal here is to take raw data values (from sensors? maybe temp -2.68c) perhaps signed, decimal, or even simple true/false conditions and convert to values that can be sent via the uplink. These need to be sent efficiently as hex bytes (smallest number possible), this is the encoding process done on the device - likewise the app in the console is where you can do your decoding back to real world values.