[arm-allstar] New weather script test

Doug Crompton wa3dsp at gmail.com
Thu Jun 15 19:31:19 EST 2017


Tony,

 You can't use $node - you need to put your actual node number in there!

$NODE1  should be the first node on your server. It has to be caps! Do

echo $NODE1 at the Linux prompt.

But better to just use the actual node number you want to play on. You need
to play it by specifying the script not playing the file out of /tmp.

wx_condition.sh KPHL 40000

would play Philadelphia airport weather to node 40000.

That node must be on the same server where the script is running. It play
locally.


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*






On Thu, Jun 15, 2017 at 7:36 PM, "Tony Ross via arm-allstar" <
arm-allstar at hamvoip.org> wrote:

> Thanks Doug. What I'm seeing now is that ...
>
> /usr/bin/asterisk -rx "rpt localplay $node /tmp/current_wx"
>
> ... is not playing locally from the wx_condition.sh script, or from the
> command line ... I must be missing something if it works for you.
>
> [root at allstar sounds]# ls -l /tmp/current_wx.gsm
> -rw-r--r-- 1 root root 75108 Jun 15 15:42 /tmp/current_wx.gsm
>
> The file seems structured properly, as it plays well in audacity on
> another machine.
>
> On 06/15/2017 12:02 PM, "Doug Crompton via arm-allstar" wrote:
>
>> Tony,
>>
>> The sound files are between the /var/lib/asterisk/sounds  and
>> /var/lib/asterisk/sounds/wx directories. Unfortunately some of the weather
>> related files are not in the wx directory. I may have copied some to there
>> here for convenience and not realized it later.
>>
>> I put an updated version out just now that corrects that. Same file name
>> and download. Rather than change files from directory to directory I am
>> trying to use them where they are by default. The north, south, east, west
>> are not in the wx directory but rather in sounds above it, I corrected to
>> use them there.
>>
>> So re-download and copy the script over what you have. Nothing else needs
>> to change.
>>
>>
>> *73 Doug*
>>
>> *WA3DSP*
>>
>> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>>
>>
>>
>>
>> On Thu, Jun 15, 2017 at 2:07 PM, "Tony Ross via arm-allstar" <
>> arm-allstar at hamvoip.org> wrote:
>>
>> It's very good work, Doug, and the shell script makes it easily
>>> customizable. My node seems to be missing a component when using mode=b:
>>>
>>> ...
>>> cat: /var/lib/asterisk/sounds/wx/north.gsm: No such file or directory
>>>
>>> Where do I find the missing component(s), please.
>>>
>>> [root at allstar sbin]# ls /var/lib/asterisk/sounds/wx/
>>> around.gsm     dew-point.gsm  foot.gsm        gusts.gsm humidity.gsm
>>> kilometer.gsm  mist.gsm       percent.gsm southeast.gsm  temperature.gsm
>>> barometer.gsm  falling.gsm    gust.gsm        gusty.gsm inch.gsm
>>> large.gsm      northeast.gsm  point.gsm southwest.gsm  wind-chill.gsm
>>> ceiling.gsm    feet.gsm       gusting-to.gsm  heat-index.gsm inches.gsm
>>> meter.gsm      northwest.gsm  rising.gsm steady.gsm     winds.gsm
>>>
>>>
>>> On 06/14/2017 09:48 PM, "Doug Crompton via arm-allstar" wrote:
>>>
>>> I have created a new weather script that will say your current local
>>>> weather from either an NWS or wunderground XML site. This may also work
>>>> for
>>>> other weather xml sites. This is a work in progress and almost 500 lines
>>>> of
>>>> code at this point. I am presenting it as a straight download not a
>>>> package. There obviously will be some changes fixes etc. based on your
>>>> input. Once it is proven I suspect it will appear as a package or more
>>>> likely a future update.
>>>>
>>>> To get the code -
>>>>
>>>> cd /usr/local/sbin
>>>> wget https://hamvoip.org/downloads/wx_condition.tar.gz
>>>> tar -xvzf wx_condition.tar.gz
>>>>
>>>> The current file name  is wx_condition.sh
>>>>
>>>> Here are some notes on using it -
>>>>
>>>> This script Voices weather using the Alison voice from the National
>>>> weather
>>>> service XML sites or wunderground stations. It says a fairly complete
>>>> current conditions based on what is available at the site you choose.
>>>> Not
>>>> all sites have ALL data and there is no guarantee the data is correct.
>>>> For
>>>> instance some sites have visibility, some have precipitation and some
>>>> don't. So don't expect to see everything for every site. NWS and
>>>> wunderground will also display slightly different things.
>>>>
>>>> You can use this to voice your personal weather station from
>>>> wunderground.com. In that case the ID is preceded by w-  (the same as
>>>> in
>>>> the weather.sh script.
>>>>
>>>> Getting weather data and presenting it correctly especially in voice is
>>>> a
>>>> tricky thing and I have spent some time trying to get things right. I am
>>>> sure there will be things that do not work or work incorrectly. Based on
>>>> your input I will make corrections. Please give the details of how the
>>>> error occurred and what site you were accessing.
>>>>
>>>> Use the Station ID which can be found at
>>>> http://w1.weather.gov/xml/current_obs/
>>>> or w-<weatherunderground id>
>>>>
>>>> At the NWS site go to your state and nearest location. It is usually an
>>>> airport or major city.
>>>>
>>>> Syntax is -
>>>>
>>>> wx_condition.sh w-<wunder-ID> node mode
>>>> wx_condition.sh <NWS-ID> node mode
>>>>
>>>>    mode =
>>>>
>>>>      'v' for display weather conditions only
>>>>      'd' for debug - display all including files used and play voice
>>>>      'p' or blank for play voice only to the node,
>>>>      'b' for both display and play
>>>>
>>>> Node number must always be entered even if not playing to it.
>>>>
>>>> This script requires the xml2 package which is NOT installed in the
>>>> current
>>>> (6/15/17) hamvoip image
>>>>
>>>> Do -
>>>>
>>>> pacman -Sy xml2
>>>>
>>>> at the Linux prompt and load the package.
>>>>
>>>> To play using an Allstar function - add the following to the
>>>> /etc/asterisk/rpt.conf file functions stanza
>>>>
>>>> 820=cmd,/usr/local/sbin/wx_condition.sh <NWS-ID or
>>>> -wWeatherundergroundID>
>>>> <node>
>>>>
>>>> Replace 820 with any available DTMF sequence you desire, include the ID
>>>> and
>>>> local node on that
>>>> server to play on. Example:
>>>>
>>>>    860=cmd,/usr/local/sbin/wx_condition.sh KPHL 40000
>>>>
>>>>      Play weather to node 40000 when DTMF *860 is entered.
>>>>
>>>> Because of its length it would generally not be suitable to put this in
>>>> a
>>>> cron
>>>>
>>>> Two optional files can be user defined - /etc/asterisk/local/wx_header.
>>>> gsm
>>>> and
>>>>    /etc/asterisk/local/wx_footer.gsm
>>>>
>>>> The header file when present plays BEFORE the weather data and the
>>>> footer
>>>> file AFTER.
>>>> These files must be in .gsm format and standalone playable as such in
>>>> Allstar
>>>>
>>>> The header file could say something like "weather for philadelphia, pa"
>>>> using of
>>>> course your location. This could be in you own voice or using a quality
>>>> tts
>>>> source
>>>> converted to the proper gsm allstar format.
>>>>
>>>> Screen examples - 'v' mode
>>>>
>>>> Weather for Station ID - KNJNORTH13
>>>> ------------------------------------------------------
>>>> Temperature - 64 F / 18 C
>>>> Humidity - 93 Percent
>>>> Wind Direction - West at 0 miles per hour
>>>> Wind Gusts - 0 miles per hour
>>>> Barometric Pressure - 30.02 inches
>>>> Dew point - 62 F / 17 C
>>>> Precipitation Today - 0.00 inches
>>>>
>>>> Weather for Station ID - KPHL
>>>> -------------------------------------------
>>>> Weather - Partly Cloudy
>>>> Temperature - 69 F / 21 C
>>>> Humidity - 61 Percent
>>>> Wind Direction - North at 0 miles per hour / 0 knots
>>>> Barometric Pressure - 30.03 inches
>>>> Dew point - 55 F / 13 C
>>>> Visibility - 10 Miles
>>>>
>>>>
>>>>
>>>> *73 Doug*
>>>>
>>>> *WA3DSP*
>>>>
>>>> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>>>> _______________________________________________
>>>>
>>>> arm-allstar mailing list
>>>> arm-allstar at hamvoip.org
>>>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>>>
>>>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>>>
>>>>
>>>> _______________________________________________
>>>
>>> arm-allstar mailing list
>>> arm-allstar at hamvoip.org
>>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>>
>>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>>
>>>
>>> _______________________________________________
>>
>> arm-allstar mailing list
>> arm-allstar at hamvoip.org
>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>>
>> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>>
>>
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
>


More information about the arm-allstar mailing list