Author Topic: Sun Moon Error from USNO  (Read 1855 times)

0 Members and 1 Guest are viewing this topic.

Offline powerline

  • Member
  • *
  • Posts: 35
    • Oak Ridge North Weather
Sun Moon Error from USNO
« on: April 19, 2018, 07:31:58 AM »
Has something changed on the Sun and Moon info that we import?  I'm getting this on my home page.


Warning: Invalid argument supplied for foreach() in /home2/reepps/public_html/get-USNO-sunmoon.php on line 360

Warning: Invalid argument supplied for foreach() in /home2/reepps/public_html/get-USNO-sunmoon.php on line 371 


Thank you,

Ron
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Sun Moon Error from USNO
« Reply #1 on: April 19, 2018, 08:09:21 AM »
Has something changed on the Sun and Moon info that we import?  I'm getting this on my home page.


Warning: Invalid argument supplied for foreach() in /home2/reepps/public_html/get-USNO-sunmoon.php on line 360

Warning: Invalid argument supplied for foreach() in /home2/reepps/public_html/get-USNO-sunmoon.php on line 371 


Thank you,

Ron
Today, as happened a few times before the last weeks, the USNO server does not return any data at all.
You are using Ken's script which has an extra setting for this situation: http://www.oakridgewx.net/get-USNO-sunmoon.php?sce=view
Change line 69 in get-USNO-sunmoon.php from
Code: [Select]
  $useUSNO = true; // =true; use USNO data, =false; use computed values only (not as accurate) to m
Code: [Select]
  $useUSNO = false; // =true; use USNO data, =false; use computed values only (not as accurate) until the USNO servers ia available again,

Wim

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Sun Moon Error from USNO
« Reply #2 on: April 19, 2018, 04:09:51 PM »
For some reason marking =false still led to slow load times on my page.  I just renamed the get file.  Now my site is snappy again.

Let us know if you see it working again.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline powerline

  • Member
  • *
  • Posts: 35
    • Oak Ridge North Weather
Re: Sun Moon Error from USNO
« Reply #3 on: April 19, 2018, 07:27:45 PM »
When I changed it to "false", it works well now.  I'll keep an eye on it.

Thank you,

Ron
Ron

Davis Vantage Pro2.  Meteobridge Pro
CWOP:  CW2840
WU:  KTXOAKRI1
http://www.oakridgewx.net

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Sun Moon Error from USNO
« Reply #4 on: April 20, 2018, 09:01:19 AM »
If you are using the full Saratoga scripts, you need edit line 60 in your Settings.php file.  That has the UseUSNO= false you need to disable it.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sun Moon Error from USNO
« Reply #5 on: April 20, 2018, 10:06:05 AM »
Please note that you need V3.x of get-USNO-sunmoon.php to use $SITE['useUSNO'] = false; in your Settings.php file.  Earlier versions did not have that feature.  Use check-fetch-times.php?show=versions on your site to keep up-to-date.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Sun Moon Error from USNO
« Reply #6 on: April 20, 2018, 10:18:02 AM »
I got rather fed up with the flakiness of the USNO site quite a while ago and modified my code to be less reliant on it.

1) I have a meteobridge, which provides the sun and moon info that I need except for in one case - when there is either no moonrise or moonset on a particular day.  So, I only need to reference the USNO info about once a month (which provides the day before/after rise or set).

I don't know whether software other than meteobridge provides this data, but it might be worth looking into.

2) I moved the actual fetch from the USNO site to a cron job. So when the home page of my site is pulled up, it is always reading from a cache file if the USNO data is needed. (In general, I've tried to eliminate all fetches from remote sites so that the home page load time is not dependent on anything external to my server).
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Sun Moon Error from USNO
« Reply #7 on: April 20, 2018, 12:32:36 PM »
I don't know whether software other than meteobridge provides this data, but it might be worth looking into.

If you run PHP, it has sunrise and set calcs built into it. Somewhere there is also a moonrise/set script. We integrated that into Weatherelement.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #8 on: April 21, 2018, 02:43:51 AM »
Hi

I, too, am having this problem.  It looks like we just have to wait until the USNO makes the necessary corrections for this data to show properly in my Saratoga Templates.

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #9 on: April 21, 2018, 03:01:03 AM »
Hi

Could someone please tell me how I am to find out that the USNO data is "up and running again".

I have just tried to get information direct from the website http://aa.usno.navy.mil/data/ and my Firefox browser can't find it!

best wishes

Keith G
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Sun Moon Error from USNO
« Reply #10 on: April 21, 2018, 09:39:58 AM »
Could someone please tell me how I am to find out that the USNO data is "up and running again".

I have just tried to get information direct from the website http://aa.usno.navy.mil/data/ and my Firefox browser can't find it!

Just keep trying that. Once the site starts responding you'll no longer get the "unable to connect" message from Firefox.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Sun Moon Error from USNO
« Reply #11 on: April 23, 2018, 10:15:55 PM »
It appears to be back. Earlier today I was getting occasional responses, but taking ~95s or so. Now it is responding normally.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #12 on: April 24, 2018, 12:23:20 AM »
Thanks.  I spotted that it was back up and running.

best wishes

Keith
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: Sun Moon Error from USNO
« Reply #13 on: April 24, 2018, 07:01:26 AM »
It's been an ongoing issue for me causing website to hang going back couple years so removed the sun/moon page entirely and renamed the get php so it wouldn't try and fetch data. Really sped my site up.
The Saratoga script still does the basic sunset, rise and moon phase without causing site to hang.
Randy

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #14 on: April 24, 2018, 06:22:57 PM »
The UNSO site is down again - 0822 AEST 25th April 2018.

Keith G
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Sun Moon Error from USNO
« Reply #15 on: April 24, 2018, 08:07:40 PM »
I bumped the timeout way up to 100 seconds and got a response after 80 seconds. But, yeah, effectively that is "down" in my book.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #16 on: April 24, 2018, 11:01:27 PM »
1300 AEST 25 April 2018.  USNO is up again

Keith G
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline sfcwx

  • Member
  • *
  • Posts: 10
Re: Sun Moon Error from USNO
« Reply #17 on: April 25, 2018, 04:58:47 AM »
I've updated the scripts to their latest version.  When I try setting $useUSNO to false (either in Settings.php or get-USNO-sunmoon.php), I get a mostly blank page on my website.

Any ideas what I could be missing?  When I view source, it looks like it's got the calculations, but then nothing follows after that.

At the moment, I've just set the timeout to 2 seconds so the website doesn't keep hanging, as the USNO servers seem to be off and on still.

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #18 on: May 01, 2018, 12:29:57 AM »
Hi all

Just thought that I would check on this line of code in my "get-USNO-sunmoon.php - Version 3.01 - 20-Oct-2017" program to ensure that it is current at 1 May 2018:

  $USNOUrl = "http://api.usno.navy.mil/rstt/oneday?date=$lclToday&coords=$myLat,$myLong&tz=$myTZOffset";

Can anyone confirm that the above is correct, or otherwise.

Thanks

Keith G
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Sun Moon Error from USNO
« Reply #19 on: May 01, 2018, 07:31:25 AM »
Correct. When filled in, it looks something like:

Code: [Select]
http://api.usno.navy.mil/rstt/oneday?date=05/01/2018&coords=42.439852,-71.240494&tz=-4
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline griffo42

  • Contributor
  • ***
  • Posts: 101
    • Carina Weather
Re: Sun Moon Error from USNO
« Reply #20 on: May 01, 2018, 07:59:06 AM »
Thanks for your reply.

Keith G
https://www.kstwx.net/index.php
Davis Vantage Pro2 Model #6152AU
Cumulus latest version
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

 

anything