Author Topic: get-USNO-sunmoon  (Read 2804 times)

0 Members and 1 Guest are viewing this topic.

Offline iatros

  • Member
  • *
  • Posts: 8
get-USNO-sunmoon
« on: December 14, 2016, 02:07:38 AM »
Hi everybody
I'm new to this forum and rather new to Saratoga  template. I managed to lfill the template with the data from my weather station.
Still the section "almanac" is "empty", I think the link in get-usno-sunmoon.php (http://api.usno.navy.mil/rstt/oneday?) is no longer valid.
Can anybody help me - or tell me where to look it up?
thanks for any hint!
iatros
« Last Edit: December 14, 2016, 02:11:13 AM by iatros »

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: get-USNO-sunmoon
« Reply #1 on: December 14, 2016, 06:41:40 AM »
Me and Ken are just working on a fix for this, it is a known problem with the USNO data being unavailable. Ken is now in the testing stage and hopefully everything will go ok and an alternative script will be available soon.

Offline iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #2 on: December 14, 2016, 06:52:52 AM »
Thank you, Jáchym, for your fast replay.
But where does
http://www.cospringsweather.com/index.php
get these data from?

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: get-USNO-sunmoon
« Reply #3 on: December 14, 2016, 06:57:02 AM »
Sorry, I might be confused, I am not using Saratoga myself, so maybe it is a different script then, I was referring to this thread:

http://www.wxforum.net/index.php?topic=30800.0

Offline iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #4 on: December 14, 2016, 07:02:03 AM »
ok, I had seen this thread, but it does not concern my problem.
Any idea who could help me?

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: get-USNO-sunmoon
« Reply #5 on: December 14, 2016, 07:32:11 AM »
Thank you, Jáchym, for your fast replay.
But where does
http://www.cospringsweather.com/index.php
get these data from?

Hi,

Ryan from Colorado Springs Weather gets his sun/moon information from the weather software "Weather Display".  It is not generated from the USNO script.

Hope this helps,

John
GR2AE, GR3, Cumulus

Offline iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #6 on: December 14, 2016, 07:44:56 AM »
Quote
Hope this helps,

John

Yes, thank you John

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: get-USNO-sunmoon
« Reply #7 on: December 14, 2016, 01:59:38 PM »
Thank you, Jáchym, for your fast replay.
But where does
http://www.cospringsweather.com/index.php
get these data from?
John is correct: that sun/moon data comes from Weather-Display itself.  It is one of the few weather software programs that includes the complete ephemeris data.  For non-WD, the get-usno-sunmoon.php is used to 'fill in the blanks' about sun/moon rise/set info based on your lat/long.
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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: get-USNO-sunmoon
« Reply #8 on: December 14, 2016, 02:01:54 PM »
Hi everybody
I'm new to this forum and rather new to Saratoga  template. I managed to lfill the template with the data from my weather station.
Still the section "almanac" is "empty", I think the link in get-usno-sunmoon.php (http://api.usno.navy.mil/rstt/oneday?) is no longer valid.
Can anybody help me - or tell me where to look it up?
thanks for any hint!
iatros

What's the URL to your weather website. I see (on my sites) that the USNO access is working.
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 iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #9 on: December 14, 2016, 02:21:53 PM »
It's not (yet) official; I'm going to send you a PM

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: get-USNO-sunmoon
« Reply #10 on: December 14, 2016, 02:33:29 PM »
Got it.  Looking at a view-source of your wxastronomy.php?cache=refresh shows
Quote
<!-- get-USNO-sunmoon.php - Version 2.04 - 11-Nov-2015 -->
<!-- refetch seconds=1 -->
<!-- loading ./cache/USNO-moondata.txt from http://api.usno.navy.mil/rstt/oneday?date=12/14/2016&coords=47.536353,8.296722&tz=1 -->
<!-- GET /rstt/oneday?date=12/14/2016&coords=47.536353,8.296722&tz=1 HTTP/1.1
      Host: api.usno.navy.mil  Port: 80 IP=199.211.133.93-->
<!-- Network error: Connection timed out (110) -->
<!-- HTTP stats:  dns=0.155 conn=5.005 put=n/a get( blocks)=n/a close=n/a total=5.160 secs -->
<!-- fetch function elapsed= 5 secs. -->
<!-- loading finished. -->
<!-- processing JSON entries for Moon data -->
<!-- json_decode returns  - No errors -->
<!-- note: 'fracillum' not in JSON, no 'illumination' is available. -->
<!-- USNOdata
Array
(
)
 -->
so it's a network connection issue from your webserver to the api.usno.navy.mil server ..

Trying check-fetch-times.php on your site shows
Quote
check-fetch-times.php Version 1.15 - 31-Oct-2016
Website PHP information

Webserver OS: Linux srv3.tophost.ch 2.6.32-673.8.1.lve1.4.3.el6.x86_64 #1 SMP Wed Feb 10 08:57:30 EST 2016 x86_64
PHP Version: 5.6.28
Document root: /home/dubler/public_html/wetter
allow_url_fopen = ON
allow_url_include = off
Checking access to key websites for your template set

This script will check the load times and the ability to save cache files for the included support scripts with your template package.

  Included Settings.php time=0.000 secs.

Using lang=de as default for testing

--checking UV Forecast from temis.nl --
Using Settings.php $SITE['UVscript'] entry for test.
URL: http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=8.296722&lat=47.536353
Cache: ./cache/uv-forecast.txt
 curl fetching 'http://www.temis.nl/uvradiation/nrt/uvindex.php?lon=8.296722&lat=47.536353'
 HTTP stats:  RC=200 dest=145.23.254.72 port=80 (from sce=194.150.248.30)
      Times: dns=0.509 conn=0.540 pxfer=0.540 get=0.284 total=0.824 secs
RC=200 OK, bytes=5512
Wrote 5512 bytes to ./cache/uv-forecast.txt successfully.
Test was SUCCESSFUL.
--end UV Forecast from temis.nl check --

--checking WU Forecast URL --
Using first entry in Settings.php $SITE['WUforecasts'] for test.
URL: http://api.wunderground.com/api/6f935b8ffaadef07/forecast10day/geolookup/lang:en/q/47.536,8.297.json
Cache: ./cache/WU-forecast-0-de.txt
 WU_API Raw URL='https://www.wunderground.com/cgi-bin/findweather/getForecast?query=47.536%2C8.297&sp=IAARGAUE6'
 query='47.536,8.297'
 WU API New URL='http://api.wunderground.com/api/6f935b8ffaadef07/forecast10day/geolookup/lang:en/q/47.536,8.297.json'
 curl fetching 'http://api.wunderground.com/api/6f935b8ffaadef07/forecast10day/geolookup/lang:en/q/47.536,8.297.json'
 HTTP stats:  RC=200 dest=23.201.255.119 port=80 (from sce=194.150.248.30)
      Times: dns=1.509 conn=1.509 pxfer=1.510 get=1.264 total=2.774 secs
RC=200 OK, bytes=27250
Data age=1 sec 'Wed, 14 Dec 2016 19:29:37 GMT'
Wrote 27250 bytes to ./cache/WU-forecast-0-de.txt successfully.
Test was SUCCESSFUL.
--end WU Forecast URL check --

--checking METEOalarm warning URL --
Using Settings.php $SITE['EUwarningURL'] entry for test.
URL: http://www.meteoalarm.eu/index2.php?lang=de_GE&day=0&AT=0&country=CH
Cache: ./cache/meteoalarm-de.txt
 curl fetching 'http://www.meteoalarm.eu/index2.php?lang=de_GE&day=0&AT=0&country=CH'
 HTTP stats:  RC=200 dest=81.31.132.86 port=80 (from sce=194.150.248.30)
      Times: dns=0.124 conn=1.149 pxfer=1.149 get=0.174 total=1.324 secs
RC=200 OK, bytes=94045
Data age=0 sec 'Wed, 14 Dec 2016 19:29:39 GMT'
Wrote 94045 bytes to ./cache/meteoalarm-de.txt successfully.
Test was SUCCESSFUL.
--end METEOalarm warning URL check --


Total time taken = 0.000 secs.
Elapsed 5 seconds.

PHP Version 5.6.28
Memory post_max_size 100M bytes.
Memory usage 669416 bytes.
Memory peak usage 1007256 bytes.
so your webserver does allow outbound HTTP access ok.

It can be either a routing issue from your webserver to api.usno.navy.mil, or they may have added a block for the ip address of your webserver.. no way to tell.   Have your hoster try doing traceroute to api.usno.navy.mil from a shell on your webserver -- it the traceroute completes ok, then it's likely that the Navy has blocked your webserver from access.

Hope this helps...

Best regards,
Ken
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 iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #11 on: December 14, 2016, 02:41:36 PM »
Thank you, Ken
If I understand correctly, I should be able to open
http://api.usno.navy.mil/rstt/oneday?date=12/14/2016&coords=47.536353,8.296722&tz=1
in my browser?
And if it's not possible, there could be a problem of any kind of acces blocking?
Well, typing the URL above gets a "The server at api.usno.navy.mil is taking too long to respond." response in my Firefox...
Martin

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: get-USNO-sunmoon
« Reply #12 on: December 14, 2016, 03:10:06 PM »
Thank you, Ken
If I understand correctly, I should be able to open
http://api.usno.navy.mil/rstt/oneday?date=12/14/2016&coords=47.536353,8.296722&tz=1
in my browser?
And if it's not possible, there could be a problem of any kind of acces blocking?
Well, typing the URL above gets a "The server at api.usno.navy.mil is taking too long to respond." response in my Firefox...
Martin
No, it's not your browser that's the issue, it's your webserver -- the webserver is having problems connecting to api.usno.navy.mil

Your browser would use http://aa.usno.navy.mil/data/docs/RS_OneDay.php to query with their form.  The API requires HTTP POST to get the information and without using a form, your browser can't provide that using a GET mode URL.  Having your browser work and your webserver not work is inconclusive to resolving the issue:  your webserver's connectivity to api.usno.navy.mil
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 iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #13 on: December 14, 2016, 03:14:17 PM »
ok, then I will ask my web hoster that question.
I'll let you know!
Thank you so far very much vor your help
best regards
Martin

Offline iatros

  • Member
  • *
  • Posts: 8
Re: get-USNO-sunmoon
« Reply #14 on: December 15, 2016, 06:18:00 AM »
Hi Ken
my hoster says that traceroute fails, so he thinks that navy.mil is blocking the access. In fact, I can open http://aa.usno.navy.mil/index.php if I use an anonymization addon for Firefox...
I'm now waiting for an answer from navy.mil.
best regards
Martin

 

anything