Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By terenceang
#12839
Mikejstb wrote:Argh! I forgot to check the notify me of replies button again! Twice this morning - I think I need another cup of coffee...


coffee is good... I lost much sleep the past few days over HTTPS connection, finally come to the conclusion that it is not possible with the current SDK., at least for google.com and pushbullet.com.
User avatar
By Mikejstb
#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.
User avatar
By terenceang
#12854 How do you turn the radio on and off? By using sleep option? For me, I cannot turn on the radio without triggering the PIR so this is the only solution for me. Works for me since I only need a notification.
User avatar
By Mikejstb
#12855 I first turn interrups off by setting the gpio of the PIR from trigger to input.
Then I just disconnect with wifi.sta.disconnect()
I determined from using LuaLoader that this is enough to make the radio- PIR interference stop.