mapero / node-red-contrib-smartplug

MIT License
3 stars 4 forks source link

Produces error every second when plug cannot be reached #8

Closed TotallyInformation closed 8 years ago

TotallyInformation commented 8 years ago

Please, please, please! Don't continuously raise errors when the plug cannot be reached! There is no need, a single error is enough, then give up for a bit before trying again. Better, respect the timeout and retry values so we don't get logs filled with rubbish.

mapero commented 8 years ago

I will look into it. The input node should already respect the retry value, so is assume you mean the output node?

JonMurphy commented 8 years ago

Jochen - Here are the errors I get from the smartplug-in node. And the bottom set of errors goes on forever. I think this is what Julian is referring to.

Here is the error output with SmartPlug unplugged:

May 22, 2016 at 10:39:38 AM CDT  EdiPlug
msg : error
Error: Request timeout occurred - request aborted

May 22, 2016 at 10:39:53 AM CDT  EdiPlug
msg : error
Error: Request timeout occurred - request aborted

May 22, 2016 at 10:40:08 AM CDT  EdiPlug
msg : error
Error: Request timeout occurred - request aborted

The above continues every 15 seconds (8 messages total) lasting ~2 minutes. .

Here is the error output with SmartPlug unplugged longer than 2 minutes:

May 22, 2016 at 10:41:31 AM CDT  EdiPlug
msg : error
Error: connect EHOSTUNREACH

May 22, 2016 at 10:41:39 AM CDT  EdiPlug
msg : error
Error: connect EHOSTUNREACH

May 22, 2016 at 10:41:47 AM CDT  EdiPlug
msg : error
Error: connect EHOSTUNREACH

The above continues every 8 seconds forever or until the SmartPlug is plugged into an outlet.

mapero commented 8 years ago

I will look into it, maybe tomorrow. I wonder why the time interval changes between different error messages. Did you increase the retry time interval?

JonMurphy commented 8 years ago

Jochen - I tried changing the Interval (ms)

screen shot 2016-06-07 at 11 00 35 am_thumb

I could not find "retry time interval" and I am assume "Timeout" is the same. What exactly does "Timeout" and "Retry(s)" do?

screen shot 2016-06-07 at 11 06 06 am_thumb

JonMurphy commented 8 years ago

Jochen - I changed the Timeout from 10 to 60. This changed the amount and duration of the Error: Request timeout occurred - request aborted messages. I only received one of those. But the Error: connect EHOSTUNREACH still happen every 8 seconds and go on forever.

screen shot 2016-06-07 at 11 16 20 am_thumb

TotallyInformation commented 8 years ago

Thanks for the commit, sorry I didn't have time this week to take part in the conversation. I'll try the updated version.

JonMurphy commented 8 years ago

Jochen - I installed the current version. I really like the Node status added to the Node - very helpful!

After I installed the new version I found the smartplug node did not work properly. I kept getting errors like this: screen shot 2016-06-10 at 11 51 42 am copy_thumb

Finally I received an error similar to this (sorry no pic of the exact error): screen shot 2016-06-10 at 11 59 35 am_thumb

A node-red restart did not help. I deleted the smartplug nodes (in & out) in my flow, deployed the flow as-is, then re-added the smartplug nodes. That allowed me to move forward. Still testing!

Jon

TotallyInformation commented 8 years ago

I've now updated and retested. I can confirm that I no longer get the repeating error, many thanks for the rapid fix.

JonMurphy commented 8 years ago

Jochen - I figured out the Timeout and Heartbeat. But what does Discovery = Scanned do?

Small picky item - if the EdiPlug sends data during the Init period (before Connected), then the data that returns looks like this: screen shot 2016-06-10 at 4 26 14 pm copy_thumb

Also repeating error is gone! Thank you! Jon

JonMurphy commented 8 years ago

forgot one important item - I am still getting this error when clicking the Deploy: screen shot 2016-06-10 at 11 51 42 am copy_thumb

mapero commented 8 years ago

I will look into it. Thanks for the feedback.