Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
weather_adj plugin issues
#1
Photo 
Hi,

Recently after having a faulty SD card I did a complete fresh install; Raspian Jessie, SIP and the mobile app. I thought this may have cured a recurring problem that I have with the weather_adj plugin. It works for several days and then just stops making requests to wunderground. It will usually start again if I reboot the system but a few days later it will start having issues again. I thought the complete rebuild would fix it but it is happening again. Is there any way to log requests and results for the plugin?

Another issue that I have with it is when I try to turn it on in by enabling "Use Automatic Rain Delay:" it gives me an HTTP 500 error. I had to enable it by editing the .json file.

Thirdly when it was working the other day it correctly told me that a rain delay was in force until 5.00 pm the next day, when I checked it around 11.00 pm it still said that (18 hours to go) but at 8.00am the next morning no delay was in effect. This issue and the first one I have had occur for quite some time.

I've attached a screen grab of the wunderground graph. It's only logged one request today.

Any thoughts on how to troubleshoot would be welcome.

Best Regards
David


Attached Files Thumbnail(s)
   
Reply
#2
Hi David,

Let me look into this.

That plugin has been around for a while and was updated recently. There is no logging capability in the plugin but perhaps we could add it in order to debug the problems. I try to keep logging to a minimum to prolong the life of the SD card which has a finite number of write cycles.

For one, it sounds like the plugin may not be handling data request errors from WU properly. There is only one "try, except" error handling block in the plugin and it is for checking the existence of the plugin's configuration file.

From a quick look through the code it appears the plugin will cancel the rain delay as soon as good weather is detected if the "Reset Delay On Good Weather" option is checked in the plugins configuration page. Please check that setting.

There are some other parts of the code that look like they can be improved. I did not write the plugin and have not given it a close inspection before. I will go through it and do some testing.

The plugin is also set up to run in a thread. If the plugin hangs that would not be detected by the main program.


There may also be some future changes in Weather Underground now that it has been acquired by IBM corp.

Dan
Reply
#3
Upon doing some testing by starting sip manually from the command line I noticed that the weather_adj plugin would check weather multiple times within an hour.
This appears to result from re-starting the program without doing a reboot which happens when an option is changed. The result is that several copies of the plugin's thread are left running.

In my local copy I have added error checking on all web access the plugin does. This may help with the plugin stopping after some time.

Still looking at things here.

Dan
Reply
#4
Hi Dan,
Thank you very much for looking into this.
Regards
David
Reply
#5
I just pushed an updated version of the weather_adj plugin to to GitHub.

It includes a logging capability which is disabled by default. Once you re-install the plugin you can open the weather_adj.py file in the plugins folder and enable logging by editing line ~20 and change "False" to "True". The log file will be created in the data directory.

The update also includes error handling blocks around all web access code. This should help prevent the plugin from hanging. There is also code to stop any running copies of the plugin when the program is restarted.

I have been running this plugin for a couple of weeks and it seems to be working properly. We have gotten some rain in the past few days and the plugin activated rain delay.

The remaining time display for the rain delay does not update automatically, you need to refresh the page to get it to update. This is due to the way the main program code works.

Dan
Reply
#6
Thank you Dan, I've installed it and I'll let you know how it goes. This probably means we won't have rain for months!
Reply
#7
Hi Dan,

It certainly runs better than the old one but it still randomly stops working. It starts again if I do a reset.

Is there anything I can do to help track down the cause?

Cheers
David
Reply
#8
Random bugs are the hardest to track down.

When you say it starts after a reset are you referring to a software restart or a full reboot?

How long has it worked before stopping?

I'll let you know if I think of anything to watch for.

Dan
Reply
#9
Hi Dan,

A software reset gets it going again. The old version would need a complete reboot.

It had one run for almost two weeks before stopping but the next time was only two days.

David
Reply
#10
Just a quick update:

I am adding more informative logging.
Looking at the wundergound web site it looks like they have had some service interruptions. The plugin runs in a thread and there is currently no way to check if the thread has exited.

I think there is a way to check and restart the plugin if it stops.

I'll get back to you after running some tests for a few days.

Dan
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)