Hello everyone.
I have a Campbell CR200series Weather Station sending data to the LoggerNet software, and i would like to send my data to the WUndergroung and from it to a web page.
I searched the internet and many foruns regarding this issue and found nothing.
So i ask here if someone can help me.
Ths,
Prof.
* Last updated by: Admin on 9/8/2011 @ 5:35 PM *
Prof,
Do a search for "Wunderground" in this forum. I'm transmitting directly from a CR1000. Not sure you could do it with Loggernet and not sure the CR200 OS has the software required.
IslandMan
* Last updated by: Admin on 9/8/2011 @ 5:36 PM *
I've set up an "Add After" task in the LoggerNet Task Master that executes after each call to a particular station. That task runs a batch file that looks like this:
c:
cd "C:\Program Files\CampbellSci\LoggerNet"
start /w splitr.exe c:\CampbellSci\par\PWSLoganPub.par/r
cd "C:\Program Files\Curl"
start /w curl.exe --trace-ascii "C:\Campbellsci\Batch\CurlTRace.TXT" --get --data @"C:\Campbellsci\DATA\SPLIT\PWSLoganPub.PRN" "http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php"
The line that runs curl.exe is all one line even though it will be wrapped in this post.
The Split (our report generating software that comes with LoggerNet) parameter file (PAR) that I'm feeding to splitr.exe tells splitr.exe to process a data file that contains the just downloaded public variables from a station. I've set LoggerNet up to overwrite the file each time so it will always contain only the most recent record of the public variables from the station (current conditions). A similar parameter file could be created to read just the last line of any data file however. The "Select" (see "Input File(s)" tab of the SplitW interface) line in the parameter file looks like this:
"ID=YourStationID","&PASSWORD=YourPassword","&dateutc=",EDATE("yyyy-mm-dd'+'hh:nn':00'";1;1;1;1),"&winddir=",9,"&windspeedmph=",8*2.236936,"&windgustmph=",29*2.236936,"&windgustdir=",30,"&humidity=",7,"&tempf=",6*1.8+32.0,"&dailyrainin=",36*0.03937,"&baromin=",12*0.03937,"&solarradiation=",10,"&action=updateraw"
The select line simply points to the values I want in the output file, converts them to the units needed by WUnderground, and inserts tags and other text needed by WUnderground into the output file. See PWS Upload Protocol at
http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol
I've also used the "Time Offset" option from the "Offsets/Options" screen on the "Input Files(s)" tab of the SplitW interface to convert output from the EDATE function to UTC from MST. I also made liberal use of the "Decimal" and "Width" column options on the "Output File" tab of the SplitW interface to format the data in the output file. The ouput file looks like this:
ID=YourStationID&PASSWORD=YourPassword&dateutc= 2010-02-12+09:12:00&winddir= 277&windspeedmph= 6&windgustmph= 9&windgustdir= 336&humidity= 97&tempf= 32.7&dailyrainin= 0.03&baromin= 30.18&solarradiation= 44&action=updateraw
and it's all on one line. It's a bit messy with the extra white space but fortunately the white space is ignored by WUnderground.
The output file from splitr.exe is the PWSLoganPub.PRN file that's then transmitted by curl.exe by the batch file. cURL is a publically available command line tool for transferring data with URL syntax (http://curl.haxx.se).
Good luck.
* Last updated by: Admin on 9/8/2011 @ 5:36 PM *