Hi Zerynth Team,
I built a prototype with Esp32 devkitC and Raspberry Pi4.
A MQTT broker has been installed on the Raspberry Pi.
The Raspberry Pi sends various commands to the Esp32 devkitC using MQTT.
At the beginning, they work well. However, if I don’t send the MQTT command for a while, the MQTT connection is disconnected. From then on, the esp32 no longer receives MQTT commands from the Raspberry Pi. If I restarts the esp32 devkit, then the mqtt works well again. After that, the above problem occurs again.
I tested the MQTT publish and subscribe function on the Raspberry Pi using the same topic. It is still working well. It means there is no issue on the MQTT broker.
I think the MQTT connections between the esp32 and the devkitC is disconnected.
Is there any solution for this problem?
Previously, I sent mqtt commands directly to esp32 from the AWS EC2 server. At that time, this problem did not occur.
Should I check the status of the mqtt connection periodically on the esp32 firmware?
I really hope you get back to me soon with the best solution.
Thanks in advance.