deformed-offering

Weather station scripts - weather radio player

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

This page was updated Tuesday, 07-Aug-2018 7:57 AM

PHP Scripts (run on webserver)

NOAA/EC All Hazards Radio stream player

 

Both NOAA/NWS and Environment Canada operate many radio transmitters that carry NWS/EC weather and alert information. For many years, the WeatherUnderground website offered a place for weather enthusiasts to stream their local weather radio audio and for others to listen to the streaming audio on their systems. In January, 2017, WeatherUnderground stopped supporting that service, so a small band of enthusiastic volunteers created a new home for those streams at http://noaaweatherradio.org/ as a non-commercial public service. You can follow the story of the creation of noaaweatherradio.org at WXforum.net here and here. My particular thanks go to Mike at Frankfort/Twin Hollies Weather for his continuing work to host, create, and populate the streams for noaaweatherradio.org and to Chris of CrushedBox Software for hosting the stream server.

If you are interested in providing a stream of a NOAA/EC weather radio in your area, please see noaaweatherradio.org website "How To?" page for details to submit an audio stream.

The radios.php script (and the wxradio.php script for the Saratoga template) use the noaaweatherradio.org website data to show a page with the currently available radio streams, and allow the browser's audio player to play them. The scripts use HTML5/JavaScript/CSS with PHP to provide the small amount of customization required. The screen formatting uses jQuery and Bootstrap which is dynamically included in the page.

The original HTML5/JavaScript player page was created by Doug at Chappellweather.com. Mods were made to that script by Bob at Clifton Virginia Weather, Jerry at SE Lincoln Weather and John at Echo Valley Weather. The modifications to use noaaweatherradio.org data to generate the page/map and the packaging was done by Saratoga-weather.org.

The script uses a JavaScript/JSON file maintained on noaaweatherradio.org. To minimize the loading on that site, the NWR-radio-data.php program will fetch and cache locally the needed file and refresh it every hour as need be. The required images are included in the distribution .zip files.

Version 2.00 of the script now uses Leaflet/OpenStreetMaps to generate the location map for the transmitter. You no longer need a Google API key as the map does not use Google Maps for display. If you have a Mapbox.com Access Token, you can display two additional Mapbox maps, but that is optional. Five open (no key) maps are available with the Version 2.00 script.
Major thanks are given to Doug Chappelle for his initial conversion of the V1.x script to Leaflet -- I've just put some finishing touches and packaging on his work. Note also that the Standalone and Template versions are now combined into one distribution with common support code.

Sample output

  NOAA/EC All Hazards Radio

Select Weather Radio Station Below

Station:
Frequency:
Transmitter location:
Stream Provided By:

Radio transmission courtesy of NOAA or Environment Canada.

This Audio Stream Player is not to be used for protection of life or property. Please see below for more details.
These audio streams are graciously provided by personal weather website owners and others though NOAAWEATHERRADIO.org.

Loading Map

LOADING DATA - PLEASE STANDBY

This Audio Stream Player is not to be used for protection of life or property. Please remember that you should NOT rely on this Internet audio to receive watches or warnings. Instead, you should have your own dedicated NOAA or Environment Canada Weather Radio receiver which will alert you 24 hours a day to hazards in your area. This stream player is provided as a convenience and is not an authoritative source for official watches, warnings or advisories -- those should be obtained directly using your own NOAA or EC Weather Radio receiver. Please do not rely on this page as your only source to hear NOAA/EC radio. When you need it most, storms may cause power outages at this end. It is a good idea to mainly rely on a separate NOAA/EC radio with battery back-up.

Note: Due to streaming software delays, this audio may be behind the NOAA/EC radio broadcast.

If you are interested in providing a stream for a NOAA/EC weather radio in your area, please see noaaweatherradio.org website "How To?" page for details to submit an audio stream.

Stream data last updated:

The NOAA/EC Radio player script set was developed by:
Chappelleweather.com with mods by Clifton Virginia Weather, SE Lincoln Weather, and Saratoga-weather.org

Configuration

############################################################################
# wxradio settings
# note: you can also use the following in Settings.php to override the below settings:
/*

$SITE['WXRstartup'] = 'KEC49';   // override $startup in wxradio.php
$SITE['WXRprovider'] = true;     // override $streamprovider in wxradio.php
$SITE['WXRmapprovider'] = 'Esri_WorldTopoMap'; // override $mapProvider in wxradio.php
$SITE['WXRautoplay'] = true;     // override $autoplaystartup in wxradio.php
$SITE['WXRbackground'] = 'lightcyan'; // override $backgroundColor in wxradio.php
// see https://www.w3schools.com/cssref/css_colors.asp for color names
// Optional:
$SITE['mapboxAPIkey'] = '--mapbox-API-key--';  // use this for the API key to MapBox

*/
############################################################################
#
$startup = 'KEC49'; // Radio for first display, if 'alternate' include the -[char] in the name
//                     like 'KEC49-A'.  That value is displayed on the page after Station:
//                     when the station is selected in the dropdown list.
// Note that specific stream calls for alternate streams may change so it's best to use a
//   different search (such as the below) to select a specific stream for initial display.
//
//You can also use the City, provider name or website name to match.
// $startup = 'Monterey Marine';
// $startup = 'saratoga-weather.org';
// $startup = 'mikev';
$streamprovider = false; // =true if you provide a stream, =false if you don't provide a stream
//
$autoplaystartup = true; // =true; start audio when page loads, =false; no autoplay on page load
#
$backgroundColor = 'lightcyan'; // CSS color name or #rrggbb hex format style for overall player
# see https://www.w3schools.com/cssref/css_colors.asp for color names and hex codes
$mapProvider = 'Esri_WorldTopoMap'; // ESRI topo map - no key needed
//$mapProvider = 'OSM';     // OpenStreetMap - no key needed
//$mapProvider = 'Terrain'; // Terrain map by stamen.com - no key needed
//$mapProvider = 'OpenTopo'; // OpenTopoMap.com - no key needed
//mapProvider = 'Wikimedia'; // Wikimedia map - no key needed
//
//$mapProvider = 'MapboxSat';  // Maps by Mapbox.com - API KEY needed in $mapboxAPIkey
//$mapProvider = 'MapboxTer';  // Maps by Mapbox.com - API KEY needed in $mapboxAPIkey

$mapboxAPIkey = '--mapbox-API-key--';  // use this for the Access Token (API key) to MapBox

For Saratoga template users, you normally do not have to customize the wxradio.php script itself as the most common configurable settings are maintained in your Settings.php file. This allows you to just replace the files on your site when new versions are released.

$SITE['WXRstartup'] = 'KEC49';
This setting controls the $startup search string to find the selected radio stream when the page first loads.
It can be the radio callsign or if it is an 'alternate' stream, include the -[char] in the name like 'KEC49-A'. That value is displayed on the page after Station: when the station is selected in the dropdown list.
Note that specific stream calls for alternate streams may change so it's best to use a different search (such as the below) to select a specific stream for initial display. You can also use the City, provider name or website name to match. like
'Monterey Marine', 'saratoga-weather.org', or 'mikev'
$SITE['WXRprovider'] = true;
This setting adds text to the page regarding your site providing one or more streams:
=true; - your site provides one or more NWR/EC streams
=false; - your site does not provide any NWR/EC radio streams.
$SITE['WXRmapboxProvider'] = 'Esri_WorldTopoMap';
This specifies the default map tile provider to be used. The default is:
= 'Esri_WorldTopoMap'; ESRI topo map - no key needed (Default)
= 'OSM'; OpenStreetMap - no key needed
= 'Terrain'; Terrain map by stamen.com - no key needed
= 'OpenTopo'; OpenTopoMap.com - no key needed
= 'Wikimedia'; Wikimedia map - no key needed
= 'MapboxSat'; Satellite Maps by Mapbox.com - Mapbox API KEY needed
= 'MapboxTer'; Terrain Maps by Mapbox.com - Mapbox API KEY needed
$SITE['WXRautoplay'] = true;
This setting controls the behavior of the player when the page is first loaded.
=true; - start playing the audio from the selected stream when the page loads
=false; - play the audio after manual click on 'play' button in player when the page first loads
$SITE['WXRbackground'] = 'lightcyan';
This setting sets the CSS background color of the player content page. You can use either a CSS color name or a #rrggbb hex CSS color for the value. See the list of available CSS color names at w3schools.
$SITE['mapboxAPIkey'] = '--mapbox-API-key--';

If you wish to use the OPTIONAL Mapbox.com tiles (terrain3, Satellite maps), you will need a Mapbox.com API key (called an "Access Token") which can be acquired (for free with 50K accesses usage/month) at:

https://www.mapbox.com/signup/?

This setting is also used by other scripts: wxquake.php (quake-json.php), wxmesonetmap.php (mesonet-map.php) and wxglobal.php (global-map.php).

Downloads

NOAA/EC Radio stream player [V2.00 -06-Aug-2018] :
Download for Saratoga Template/Standalone use

Version history

  • Version 2.00 - 06-Aug-2018 - rewrite of script to use Leaflet/OpenStreetMaps instead of Google Map for display
    Major thanks to Doug Chappelle for his help in the conversion!
  • Version 1.05 - 02-Aug-2017 - updated NWR-radios-data.php V1.01 to use header text/javascript to fix 'nosniff' issue with some websites
  • Version 1.04 - 05-Jul-2017 - corrected attribution (thanks Doug of Chappellweather.com !), added backgroundcolor setting, made all script settings available in Saratoga template Settings.php entries.
  • Version 1.03 - 02-Jul-2017 - added ./ajax-images/ for Inactive, Disabled and Marginal Quality stream indicators
  • Version 1.02 - 01-Jul-2017 - added ./ajax-images/NWR150MARQ.png for Marginal Quality feed indicator
  • Version 1.01 - 29-Jun-2017 - added local bootstrap.3.3.7-mod.min.css to fix wxradio.php Black template issue (gwwilk) and autoplaystartup setting for page-load behavior
  • Version 1.00 - 28-Jun-2017 - Initial release

 

deformed-offering