Page 1 of 1

gmail IMAP idle stalls after a while?

PostPosted: Thu Dec 15, 2016 10:39 am
by blysik
Setup gmail running via IMAP and IDLE. Things work fine for a while, then in my logs I see something like this:

Dec 15, 2016, 4:28:13 AM
Better Email Debug Gmail IMAP: IDLE Event Received
Better Email Debug Gmail IMAP: Doing checkMsgs
Better Email Debug Gmail IMAP: msg_ids = ['']

Dec 15, 2016, 4:29:30 AM
Z-Wave received "002 - Luminance" sensor update to 0 lux

Dec 15, 2016, 4:36:00 AM
Better Email Debug Gmail IMAP: IDLE Event Received
Better Email Debug Gmail IMAP: Doing checkMsgs

And it just stops. It doesn't do anything after that until I restart the Better Email plugin,.

Any ideas? Thanks.

Re: gmail IMAP idle stalls after a while?

PostPosted: Thu Dec 15, 2016 10:43 am
by FlyingDiver
As far as I can tell, it's a Gmail bug. It just stops sending to IDLE connections. The best I can suggest is that you set a schedule (hourly, maybe) that disables then enables the GMail server device. That will cause it to reconnect to GMail. Just make sure you delay the enable action by 10 or 15 seconds after the disable.

Re: gmail IMAP idle stalls after a while?

PostPosted: Thu Dec 15, 2016 11:25 am
by blysik
Sounds good. I'm having trouble finding my IMAP server device under the Actions. Am I missing something obvious? I can't get to it via 'Device Actions' or 'Better Email' actions.

Re: gmail IMAP idle stalls after a while?

PostPosted: Thu Dec 15, 2016 11:27 am
by FlyingDiver
Enabling/disabling devices is an Indigo server action. So Server Actions -> Enable/Disable Actions

Re: gmail IMAP idle stalls after a while?

PostPosted: Thu Dec 15, 2016 11:30 am
by blysik
Aha! Got it, thanks.

Re: gmail IMAP idle stalls after a while?

PostPosted: Fri Dec 16, 2016 10:11 am
by Bollar
FWIW, I have been using the following Python script to do a restart:

Code: Select all
plugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.betteremail")
if plugin.isEnabled():
   plugin.restart()

Re: gmail IMAP idle stalls after a while?

PostPosted: Fri Dec 16, 2016 10:13 am
by FlyingDiver
Bollar wrote:
FWIW, I have been using the following Python script to do a restart:

Code: Select all
plugin = indigo.server.getPlugin("com.flyingdiver.indigoplugin.betteremail")
if plugin.isEnabled():
   plugin.restart()


That certainly will work, but I'm thinking why restart the whole thing when it's just the one connection that needs a restart? Though I think I was the one that told you to do it that way.

I guess I could add an action that would restart the connection. Not sure it's worth the effort. :)

Re: gmail IMAP idle stalls after a while?

PostPosted: Fri Dec 16, 2016 10:17 am
by Bollar
FlyingDiver wrote:
I guess I could add an action that would restart the connection. Not sure it's worth the effort. :)

Probably not. This account is pretty much my sole remaining tie to Google, so perhaps I'll migrate to something else...