I’m new to LoraWan and TTN and now I am building a Lora network with some sensor nodes and LoraWan gateway.
Now I manage to connect my node to the gateway and through TTN, data can be received by my Node-Red. However, the data cannot be decoded properly.
I have studied several websites and finally come to the current situation:
I can decode my manually-built Base64 test data. However, for the actual data, I always receive the error in Node-red: “SyntaxError: Unexpected token o in JSON at position 1”. I know it is due to the fact that the message/data is not in JSON. However, it still cannot find out how to change to JSON format so that I can decode my text. My text inside the payload is “hello”.
Attached is my node-red flow and data packet. Could anyone can provide a solution?
This is frowned on in LORaWAN, it is very heavy on air time and thus you battery to send TEXT. Remember the FUP you need to comply to. 30sec per day total uplink time.
Do you mean my TTN MQTT setting? Please find attached.
Then my node-red flow just read the data from the MQTT server accordingly. You can check my node-red flow.
Thanks!!
Yes, the data payload are received and are encoded using Base64. I can copy & paste into my injection node and decoded successfully. However, I cannot decode from my MQTT node-red node directly.
Hi Johan,
If you are asking my node-red MQTT setting, you can download my flow and find out.
Is that what you need to do analysis? If not, please clarify. Thank you!!