From e784241e33d2a408e672e980e14f976d5233f7fb Mon Sep 17 00:00:00 2001 From: AlbertWeterings <36169962+AlbertWeterings@users.noreply.github.com> Date: Tue, 20 Feb 2018 19:12:31 +0100 Subject: [PATCH] Update uart_mqtt Sending data both ways now works --- code/espurna/uart_mqtt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/espurna/uart_mqtt b/code/espurna/uart_mqtt index 94ed9f88..fa7c84a3 100644 --- a/code/espurna/uart_mqtt +++ b/code/espurna/uart_mqtt @@ -35,9 +35,7 @@ void _recvWithEndMarker() { void _sendNewData() { if (newData == true && MQTT_SUPPORT) { - #if MQTT_SUPPORT mqttSend(MQTT_TOPIC_UARTIN, receivedChars); // publish: UART -> mqtt bus - #endif newData = false; } } @@ -46,20 +44,17 @@ void _sendNewData() { void _UARTtoMQTTMqttCallback(unsigned int type, const char * topic, const char * payload) { if (type == MQTT_CONNECT_EVENT) { mqttSubscribe(MQTT_TOPIC_UARTOUT); - DEBUG_MSG_P(PSTR("[UARTtoMQTT] MQTT Subscribe topic:\n"), MQTT_TOPIC_UARTOUT); } if (type == MQTT_MESSAGE_EVENT) { // Match topic String t = mqttTopicKey((char *) topic); - //DEBUG_MSG_P(PSTR("[UARTtoMQTT] t= :\n"), t); - bool isUARTOut = t.equals(MQTT_TOPIC_UARTOUT); if (isUARTOut) { - //send the received MQTT message to Serial - + Serial.print(payload); + Serial.println(); } }