Publish With Python To Azure Iot Hub - Subscribe With C# Not Working
I publish with M2MQTT Paho Python library on the device as follows: msg = 'POS {} {} {} {} {} {} {}' msgtosend=msg.format(tagNum, tagID, x_pos, y_pos, z_pos, qos, unk)
Solution 1:
try the following fix:
tpc = new string[] {
"devices/MasterTag/messages/devicebound/#",
"$iothub/twin/PATCH/properties/desired/#",
"$iothub/methods/POST/#",
"$iothub/twin/res/#"
};
qosArray = new byte[] {
MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE,
MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE,
MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE,
MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE
};
var subCode = mqttClient.Subscribe(tpc, qosArray);
Post a Comment for "Publish With Python To Azure Iot Hub - Subscribe With C# Not Working"