Closed MrSiO closed 3 years ago
I think you accidentally removed the client.publish()
call within the if statement?
Hi. This is a trunkated version.
For now It's only listening on topic and reacts to incoming topic/payload. Only publishes state later on in the code. All working fine before I introduce RTC (I2C).
Problem seems to be related to I2C and maybe interrupts...
Looks like the I2C interfere with the MQTT incoming message interrupt... Is this possible?
Closing as outdated. Please reopen if problem persists.
Hi, I'm using the MQTT.h library with success in one of my project using Adruino UNO w/Ethershield based on your ArduinoEthernetShield.ino exemple.
I wanted to add to the loop a timestamp based on RTC clock every second. (DS3231 - Tested and working) Once the RTC commands is added to the "if (millis() - lastMillis > 1000)" time gets displayed every seconds, but the reception of MQTT messages stops working. As if the "void messageReceived(String &topic, String &payload)" is not triggered anymore by incoming messages.
I can confirm the arduino is connected to broker and subscribe to topic. Thx for any helpfull infos.
Here is my code sample: