Problem with publishing downlink to MQTT Broker using Python

Hi guys,

I’m trying to schedule a downlink by publishing to mqtt using python. Here is my implementation in Python

but ChirpStack keep throwing the error " Handling downlink command error dev_eui=6998f55bfbb18223 error=Exception generated by quickjs: []:1 unexpected token: ‘object’". Here is my implementation of the encoder, for now I only want to send a basic “Hello World” back to my Arduino

Does anyone have a clue, how can I resolve this problem? I very appreciate your help. Thank you!

try sending like this… (sorry this is from curl but i’m sure you’re smart enough to see the json in the payload)

mosquitto_pub -d -h -p 1883 -u <USERNAME> -P <PASSWORD> -t 'application/<TENANT_ID>/device/<DEVICE_EUI>/command/down' -m '{"devEui": "<DEVICE_EUI (must match mqtt topic)>", "confirmed": true, "fPort": 129, "data": "AgAHAAgBAwADAAF0Cg=="}'

the encodedDownlink(input) will return data as an object to to extract this use something like

let data =;

hope this makes sense.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.