[arm-allstar] wx script setup
Neil k8it
k8it at cac.net
Fri May 15 11:40:48 EST 2015
In following your testing instructions on the link you provided I got this result when I tried test step #2
how do I fix this. it looks like the file is there.
thanks 73 Neil k8it node 41838
[root at kitlink /]#
[root at kitlink /]# /usr/local/bin/Weather/getWxAlert mic077 "Kalamazoo County"
Missing /usr/local/bin/Weather/wx_scripts.conf file, aborting...
[root at kitlink /]# cd /usr/local/bin/Weather
[root at kitlink Weather]# ls -l
total 96
-rwxr-xr-x 1 root root 1148 Sep 22 2014 clearWxAlerts
-rwxr-xr-x 1 root root 19138 Sep 22 2014 getWxAlert
-rwxr-xr-x 1 root root 2150 Sep 22 2014 getWxFor
-rwxr-xr-x 1 root root 5909 Sep 22 2014 getWxRpt_ug
-rw-r--r-- 1 root root 268 Sep 22 2014 parsing_list.txt
-rwxr-xr-x 1 root root 3768 Sep 22 2014 playWxAlertBg
-rwxr-xr-x 1 root root 948 Sep 22 2014 trend
-rw-r--r-- 1 root root 1944 Sep 22 2014 wx_alert_product.txt
-rw-r--r-- 1 root root 9165 Oct 9 2014 Wx_Config_Readme.txt
-rwxr-xr-x 1 root root 12523 Sep 22 2014 wx_config.sh
-rw-r--r-- 1 root root 191 Sep 22 2014 wx_critical_alerts.txt
-rw-r--r-- 1 root root 50 Sep 22 2014 wx_normal_alerts.txt
-rw-r--r-- 1 root root 2806 Sep 22 2014 wx_scripts.conf_NEW
-rw-r--r-- 1 root root 502 Sep 22 2014 wxtext_conv.sed
[root at kitlink Weather]#
From: Christopher Kovacs
Sent: Friday, May 15, 2015 8:40 AM
To: ARM Allstar
Subject: Re: [arm-allstar] wx script setup
The files are created by the execution of the cron entries. If the files are not created, then either the cron entries are missing or the crond is not executing.
Below should help you resolve your issues (see http://http://w0anm.com/blog/?p=519). If you have something that files during your testing, please let me know and I can work with you.
73,
Chris w0anm
Testing Weather Alerts
Follow the steps below:
1.. list cron entries:
crontab -l
Which shows:
# NWS Alert for MNC171 in Wright County
*/14 * * * * (/usr/local/bin/Weather/getWxAlert MNC171 "Wright County" &> /dev/null 2>&1)
# Underground Weather for station: KMNROGER1
*/16 * * * * (/usr/local/bin/Weather/getWxRpt_ug KMNROGER1 &> /dev/null 2>&1)
# Underground Weather (pressure trends) for station: KMNROGER1
0 */6 * * * (/usr/local/bin/Weather/trend KMNROGER1 &> /dev/null 2>&1)
# National Wx Service Forecast based on Zone: MNZ059
*/16 * * * * (/usr/local/bin/Weather/getWxFor MNZ059 &> /dev/null 2&>1)
2.. Execute the getWxAlert entry:
/usr/local/bin/Weather/getWxAlert MNC171 "Wright County"
3.. Verify the following files that were created in /tmp/wx by entering:
ls /tmp/wx/alert/
For an example, the county id that I have setup is MNC171. Here is the output for the command above:
ls -la /tmp/wx/alert/MNC171
total 64
drwxr-xr-x 2 root root 160 Oct 19 12:47 .
drwxr-xr-x 3 root root 60 Oct 19 12:42 ..
-rw-r--r-- 1 root root 1775 Oct 19 12:47 alert.info
-rw-r--r-- 1 root root 172 Oct 19 12:42 alert_prev_summary.txt
-rw-r--r-- 1 root root 41208 Oct 19 12:42 alert_short.ul
-rw-r--r-- 1 root root 172 Oct 19 12:47 alert_summary.txt
-rw-r--r-- 1 root root 74 Oct 19 12:42 no_alerts.txt
-rw-r--r-- 1 root root 56 Oct 19 12:47 wx_new.txtWeather Alert Troubleshooting
a.. Check to make sure that the county id is valid and was entered correctly.
b.. If dtmf sequence fails to output, make sure that there is an audio file in /tmp/wx/alert/<county_id>/alert_short.ul and it’s a “non-zero” length file meaning that the file size is greater than 0, and typically it’s 41K in size.
c.. In the rare event that the locking files are in a “dead lock” condition, you can clear the weather alerts by using the “/usr/local/bin/Weather/clearWxAlert” script as follows:
/usr/local/bin/Weather/clearWxAlerts
Stopping Weather Alert Messages... Done.
Removing lock files from /tmp... Done.
Cleaning up the alert weather directories... Done.
Removing temporary files in /tmp/wx.. Done.
Testing Weather Forecast
Verify that the crontab entry for the weather forecast is present. Type:
crontab -l
Look for the entry:
# National Wx Service Forecast based on Zone: MNZ059
*/16 * * * * (/usr/local/bin/Weather/getWxFor MNZ059 &> /dev/null 2>&1)
If the entry is not present, you will need to execute the /usr/local/bin/Weather/wx_config.sh script and select “y” to the prompt “Do you wish to setup/update the weather forecasts”. For weather forecasts, first get the data manually using the following commands:
/usr/local/bin/Weather/getWxFor ;
For example:
/usr/local/bin/Weather/getWxFor MNZ059
There will be a delay before the prompt is returned. The getWxFor script is pulling data from the NWS website and parsing the data. Once the data is parsed, the data files and audios files are created in /tmp/wx/forecast/;. For example:
/tmp/wx/forecast/MNZ059
wx_forecast.txt wx_forecast.ul
The wx_forecast.txt file is the text file for the weather forecast and the wx_forecast.ul is the audio file.
Weather Weather Underground Reports
Verify that the crontab entry for the weather forecast is present. Type:
crontab -l
Look for the entry:
# Underground Weather for station: KMNSTMIC3
*/16 * * * * (/usr/local/bin/Weather/getWxRpt_ug KMNSTMIC3 &> /dev/null 2>&1)
# Underground Weather (pressure trends) for station: KMNSTMIC3
0 */6 * * * (/usr/local/bin/Weather/trend KMNSTMIC3 &> /dev/null 2>&1)
If the entry is not present, you will need to execute the /usr/local/bin/Weather/wx_config.sh script and select “y” to the prompt “Do you wish to setup/update the weather reports: [y,n,q]?”. For weather reports, first get the data manually using the following commands:
/usr/local/bin/Weather/getWxRpt_ug
/usr/local/bin/Weather/trend
For example:
/usr/local/bin/Weather/getWxRpt_ug KMNSTMIC3
/usr/local/bin/Weather/trend KMNSTMIC3
There will be a delay before the prompt is returned. The getWxPrtp_ug script is pulling data from the Weather Underground Station and parsing the data. Once the data is parsed, the data files and audios files are created in /tmp/wx/wxreport_ug/<WX_Underground_STNID>. For example:
/tmp/wx/wxreport_ug KMNSTMIC3
The directory will contain several files:
cur_WxRpt_ug.txt cur_WxRpt_ug.ul KMNSTMIC3.xml saved_pressure.var var.src
The cur_WxRpt_ug.txt file is the text file for the weather forecast and the cur_WxRpt_ug.ul is the audio file. There are also pressure trend files that are saved in this directory. This monitors the pressure trends in a six hour period if the data is available.
Using the Scripts
Once the scripts are setup in cron to gather the information and the rpt.conf file has been modified, there is not much to using the scripts. The cron entries will automatically gather the weather information. I would suggestion to stagger the gathering times if you are gathering a lot of weather information. This can be accomplished by editing the corntab by using the command:
crontab -e
The format of the crontab file is as follows:
The time and date fields are:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sunday, or use names)
The first field, minute, can follow a range with “/<number>” specifies skips of the number’s value through the range. For example, “0/20” can be used to specify command execution every 20 minutes, or you can select a step range. For example:
0, 18, 34, 46 * * * * (/usr/local/bin/Weather/getWxRpt_ug KMNSTMIC3 &> /dev/null 2&>1)
This will execute the script on top of the hour, 18 minutes past the hour, 34 minutes past the hour, and then 46 past the hour.
On Thu, May 14, 2015 at 11:48 PM, Neil k8it <k8it at cac.net> wrote:
ok I did all the edits, reloaded asterisk and waited . nothing
Here are my stanza edits . remember this is asterisk v1.2.1
; Play local wx alert, *987
987=localplay,/tmp/wx/alert/MIC077/alert_short
; Play local wx forecast, *988
988=localplay,/tmp/wx/forecast/MIZ072/wx_forecast
Automatically
I also ran the wx_config.sh script
however I do not see a /tmp/wx/alert directory or a /tmp/wx/forecast directories so I am assuming the files are not there so I get nothing
how do I fix this?
does v1.2.1 call these files by a different name and put them somewhere else? like /usr/local/Wx etc........
thanks 73 Neil k8it node 41838
From: Doug Crompton
Sent: Wednesday, May 13, 2015 11:04 AM
To: ARM Allstar
Subject: Re: [arm-allstar] wx script setup
I want to stop the confusion here. The weather script system changed in the Version 1.0 RPi2 release. Don't confuse it with the BBB 1.2.1 which I think is what Neil is using.
In BBB 1.2.1 -
locate wx_config
/usr/local/bin/Weather/wx_config.sh
In RPi2 1.0 -
locate wx_config
/usr/local/bin/wx_config.sh
73 Doug
WA3DSP
http://www.crompton.com/hamradio
------------------------------------------------------------------------------
Date: Wed, 13 May 2015 05:49:13 -0400
From: N1XBM at amsat.org
To: arm-allstar at hamvoip.org
Subject: Re: [arm-allstar] wx script setup
I'm sorry try this instead.
Type this at your root prompt cd /usr/local/bin/
That should out you in the correct directory the type wx_config.sh
What happens?
If it doesnt work, while you're still in /usr/local/bin/ type ls
What is happens?
N1XBM
Apparare Scientor
Paratus Communicare
Allstar Node # 27086, 41540, 41812
_______________________________________________ arm-allstar mailing list arm-allstar at hamvoip.org http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar Visit the BBB web page - http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/
------------------------------------------------------------------------------
_______________________________________________
arm-allstar mailing list
arm-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
Visit the BBB web page - http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/
------------------------------------------------------------------------------
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5941 / Virus Database: 4342/9764 - Release Date: 05/13/15
_______________________________________________
arm-allstar mailing list
arm-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
Visit the BBB web page - http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/
--------------------------------------------------------------------------------
_______________________________________________
arm-allstar mailing list
arm-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
Visit the BBB web page - http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/
--------------------------------------------------------------------------------
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5941 / Virus Database: 4342/9776 - Release Date: 05/14/15
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20150515/63690ee5/attachment-0001.html>
More information about the arm-allstar
mailing list