Downlink data format?

Hello,

I am trying to send a downlink message to a device in order to change it’s configuration. The vendor has supplied a spreadsheet to calculate the correct message to send.

I have successfully used the /api/devices/{device_queue_item.dev_eui}/queue API to POST the message and received HTTP 200 OK.

I can confirm I see it on the queue by calling the queue itself using /api/devices/{dev_eui}/queue

At this point I triggered an uplink message on my device and the queue cleared. I saw an ack from the device also.

I believe I have the process correct, however the device is not working the way it should so I’m starting to think I sent bad data to it.

The contents of the body was as follows

{
“deviceQueueItem”: {
“confirmed”: true,
“data”: “420000040500780000000405023C00000004050378000000040505803A09000405078051010001400501”,
“devEUI”: “244e7b0002000442”,
“fCnt”: 1,
“fPort”: 3
}
}

The data string “420000040500780000000405023C00000004050378000000040505803A09000405078051010001400501” was generated by the vendors spreadsheet. Do I need to encode this somehow before adding it to the DeviceQueueService?

Thanks.

The data field should be base64-encoded (https://www.chirpstack.io/application-server/integrate/sending-receiving/mqtt/), so maybe you want:

$ echo -n 420000040500780000000405023C00000004050378000000040505803A09000405078051010001400501|base64
NDIwMDAwMDQwNTAwNzgwMDAwMDAwNDA1MDIzQzAwMDAwMDA0MDUwMzc4MDAwMDAwMDQwNTA1ODAzQTA5MDAwNDA1MDc4MDUxMDEwMDAxNDAwNTAx

?

That being said, that’s a fairly large payload and seems possibly/probably incorrect.

Probably supposed to be a binary payload, not ASCII.

here’s at online tool for converting Hex to Byte64 (and reverse) https://base64.guru/converter/encode/hex