Lorawan node to rak7249

Hi. I need to know data message format to use to send data from nodes based arduino to gateway rak7249. i want to use ABP method . which parameters i need to add to my json message. thanks

Welcome to the forum @walidber

  1. data message format
    That is completely up to you, you can invent your own payload format or you can use for example the Cayenne LPP payload format using the CayenneLPP library.
    If you invent your own payload format, you have to write a payload parser for the LoRaWAN network server that you will use.
    If you use Cayenne LPP format, most LoRaWAN network servers provide already payload parsers for Cayenne LPP format.

  2. ABP method
    ABP method requires you to create a device address, application session key and network session key and you need to setup your device with these credentials and create the device with the same credentials in the LoRaWAN network server you will use.

If you are using TTN, AWS-IoT or Loriot LoRaWAN network server of the RAK7249, you can have a look into our documentation for the RAK7249

But i need to know if i want to use json format where can i write a payload parser in the built-in LNS and which format i must use for json like { “devaddr”: "… ", “NwkSKey”:…, …}
I want to use built-in mqtt broker to access data
the documentation is not enough to do this.

I am not a gateway expert, but does this help:

The Mighty MQTT! What You Should Know About It
Use the MQTT Broker Like a Pro + Examples

For the payload parser, the internal network server of the Edge gateways is not the best for payload parsing. If I remember correct, it does not have an option for a custom payload parser, only Cayenne LPP

Hello Walid,

The node sends data as a byte array not in JSON format, example for temperature and humidity:

0b 67 01 5c 0c 68 c4

The example is decoded in Cayenne LPP format, you can check the Cayenne LPP format documentation => Cayenne Docs

0b = ID

67 = data type temperature

01 5c = the temperature multiplied by 10 ==> 34.8 degree

0c = ID

68 = data type humidity

c4 = the humidity multiplied by 20 ==> 98 %RH

In the LoRaWAN server, this arrives as Base64 encoded data


This data is then forwarded by the MQTT broker as explained here: Use the MQTT Broker Like a Pro + Examples

	"timestamp": 1618827808,
	"	"rxInfo":[{"gatewayID":"YMWo//52YjI=","time":null,"timeSinceGPSEpoch":null,"rssi":-58,"loRaSNR":12.5,"channel":5,"rfChain":1,"board":0,"antenna":0,"location":{"latitude":14.4217,"longitude":121.00713,"altitude":80,"source":"UNKNOWN","accuracy":0},"fineTimestampType":"NONE","context":"BSiBbA==","uplinkID":"WBrrXuNJRjGOfoFAw5G1dQ==","crcStatus":"CRC_OK"}],"txInfo":{"frequency":917600000,"modulation":"LORA","loRaModulationInfo":{"bandwidth":125,"spreadingFactor":9,"codeRate":"4/5","polarizationInversion":false}},"adr":false,"dr":3,"fCnt":11685,"fPort":1,"data":"C2cBXAxoxA0CuYwOZgEBdAGb","objectJSON":"{\\"analog_in_13\\":-180.36,\\"humidity_12\\":98,\\"presence_14\\":1,\\"temperature_11\\":34.8,\\"voltage_1\\":4.11}","tags":{},"confirmedUplink":false,"devAddr":"AAQlCQ==","publishedAt":"2022-07-27T03:57:22.703052904Z","deviceProfileID":"c8cc54a1-3cbc-423e-862e-354b71c5e214","deviceProfileName":"Cayenne-Decoder-Extended"}'
	"applicationID": "1",		// The ID of the application in which the node is registered
	"applicationName": "MHC-Las-Pinas",		// The name of the application
	"devEUI": "60c5a8fffeXXXXXX",		// The EUI of your device
	"deviceName": "MHC-Soil-Moisture-Sensor",		// The name of your device
	"timestamp": 1618827808,		// Unix timestamp of received node data
	"fCnt": 30,		// The frame counter of the message
	"fPort": 8,		// The port to which the data is send
	"data": "C2cBXAxoxA==",		// The data sent by the node
	   "data_encode": "base64",		// Decoding data type
 	   "adr": true,		// Whether the node has adaptive data rate enabled
 	   "rxInfo": [	// Information about the gateway, that received the node data
  	          "gatewayID": "f6e529fffeXXXXXX",		// Gateway’s EUI
   	         "loRaSNR": 9.8,		//Signal-to-noise ration of the message
   	         "rssi": -41,		// Received Signal Strength Indicator of the message
    	        "location": {		// GPS information of the gateway
          		      "latitude": 42.88595,
          		      "longitude": 25.31158,
          		      "altitude": 437
         	   "time": "2021-04-19T10:23:28.126943Z"
	    "txInfo": {
 	       "frequency": 867900000,		// The frequency used by the node to send data
  	      "dr": 5		// Node’s data rate

Then you connect to the MQTT server, subscribe to the arriving data.

You will receive the above data and parse it as shown in the example Python code => as explained here Use the MQTT Broker Like a Pro + Examples | RAKwireless Documentation Center

Thank you
I have solved the problem but I found another problem is that the platform offers only one topic for the Mqtt protocol and to receive data from all nodes you have to use the topic: application/id/device/+/rx
but i don’t receive msg in this case
i receive only if i use eui of one node application/id/device/eui/rx

That is a question for the gateway section, I cannot help with that. Better to search for it in the RAK7249 section. There might be already answers for it.