Weather Software > Station Software Development

CWOP solar radiation

(1/2) > >>

michaelgalassi:
I'm adding support for CWOP uploads to fwx (https://github.com/michaelgalassi/fwx) and I'm having trouble figuring out how to encode solar radiation.
In chapter 12 (Weather Reports) of the APRS Protocol Reference it states that L = luminosity (in watts per square meter) 999 and below and that l (lower case L) = luminosity (in watts per square meter) 1000 and above.
The temptation is to use the format "L%03d" for L and when the value goes over 999 switch to "L%04d" but this seems somewhat odd to me.
What have others done in this regard?  Does anyone have some valid CWOP packets with solar radiation which they could share with me?

Thank you!

quailvalleywx:
Below is the PHP code I'm using.  It may be derived from a weewx driver - can't remember.  You can look at raw packets for each CWOP station.  Here is the link to mine http://www.findu.com/cgi-bin/raw.cgi?call=FW3280.  More code in my github link in my signature.

Mike.

if ($_GET['solarradiation'] < 1000) {
   $solar = 'L' . sprintf('%03d', round($_GET['solarradiation']));
} elseif ($_GET['solarradiation'] < 2000) {
   $solar = 'l' . sprintf('%03d', round($_GET['solarradiation'] - 1000));
} else {
   $solar = "";
}

galfert:
The APRS protocol was designed to be as concise as possible and not utilize extra characters whenever possible. This is why the method of lower case l was used for solar radiation > 999 w/m2. It was rather ingenious because when reviewing raw data packets the lower case l looks like a 1. So why is all of this odd?

michaelgalassi:
Thank you Mike & galfert, that was the little bit I needed.  The protocol reference's phrasing does not make clear that the lower case L scenario is the excess after 1000 watts/m^2 have been subtracted which is why I was confused.

-michael

michaelgalassi:
I added the code to do that and these are my resulting packets.
http://www.findu.com/cgi-bin/raw.cgi?call=CW3202
Looking at yours (Mike), I notice that you use what looks like free-form text at the end of each packet to provide your weather station model (Ambient Weather...).  I didn't find in the doc any specification for how this might be done.  All the other fields start with a specific character and have a specific length so it is obvious where they start and end.  What would happen if a next version of the APRS protocol defined a field called "A" which takes 2 bytes of data which would match the "A" in Ambient Weather, would this mess things up by injecting the data "mb" into various databases?

Is the protocol reference v1.0.1 dated 29th of August 2000 the most current one?

Sorry about the inane questions.

-michael

Navigation

[0] Message Index

[#] Next page

Go to full version