How to send data TO a Wisblock RAK4630/RAK4631 from the RAK2245 Concentrator Gateway

Hello, I have purchased a RAK2245 and several Wisblock modules. I have successfully uploaded the test LoRaWAN_OTAA_ABP sketch and successfully receive data from the Wisblock to the concentrator RAK2245. I can successfully subscribe to the MQTT topic and watch the data incoming from the Wisblock.

My question is: how to send data BACK to the Wisblock?

According to this Chirpstack article, I simply need to publish the data to the topic as shown. Since I have 3.10.0 Chirpstack Network Server, I should be able to publish to "application/[application id]/device/[device EUI]/tx and the data should then be queued to be sent to the Wisblock.
I have also tried the new 3.11.0 topic format: “application/[application id]/device/[device EUI]/command/down”

I send the data in JSON format as shown in the Chirpstack article:

{
    "confirmed": true,                        // whether the payload must be sent as confirmed data down or not
    "fPort": 10,                              // FPort to use (must be > 0)
    "data": "...."                            // base64 encoded data (plaintext, will be encrypted by ChirpStack Network Server)
    "object": {                               // decoded object (when application coded has been configured)
        "temperatureSensor": {"1": 25},       // when providing the 'object', you can omit 'data'
        "humiditySensor": {"1": 32}
    }
}

However, I omitted the “object” section and just wrote string data in the “data” element.

My MQTT topic was this: application/2/device/8888888888883333/tx
I also tried MQTT topic: application/2/device/8888888888883333/command/down
And I also tried omitting the slash between “application” and the application ID (although I think this is a typo in the Chirpstack article): application2/device/8888888888883333/tx

My exact JSON string was this: {"confirmed":true, "fPort":1, "data":"Hello world"}

On the demo sketch uploaded to the Wisblock, the following function should handle RX events:

void lorawan_rx_handler(lmh_app_data_t *app_data)
{
  Serial.printf("LoRa Packet received on port %d, size:%d, rssi:%d, snr:%d, data:%s\n",
          app_data->port, app_data->buffsize, app_data->rssi, app_data->snr, app_data->buffer);
}

However, on the Serial Monitor I only see messages that data is being sent “lmh_send ok count xxxx”, but never a message that data is received.

Note also, in the Chirpstack GUI → Gateways → RAK2245 → LIVE LORAWAN FRAMES, there are no frames in the list that indicate the RAK2245 is sending this data to the Wisblock. Note that I do see incoming frames from the Wisblock (“ConfirmedDataUp” and “UnconfirmedDataDown”) which correspond to the Wisblock sending data to the RAK2245 concentrator.

Please help me understand what I’m doing wrong, and how to send data to the Wisblock RAK4630/RAK4631 devices via MQTT and the RAK2245.

Thank you.

I have confirmed the Application ID and Device EUI from the data being sent from the Wisblock.

A first simple test you can do is to setup a downlink manually in Chirpstack and check if your node receives the message.
In Chirpstack go to your Application, open your device and then look into Details. Scroll down to see Enqueue downlink payload and setup a downlink manually:


Keep in mind that a Class A node will only receive a downlink after it has sent an uplink packet.
After your node has sent an uplink you should see the downlink packet in your log file, similar to this (different app, different log):
image

For your other question, that is for the [RAK2245]{RAK2245 / RAK2243 - RAKwireless Forum) section, as the WisBlock is just sending/receiving. I never used MQTT for downlinks.

Hi @thegpx ,

I worked with @beegee regarding your MQTT problem.

We were able to send downlink via MQTT integration.

You can test it using mosquitto by using this command as template

mosquitto_pub -h 192.168.1.12 -t "application/1/device/1dfb41d379772c52/command/down" -m '{"confirmed":true,"fPort":2,"data":"1234"}' -d

You need to change the 192.168.1.12 to your own IP address as well as the application ID and device EUI.

The data payload should be Base64 encoded as well.

Thank you both @beegee and @carlrowan for your replies.
I have been able to successfully send data now.

Note that I must use the topic application/2/device/8888888888883333/tx instead of /command/down in order to send, but it is successfully working.
I was able to debug and discovered that my JSON object contained something invalid. If using the format {"data":"TXlUZXN0V29ya3Mh", "fport":2, "confirmed":true} it works.

Thanks!

It seems you have a lower version of Chirpstack then - below v3.11.0.

Still, it is great that it is working now :+1: