MQTT Downlink issue

application/3101de9f-6ad1-4bdc-babc-e339439ce135/device/e66230c79f0c7d2a/command/down

the downlink doesnt recieve by device, but on portal

recieves well,

what should be mistake?

I’m not 100% sure what you mean with this. By showing a screenshot of an empty queue, you mean it was sent by ChirpStack but not received by the device?

Thanks for rapid reach,

i want to downlink in 2 ways with MQTT,

Unicast ( single device)
and Multicast

need to make MQTT with C# application

here is my code sample but somethings wrong, can you assist me to fix it?

using MQTTnet;
using MQTTnet.Client;
using MQTTnet.Client.Options;
using System.Text;
using System.Threading.Tasks;

public class Program
{
    public static async Task Main(string[] args)
    {
        // MQTT client oluştur
        var factory = new MqttFactory();
        var mqttClient = factory.CreateMqttClient();

        // MQTT client ayarları
        var options = new MqttClientOptionsBuilder()
            .WithClientId("YourClientId")
            .WithTcpServer("YourMqttBrokerAddress", 1883) // Port numarası genellikle 1883'tür
            .WithCredentials("YourUsername", "YourPassword")
            .WithCleanSession()
            .Build();

        // MQTT client'ı bağla
        await mqttClient.ConnectAsync(options);

        // Downlink mesajını oluştur
        var downlinkMessage = new
        {
            confirmed = true, // Onaylanmış downlink mesajı mı?
            fPort = 1, // FPort değeri
            data = "SGVsbG8gd29ybGQ=" // Base64 formatında veri ("Hello world" örneği)
        };

        // Downlink mesajını JSON'a çevir
        var downlinkMessageJson = JsonConvert.SerializeObject(downlinkMessage);

        // Downlink mesajını MQTT mesajına çevir
        var message = new MqttApplicationMessageBuilder()
            .WithTopic("application/{APPLICATION_ID}/device/{DEV_EUI}/command/down") // Uygulama ID'si ve cihaz EUI'si ile konuyu değiştirin
            .WithPayload(downlinkMessageJson)
            .WithExactlyOnceQoS()
            .WithRetainFlag()
            .Build();

        // Downlink mesajını gönder
        await mqttClient.PublishAsync(message);
    }
}```

Thanks

That’s totally true, i send from also hex data, its totally works fine but with mqtt application, it not got recieve from device, maybe i am missing some querry or url?

i didnt use deveui at payload json, problem may acquire becaause of that?

I believe I am having the same issue. Downlink data is sent just fine if done via the chirpstack web ui (hex,base64,and json) but if published as an MQTT message it is never sent to the end device nor does it ever show in the queue in the web ui.

My chirpstack.toml has the topic for downlink set as " command_topic=“application/{{application_id}}/device/{{dev_eui}}/command/{{command}}” ". However even changing {{command}} to “down” to make sure I know its listening on the right topic does nothing.

The posted message:
{ “devEui”: “2232330000888802”, “confirmed”: false, “fport”: 1, “data”: “016601”}

I believe that the data must be encoded in base64, not a sequence of hexadecimal digits that represent the bytes.

1 Like