SOLVED Weather By Zip Code and Airport Code

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,626
Reaction score
138
Location
Atlanta, GA
"Seems to be broken again" tells us very little. Logs?
I just ran it on mine to check, and it doesn't work. NOAA probably changed their website around again.

Code:
    -- Executing [[email protected]:1] Answer("SIP/215-000000ac", "") in new stack
  == Extension Changed 215[ext-local] new state InUse for Notify User 228 
    -- Executing [[email protected]:2] Wait("SIP/215-000000ac", "1") in new stack
    -- Executing [[email protected]:3] Set("SIP/215-000000ac", "TIMEOUT(digit)=7") in new stack
    -- Digit timeout set to 7.000
    -- Executing [[email protected]:4] Set("SIP/215-000000ac", "TIMEOUT(response)=10") in new stack
    -- Response timeout set to 10.000
    -- Executing [[email protected]:5] Flite("SIP/215-000000ac", ""At the beep enter the five digit code for the weather report you wish to retrieve."") in new stack
  == Parsing '/etc/asterisk/flite.conf':   == Found
    -- <SIP/215-000000ac> Playing '/tmp/Flite_1242710611.slin' (language 'en')
    -- Executing [[email protected]:6] Read("SIP/215-000000ac", "ZIPCODE,beep,5") in new stack
    -- Accepting a maximum of 5 digits.
    -- <SIP/215-000000ac> Playing 'beep.ulaw' (language 'en')
    -- User entered '29585'
    -- Executing [[email protected]:7] Flite("SIP/215-000000ac", ""Please hold a moment while we contact the National Weather Service for your report."") in new stack
  == Parsing '/etc/asterisk/flite.conf':   == Found
    -- <SIP/215-000000ac> Playing '/tmp/Flite_352867013.slin' (language 'en')
    -- Executing [[email protected]:8] AGI("SIP/215-000000ac", "nv-weather-zip.php,29585") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/nv-weather-zip.php
    -- <SIP/215-000000ac>AGI Script nv-weather-zip.php completed, returning 0
    -- Executing [[email protected]:9] NoOp("SIP/215-000000ac", "Wave file: ") in new stack
    -- Executing [[email protected]:10] Playback("SIP/215-000000ac", "") in new stack
[2013-06-09 17:46:01] WARNING[7411]: app_playback.c:437 playback_exec: Playback requires an argument (filename)
  == Spawn extension (distinctive-internal, 947, 10) exited non-zero on 'SIP/215-000000ac'
    -- Executing [[email protected]:1] Hangup("SIP/215-000000ac", "") in new stack
  == Spawn extension (distinctive-internal, h, 1) exited non-zero on 'SIP/215-000000ac'
  == Extension Changed 215[ext-local] new state Idle for Notify User 228 
pbx*CLI>
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
Definitely broken.
In the nvweather-zip.php, I replaced the line:

//$thetext="point-forecast-area-title";

with:

$thetext="current-conditions";

This definitely helps, but there is some erroneous info at the beginning of the forecast reading. I just can't figure out the entry point from looking at the page for current conditions. I believe the line that needs updating now is $newvalue=$cityupdate."Current local conditions " . substr($value,27, $start-27). ": ";

And yes, I am driving blind in a snow storm.... without a seat belt. :cool:
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,134
Reaction score
2,628
Thanks for the head start. Here's the updated script to resolve the latest National Weather Service "improvements."



Log into your server as root, and...
Code:
cd /var/lib/asterisk/agi-bin
mv nv-weather-zip.php nv-weather-zip-last.php
wget http://incrediblepbx.com/nv-weather-zip-patch.tar.gz
tar zxvf nv-weather-zip-patch.tar.gz
rm nv-weather-zip-patch.tar.gz
 
  • Like
Reactions: Trimline2

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
Thanks for the head start. Here's the updated script to resolve the latest National Weather Service "improvements."



Log into your server as root, and...
Code:
cd /var/lib/asterisk/agi-bin
mv nv-weather-zip.php nv-weather-zip-last.php
wget http://incrediblepbx.com/nv-weather-zip-patch.tar.gz
tar zxvf nv-weather-zip-patch.tar.gz
rm nv-weather-zip-patch.tar.gz

Yep, that's a winner. Lucky number 79... thanks.
 
Joined
May 23, 2013
Messages
223
Reaction score
28
Location
Troy, Ohio
Still not working for me, at least when I try DAY I didn't try any other local but I just get it reading back HTML to me.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
Are you entering a valid zip code? Not sure what "DAY" is.

Also, make sure that when you edit custom_weatherzip.conf via Other --> Config Edit, that nv-weather-zip.php is properly referenced. I've seen on older systems, it is referenced as nvweather-zip.php.
 
  • Like
Reactions: Chris Sweeney

omunni

Guru
Joined
Feb 12, 2010
Messages
27
Reaction score
7
Location
Saint Cloud, FL
Note: For those using Incredible PBX for raspberry pi.
After running the codes posted by Ward above; edit nvweather-zip.php and replace the line:
$link = mysql_connect("localhost", "root", "passw0rd")
with
$link = mysql_connect("localhost", "root", "raspberry")

Otherwise it won't work.
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,134
Reaction score
2,628
Incredible PBX 11 and Incredible PBX 3.11 for Raspberry Pi automatic patches have been released. Thanks for all the help!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,134
Reaction score
2,628
Here's the patch for the Weather by Airport Code (611) application. This is the result of NWS "improvements" recently. Log into your server as root and...

Code:
cd /var/lib/asterisk/agi-bin
mv nv-weather.php nv-weather-old.php
wget http://incrediblepbx.com/nv-weather-patch.tar.gz
tar zxvf nv-weather-patch.tar.gz
rm nv-weather-patch.tar.gz
 
  • Like
Reactions: lgaetz

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,364
Messages
137,343
Members
14,574
Latest member
ipv6freely