- Sat Mar 28, 2015 12:23 pm
#12846
Now I re-read your blog and see that you are using an opto-coupler - OK. I had stopped reading it before because
the small PIR sensors don't have LED's and such - I assumed that there was a big hardware difference and stopped reading - my mistake.
I think other than the opto the big difference between your solution and my not-working-one is that you boot the ESP and do the mqtt connection then shut down the ESP.
OTOH I leave the ESP up, use the PIR to trigger an interrupt on the ESP, shutting the radio on and off as needed. Which is all working except after 5 minutes of no activity I can no longer get my mqtt broker connection. Radio is on, I'm connected to the AP, have the correct connection status, etc - just never get the mqtt broker connect.
My next step was going to be to reboot the ESP every so often (actually whenever I can no longer connect to my mqtt broker) - which I think will essentially do the same thing as your "boot ESP every time" solution.
That solution bothers me - the whole idea that I can only get a good mqtt connection when the ESP is freshly booted just bothers me.
I want to know
why it works perfectly for 4 minutes but after 5 minutes the same re-connection loop that worked for 4 minutes before now no longer gets the mqtt connect.
There's got to be a reason why - something I'm missing, like I missed the whole watchdog timer problem for days.