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.

Many of these scripts are now available on GitHub at https://github.com/ktrue

Buy Me A Coffee 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.

Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.

This page was updated Monday, 12-Feb-2024 9:18 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 https://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.
Version 3.00 adds support for the new NWR website at weather.gov. The map now optionally displays transmitter propagation and/or county/SAME code coverage via checkboxes on the map selection menu. The extra overlay maps are only available for NWS/NOAA weather radios. The data is not available for EC/Canada or noaaweatherradio.org stream files.
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.
Streams with 🔒 are provided with SSL (https:) streaming.
Your browser may not support playing non-SSL streams if you are viewing this site with https:// (secure).
These audio streams are graciously provided by personal weather website owners and others through 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 (HTTP Sites only)
//$mapProvider = 'OpenTopo'; // OpenTopoMap.com - no key needed
//$mapProvider = 'Wikimedia'; // Wikimedia map - no key needed
//$mapProvider = 'NatGeo'; // National Geographic Topo map - no key needed

// Get a Mapbox API key at: https://www.mapbox.com/signin/
//$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['WXRmapprovider'] = '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 (http sites only)
= 'OpenTopo'; OpenTopoMap.com - no key needed
= 'Wikimedia'; Wikimedia map - no key needed
= 'NatGeo'; National Geographic Topo 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 [V3.08 - 12-Feb-2024] :
Download for Saratoga Template/Standalone use

V3.07 to V3.08 updated files only:
Download for Saratoga Template/Standalone use

Version history

  • Version 3.08 - 12-Feb-2024 - update NWR-coverage.php V3.05 for improved diagnostics, NWR-radios-data.php V3.01 to fix a save-file issue
  • Version 3.07 - 13-Jul-2023 - fixed SAME code display for same-named counties in adjacent states
  • Version 3.06 - 07-Jul-2023 - update to display covered counties after NWR website changes
  • Version 3.05 - 17-Nov-2020 - added two images to ./ajax-images/ for stream source display
  • Version 3.04 - 15-Sep-2020 - fixed display of SAME codes after NWS changed contents of the {radio}_same.zip shapefiles to remove SAME data
  • Version 3.03 - 28-May-2020 - fixed NWR-coverage.php to use correct JSON file location when run in a Saratoga template ($SITE['cacheFileDir'])
  • Version 3.02 - 26-May-2020 - added shim for includes() function (JavaScript) in IE11, update to $mapProvider possible settings
  • Version 3.01 - 25-May-2020 - added SSL/padlock indicator for SSL/https streams in selector and display
  • Version 3.00 - 08-Dec-2019 - updates for new NWR website at weather.gov. Adds propagation/county SAME code displays on Leaflet map
  • Version 2.02 - 11-Feb-2019 - updated NWR-radios.js V2.02 to use direct https image link to NWR coverage graphic instead of NWR-coverage.php image proxy
  • Version 2.01 - 15-Sep-2018 - updates for HTTPS access to noaaweatherradio.org (NWR-radios-inc.php, NWR-radios-data.php)
  • 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