Search code examples
python-3.xmqtt

Send an array of data to MQTT broker


I have an array of data like this:

plist = [
        ["name1", "address1"],
        ["name2", ["address2"],
        ["name3", "address3"]
        ....
        ]

and I need to send it to an MQTT broker. AFAIK, MQTT only supports Buffer or String. How can I convert my array into an MQTT-compatible type, keeping the structure intact?


Solution

  • Pick a none language specific encoding, e.g. JSON or ProtoBuf