ESP32 stops subscribing after a while #101
-
I am using an esp32 to track my machine usage. it publishes the machine data using mqtt publish qos 1. i have also made the esp32 subscribe to a topic where i send in some inputs. My issue is my code works perfectly fine but after a few hours it stops receiving messages. it still publishes the data so i know it is connected to mqtt without any problem, but why does it stop receiving these messages? Any help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 24 replies
-
That would be very odd behaviour. If it is connected, it means it sends and receives PING/PONG messages. Are you able to get debug output via Serial? --> set core debug log level to "verbose". |
Beta Was this translation helpful? Give feedback.
-
While mqtt disconnects frequently at my work, the wifi-esp connection doesn't break that often |
Beta Was this translation helpful? Give feedback.
ok i ran some more tests. so i have 2 routers at work. i ran my code on the secondary router this time and faced much fewer disconnect-connect cycles (3 in 2 hours) which i feel is very reliable. also the device reconnected much faster. i believe its only my primary router that sucks after all. i'll change them and see how it goes.
sorry i ever questioned your greatness