mqttclient small fix
This commit is contained in:
parent
b5502f9edb
commit
2ff80fa360
@ -69,6 +69,8 @@ int mqtt_connect(const char *my_host, const uint16_t my_port) {
|
||||
ESP_LOGW(TAG, "MQTT server not responding, retrying later");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NetworkEvent(WiFiEvent_t event) {
|
||||
@ -122,7 +124,7 @@ void mqtt_client_task(void *param) {
|
||||
if (mqttClient.connected()) {
|
||||
|
||||
char buffer[PAYLOAD_BUFFER_SIZE + 3];
|
||||
snprintf(buffer, msg.MessageSize + 3, "%s/%s", msg.MessagePort,
|
||||
snprintf(buffer, msg.MessageSize + 3, "%s/%u", msg.MessagePort,
|
||||
msg.Message);
|
||||
|
||||
if (mqttClient.publish(MQTT_OUTTOPIC, buffer)) {
|
||||
|
Loading…
Reference in New Issue
Block a user