Display Data on a Web Page with the Weather MicroServer™
Displaying your weather station’s data on the Internet is a great way to disseminate it — whether for general public information or to make it available simultaneously to multiple parties involved in an Incident Response, for example, responders, dispatchers, and commanders.
With Columbia Weather Systems weather stations there are two ways to get the weather data onto a web site – WeatherMaster Software or the Weather MicroServer. This paper gives the procedure for posting weather data to the Internet using the Weather MicroServer. (For information on using WeatherMaster to upload weather data, please refer to the Weather Master User Manual.)
Setting this up is a fairly straightforward two-step process. You need to set up a web page to receive the XML file data and you need to modify the settings in the MicroServer browser interface.
Please note: To display your weather data on a website in this method, your server must support .php files.
Setting up the Web Page
Create a web page that will draw the data from the XML file and present it in formatted text/graphics.
You can see an example below and at: http://www.columbiaweather.com/orionweather_3.php
You can view the HTML code for this page by downloading the tutorial pdf file.
It begins with the following code:
$orionData = readOrionData();
$orionDataUrl = “orion52.xml”;
$orionData = array();
$xml = new SimpleXMLElement($orionDataUrl, 0, true);
foreach ($xml->meas as $meas)
$orionData[(string) $meas[‘name’]] = (string) $meas;
“orion52.xml” is the designated name of the XML file Columbia Weather uploads to our website. You can name your file whatever you want.
To display a parameter value the syntax is: <?php echo $orionData[‘parameter name’];?>
For example, to display wind speed use the following: <?php echo $orionData[‘mtWindSpeed’];?>
XML parameter names are listed in the Weather MicroServer User Manual, Section 3: Operation, under the heading Measurements Definition.
Setting Up the MicroServer
You can set your Weather MicroServer to FTP the XML weather data file to your website automatically. The unit will FTP the file every 15 seconds.
In the MicroServer browser interface, click on Data Output to bring up the screen shown below:
Make sure the FTP Output: is [Enabled].
Enter your FTP URL followed by /filename.xml. You can use any file name you want.
For example: ftp://www.yourURL.com/filename.xml
As another example, ours is: ftp://www.columbiaweather.com/orion52.xml (Recall the filename from the web page.)
Enter your website’s FTP user and password. (If you do not know what it is, contact your website administrator/provider.)
Set the Output Format: to [XML].
Click on the [Apply Changes] button.
At this point an XML file will be uploaded to your website and you should be good to go!Back to top