diff --git a/src/mqttclient.cpp b/src/mqttclient.cpp index 25d7ee04..511f02b5 100644 --- a/src/mqttclient.cpp +++ b/src/mqttclient.cpp @@ -124,7 +124,7 @@ void mqtt_client_task(void *param) { if (mqttClient.connected()) { char buffer[PAYLOAD_BUFFER_SIZE + 3]; - snprintf(buffer, msg.MessageSize + 3, "%s/%u", msg.MessagePort, + snprintf(buffer, msg.MessageSize + 3, "%u/%s", msg.MessagePort, msg.Message); if (mqttClient.publish(MQTT_OUTTOPIC, buffer)) { @@ -174,7 +174,7 @@ void mqtt_enqueuedata(MessageBuffer_t *message) { void mqtt_callback(MQTTClient *client, char topic[], char payload[], int length) { - if (topic == MQTT_INTOPIC) + if (strcmp(topic, MQTT_INTOPIC) == 0) rcommand((const uint8_t *)payload, (const uint8_t)length); }