Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

External Tag files

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
TNETWeather

Re: External Tag files

Post by TNETWeather »

XML FILE....

Had a really cool thought last night.

It has to do with the XML file.

First, I realized that I was creating an RSS feed file, not just a plain XML file. While cool, it is not really what I need right now... I need something less verbose.

So I planned on stripping out the RSS feed stuff and leaving just plain XML..

Dealing with the XML format the way I was doing it however was a real mess. It meant each time I added a new field (was missing some), I had to create the proper format etc... This can be time consuming...

Then, last night it hit me that I could have the file that Cumulus picks up be a script instead of of a plain text file.

In the script, it can have all the tag fields in an array with the tag name, the tag, and a description of what the tag is (handy because it is hard to remember what some of them do).

When the file is parsed by Cumulus and uploaded to the web server, it becomes a multpurpose script since it is really a PHP script.

If you call it without any arguments, it parses the array with the tag info in it and outputs an XML file format that can be used by external scripts.

If you call it with an argument, it instead outputs a description file with the list of all the tag fields, and a description of what they are.

It can also handle the wierd tags that have been giving me problems in the past, like tempunits, lat and long coordinates...

When it parses the output, it can strip the ° from the tempunits, and it can convert the lat and long into the decimal format instead of the degrees format which is more useful for people if they are going to use google maps or something like that. It can make other adjustments as I come across them including providing more fields that Cumulus does not provide like (Moonrise/Moonset), Metar info, links to WXSIM forecasts etc...

This would provide an info tool as well as a way to expand beyond what Cumulus currently supports.

I have a test script setup and running now.

If you call it like: http://cumulus.tnetweather.com/cumulus-xml.php

it outputs an XML file.

If you call it like: http://cumulus.tnetweather.com/cumulus-xml.php?desc

it outputs a description file. You will know when you do this that I've not yet put all the descriptions in yet... I have tried to group the tag fields into reasonable groups though.

I will interface it into the template pages I started last night (added gauges.php this morning).
Last edited by TNETWeather on Wed 24 Sep 2008 6:19 pm, edited 2 times in total.
RockCreekWx
Posts: 24
Joined: Tue 23 Sep 2008 9:50 am
Weather Station: Radio Shack WX-200(OS WM-918)
Location: Rock Creek Reservoir - Wamic, OR USA
Contact:

Re: External Tag files

Post by RockCreekWx »

Hi Kevin ! :)
Nice work on the templates and parsers so far. I'm looking forward to the final distribution. For now, I'm using the templates included with Cumulous. BTW: A very nice program (Cumulous), Steve. 8-)
TNETWeather

Re: External Tag files

Post by TNETWeather »

I've made some minor adjustments to the xml generator script.

1) Separated the data section into a separate file. This makes the file that is parsed smaller and easier to ftp to the web server. File has been named cumulus-xml.dat
2) Created a dynamic script called cumulus-xml.php that reads the above file to output both XML and description info.
3) Enhanced the cumulus-xml.php script when displaying description info to now show the contents of the data as well. Kind of a self-documentating parser.

I've now modified PHP template files to use this new output file to get the data. I also updated the single one page xml generated page to also use the new output file.

Still need to go back and update the description info in the data file...
TgT
Posts: 132
Joined: Thu 26 Jun 2008 5:51 am
Weather Station: Davis VP2 + Solar
Operating System: A20 TV box + CumulusMX
Location: Slov.Konjice, Slovenia
Contact:

Re: External Tag files

Post by TgT »

Wrong link above about Cumulus-XML ;)

http://cumulus.tnetweather.com/cumulus-xml.php?desc
Image
TNETWeather

Re: External Tag files

Post by TNETWeather »

I corrected the link in the posting... thanks.

I finally found a way to kludge the Latitude and Longitude values into something that I can parse.

The cumulus-xml.php script now uses the kludge and adds 4 tags to the list:

So if the original was:

Code: Select all

Latitude = N 33° 24" 09'
Longitude = W 111° 52" 59'
Which contain the decimal, quote and single-quote characters...

The following tags are generated and added to the output.

Decimal Format:

Code: Select all

$latitudeDec = 33.4025
$longitudeDec = -111.88305555556
Degree Format:

Code: Select all

$latitudeDeg = 33deg 24min 09sec
$longitudeDeg = -111deg 52min 59sec
The decimal format uses Negative values for West and South of the Prime Meridian. These coordinates are commonly used for online mapping sites like Google.
TNETWeather

Re: External Tag files

Post by TNETWeather »

XML Generator Script.

Looks like I will be releasing this this weekend... at least a beta version of it.

There are currently 3 parts to it.

1) Data File

This is a file that resides on the workstation with Cumulus software on it that is parsed and uploaded to the webserver (requires PHP5). This data file has all the known tag fields that Cumulus uses in it in an array format that can be parsed easily on the webserver.

2) XML Parser

This is a PHP script that when called performs two functions.

a) by default it parses the data file above and outputs in XML format the fields and data contained within it.

b) if called with a parameter (?desc) it outputs a web page that contains a list of the fields, the data and a description of each of the fields in a table that is both a document and a current data parser.

The XML parser also converts some of the fields into a more useable format and adds both a Lattitude and Longitude Decimal formatted set of fields.

Before out puting any data, the XML parser looks for a third (or more) files called plugins that allow additional data to be collected from various sources... see below...

3) Plugin file(s)

This is a simple PHP script that is called by the XML parser to add new fields to the data set that Cumulus does not already provide.

The current one that I have working adds Moon Rise and Moon Set times for the current day in both a 24 hour and 12 hour format.

I plan on adding a Metar data collector, and some additional weather fields that Cumulus does not currently support like Humidex.

The result is a way to both provide data for external script and to also extend the data beyond what Cumulus currently provides. As Cumulus adds more features, those tags can easily be added and the exported XML file will automatically have them.

The XML file allows for other scripts to be used generate other files and provide exports to other local and remote data services like a WXNOW.txt.
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: External Tag files

Post by steve »

I hope to get some breathing space soon to have a proper look at all this and having a play with it.

I can also then start adding the extra tags that are needed.

Steve
Steve
Post Reply