Hi, my name is Josep Mencion and I’m doing a research school project on home automation.
I have an Arduino MEGA 2560 with an Ethernet Shield which connects to the Raspberry Pi 1883 MQTT broker and publishes sensors data and subscribes to some topics to actuate.
I send temperature, humidity and luminosity data to the broker.
All seems to work, but the Arduino MEGA doesn’t send the data for more than 2 days. I explain: without any explanation, the Arduino disconnects from the broker and stops sending the data.
I attach the code on the next message because if not, I cannot create such a large message here.
.- I have attempted changing my Arduino MEGA board and my Ethernet Shield and the behaviour is the same.
.- The Arduino MEGA is an original board.
Probably there's a code error I can't find (for example, on the DHT.22 read?
I would be very happy if someone could find me the mistake.
I have thought that also could be an electrical problem on the power supply, even thought that I have changed my USB supply and the behaviour is the same. But it comes to my mind that I currently have my Arduino MEGA connected to the USB 5V to the computer and it also has de circular connector and I could connect the Arduino MEGA to the two supplies (12 V and 5 V computer USB).
Thank you very much,
Best,
Josep Mencion