Downlink publishing problem in python

Hello!

I have been trying to the Pahos Python client to send a downlink message to a device I have built. I have successfully done this through the Chirpstack enqueue interface as well as the node-red application. However, I have found that all the examples I have found to do this in python do not work for me and actually have competing syntax:

They almost always use Port:1883 The node-red application uses 8080.

Node-red uses an API key and none of the examples show how to use this information.

They all vary with using quotation marks, topic structure ( /command/down vs /Device ID/down), if the message has to be json encoded, etc.

I have read all the mosquito documentation,2 books on the pathos client and mosquito, Chirpstack, TTN, Semtech chats, and somehow I have missed how to do this seemly easy thing to do. The documentation there but no real examples…particularly on API Key from what I found.

I can successfully subscribe to all the device events and I can see that the node-red message gets sent successfully, but I can not see the actual message it is sending which I understand is not python.

Does anyone have a small python stub on how to do this that they can point me to?

Thank you in advance

Not sure what you have found and read.

5 minutes of searching “mqtt ttn python” and reading lead to these links.
Many forum posts on this topic lead to these links.

https://www.thethingsindustries.com/docs/integrations/mqtt/

I saw this same post on Chirpstack forum. Are you wanting to use Chirpstack or TTN?

Thank you for your quick reply…!

Actually, after the billion links I looked through several times… No … I didn’t see these at all. Obviously, I missed a key word or two in the search…
Thank you so much. I will investigate and hopefully solve this…

-Bmaclaren