How send Downlink through MQTT

Issue: How can I send Downlink to end device trough MQTT?

Setup: Gateway RAK 7258 - End Device SAMR34 Xplained

LoRa® Server: MQTT

Details:

Hello everybody !! I’m a beginner with LoRa and MQTT, and I’m not able to send a downlink to end device through my RAK7258 gateway. I configured end device and gateway and it connects and I could send uplinks normally, all packages arrive ok. But I’m trying to send a downlink and I don’t know how can I do this, what I need to configure in the gateway or in MQTT server. Someone can help me with what I need to do, where I can start to solve this? From now I’m thankful for any help.

What LoRaWAN server are you using?

Hi @nmcc, I’m using MQTT, with my private gateway.

MQTT is not a LoRaWan server but rather a communication scheme which could be used at at least two entirely distinct points in a system.

Where did you enter the details of your node? If you entered it into a web page on the gateway itself, you are probably using the built-in copy of LoRaServer which is an older version of what is now called Chirpstack. You can inject a downlink request to that via the same MQTT broker where you subscribe to the decoded data, you’d have to find and follow the relevant instructions.

If you have the gateway pointed at some other LoRaWan server (perhaps using the gateway MQTT bridge) then you’d have to follow the instructions appropriate to that server.

1 Like

@cstratton yes! I have used the RAK 7258 to create a Built-In LoraWAN Server (Private) in LoraWAN packet forwarder and in the Global Interaction option, I put the MQTT parameters. I can join to it and send uplinks from the device. But I want to send downlinks to the device and this step is not working. I’m trying to send directly from Gateway the downlink, and not works.

How exactly are you trying to send it?

Do you understand that a downlink can only be transmitted in response to an uplink from the node?

Yes @cstratton , I’ll show what I’m trying. I put some HEX values and I sent the values. When I click on the “send button”, Before I send uplink, the platform shows a success message and the Downlink never arrives on the device. I need only the message to arrive on the device as I made it in TTN doing the same thing.

Unless you’ve (probably erroneously) registered your node as class C rather than class A, it should not actually transmit the downlink until it receives an uplink.

Open the gateway traffic page in another window at the same time and see what actually happens in terms of uplink and downlink raw packets.

1 Like

Okay @cstratton , I tryied what you sayied.

My device is configurated as class A

I have send a downlink and stay waching the system register and I don’t know if is it right. The terminal shows these messages:

Tue Mar 16 11:10:49 2021 daemon.info appSrv[19484]: [Downlink] - {“applicationID”:“8”,“applicationName”:“NaoUnificado”,“devEUI”:“deaffacedeafface”,“deviceName”:“dev-deaffacedeafface”,“timestamp”:1615834554,“fCnt”:57,“fPort”:1,“data”:“MjguOUMvODQuMEY=”,“data_encode”:“base64”,“adr”:false,“rxInfo”:[{“gatewayID”:“ac1f09fffe014810”,“loRaSNR”:12.0,“rssi”:7,“location”:{“latitude”:-22.000000,“longitude”:-47.000000,“altitude”:588}}],“txInfo”:{“frequency”:916000000,“dr”:3}}

Tue Mar 16 11:10:49 2021 daemon.err nwkSrv[19484]: Device downlink Queue is FULL, drop dl message

Now I can saw the live device data and it stay sending a lot of downlink, but no one arrive to the device.

It would be good to check the gateway rather than application level view.

The pacing of those is quite rapid - your node would have to be transmitting uplinks all but continusously to trigger those.

If the downlinks are being transmitted but not received, this is almost always due to a bug in the node firmware, causing it to listen at the wrong time or frequency or settings.

Which LoRaWan region are you using? Are you sure that is correctly set on all of the device, gateway, and LoRaServer?

Hello @cstratton, I believe the configurations are correct. For end device I used the Atmel end device example, and I only changed the keys parameter to make the connection as I show bellow in figure

The Gateway is with the following configuration

and the device in gateway have the following configuration:

I don’t have problem to share the join Keys because this system is only a test. You think I’m configurating it’s wrong @cstratton ? The region I define AU915 during the simulation

Are you using OTAA or ABP? Is your device actually joined?

I still recommend you look at the raw gateway level traffic which will show both uplinks and downlinks in one log

1 Like

@cstratton I have 2 devices SAMR34, one I configurated as OTAA and the other I configurated as ABP

Hello @cstratton, I bring good news! I managed to send the downlink to the device through downlink simulation in the RAK7258, I had to change some parameters in the menu “integration”. The principal change was the message format of Base 64 to HEX format. Now I can send downlinks normally.

My objective now is send the downlink through MQTT, do you know what I need to configure to do this?