APRS Digipeatersoftware DIGI_NED
Bookmark This site

Weather functions

This functionality is used to make all kinds of packets based on telemetry information. Primary reason for creating this function is to build a weather station (with home-made sensors!). All data is retrieved from an LPT port. It uses the same type of multiplexing as the telemetry ports.

The WX functionality is split into two rules. First a definition is made using the 'wx_var' rule. Then the variable is used in a broadcast on air using the 'wx' rule.

The WX_VAR rule

The way it works is with variables (a symbol a..z or A..Z etc), which are associated with a port. They are creates with a "wx_var:" rule. Besides its association with a telemetry port each variable has specific properties. First of all the kind of variable. It can use the raw value but also a maximum or minimum value over an amount of time. It can also sum up differences between measurements to support rain-meters etc. The period is selectable in minutes, up to 32676 minutes timespan.

Secondly the variable has a set of equation parameters. Using the formula "a (x*x) + b x + c" where "x" is the value read from the telemetry port the variable has constants for "a", "b" and "c" to convert the read to the value of the variable.

The variables created this way can be embedded in a string which is send my a new rule called "wx:". You can use different types of formatting to create exactly the output string you want. Say your variable is "v" and has the value 123. The following formatting instructions yield the following output:

"%v" -> formatted to "123" (takes as much space as needed)
"%4v" -> formatted to " 123" (always 4 characters)
"%-4v" -> formatted to "123 " (always 4 characters, left aligned)
"%04v" -> formatted to "0123" (always 4 characters, zero padding)
"%02v" -> formatted to "23" (always 2 characters, truncates the value)
"the value of v=%v" -> "the value of v=123"

There is also a second kind of variables. These do not read data from a telemetry port but are used to display the current date and time. There are a number of formats available, but by truncating the variables during formatting you can create other formats too. Both zulu and local time are supported, note that these only generate correct values when either the timezone information (TZ) is set correctly or the digi_utc_offset: is filled in (DOS only)

The following kind of variables can be created using the "wx_var:" rules:

val -> direct value
max -> max since midnight
min -> min since midnight
sum -> sum since midnight
avg -> average since midnight
max60 -> max over 60 minutes, passed 1 hour
min60 -> min over 60 minutes, passed 1 hour
sum60 -> sum over 60 minutes, passed 1 hour
max120 -> max over 120 minutes, passed 2 hours
min120 -> min over 120 minutes, passed 2 hours
sum1440 -> sum over 1440 minutes, passed 24 hours
avg60 -> average over 60 minutes
dhm -> day, hour, minute value
hms -> hour, minute, second value
ymd -> year, month, day value
ydm -> year, day, month value
dmy -> day, month, year value
mdy -> month, day, year value
mdh -> month, day, hour value
mdhm -> month, day, hour, minute value

When you want to use this functionality some planning is needed. You have to know which values are present on which ports. Then you need to find the equations to calculate the values as they should appear on the output. It is also good to plan which variables you use. Variables van be "a-z", "A-Z" (case sensitive!) and symbols like "#", "$" etc. If you want to include a % sign in the output use \%, the "\" is an escape character. To include a backslash use "\\". Planning of variables is needed to avoid using the same variable twice. If you define a variable twice, only the last one will be evaluated.

To illustrate how it works I created a configuration example below with several equations. The final string is a positionless WX string as described in the APRS specification (You need a copy of this to create a correctly formatted string for WX use). Due to the flexibility use of this WX mechanism is not restricted to weather stations. Use your imaginations, this can couple any data from an LPT port to a beacon transmission. At the end you find a example where periodically the maximum and minimum temeparture is transmitted each hour as a bulletin.

Composing a datagram using the WX variable

Here a example configuration for a WX station using many sensors connected to a multiplexing interface on the LPT port.

When a WX variable is used in "wx:" but is not defined with "wx_var:" the program issues a warning at runtime.

For more information about interfacing to the LPT port look at the DIGI_NED web-site which can be reached via http://www.qsl.net/digi_ned. Also look at the links on this site. There are projects by other hams which can now be supported through this interface.

Sole purpose is to stimulate home made equipment. Building a weather station and connect it to APRS is very rewarding!

Note: don't take a too narrow view! This functionality can also be used to transmit information from direction finders, formatted telemetry data etc, it doesn't have to be WX at all!

Having said this, here is the example of a possible APRS DIGI_NED weather station!

Assume a telemtry module on LPT1 with 8 multiplexed ports

lpt1 port 0:
lpt1 port 1: temperature in centigrade
lpt1 port 2: course in steps of 30 degrees (0 = 0, 1 = 30, 2 = 60 etc)
lpt1 port 3: encounting rainfall value in mm
lpt1 port 4: humidity in steps of 10%
lpt1 port 5: barometric pressure, in hPa offset 900 (100 = 1000 hPa)
lpt1 port 6:
lpt1 port 7: wind speed in beaufort

course from lpt1 port 2, multiply by 30 to get degrees

wx_var: c,val,lpt1_8/2,0,30.0,0

speed from lpt1 port 7, minimum over last min, convert from beaufort to mph aproximation beaufort to knots: 0.3*(x*x)+2.2*x+0 multiply with 0.8689762 to get from knots to mph final formula beaufort to mph: 0.2607*(x*x)+1.9117*x+0

wx_var: s,min1,lpt1_8/7,0.2607,1.9117,0

gust from lpt1 port 7, maximum over 5 min, convert from beaufort to mph

wx_var: g,max5,lpt1_8/7,0.2607,1.9117,0

temperature from lpt1 port 1, convert from centigrade to fahrenheit

wx_var: t,val,lpt1_8/1,0,1.8,32

rainfall last hour from lpt1 port 3, convert from mm to 100rths of inch

wx_var: r,sum60,lpt1_8/3,0,3.937,0

rainfall last 24 hours from lpt1 port 3, convert from mm to 100rths of inch

wx_var: p,sum1440,lpt1_8/3,0,3.937,0

rainfall since midnight from lpt1 port 3, convert from mm to 100rths of inch

wx_var: P,sum,lpt1_8/3,0,3.937,0

humidity from lpt1 port 4, multiply by 10 to get percentage

wx_var: h,val,lpt1_8/4,0,10.0,0

barometric pressure from lpt1 port 5, 10ths of hPA: multiply by 10 add 9000

wx_var: b,val,lpt1_8/5,0,10.0,9000

raw rain counter, convert mm to 100rths of inch

wx_var: #,val,lpt1_8/3,0,3.937,0

time variable type MDHM in zulu time

wx_var: D,mdhm,zulu

Positionless WX string, use in conjunction with a normal position beacon

wx: 5 all APRS,WIDE,WIDE

Example complete WX string (if you use this, shut down the normal beacon, this WX packet will replace that function!):

time variable type DHM in zulu time

wx_var: T,dhm,zulu

wx: 5 all APRS,WIDE,WIDE

Time formats example:

Using wx variables in DIGI_NED it is possible to configure all kind of information frames. One intresing example is the use of time in your broadcasts. Below a number of configuration examples:

Supported formats DHM, HMS, YMD, YDM, DMY, MDY, MDH, MDHM zulu or local time

A number of variables in Zulu time

wx_var: T,dhm,zulu
wx_var: S,hms,zulu
wx_var: Y,ymd,zulu
wx_var: W,ydm,zulu
wx_var: F,dmy,zulu
wx_var: M,mdy,zulu
wx_var: O,mdh,zulu
wx_var: D,mdhm,zulu

A number of variables in Local time

wx_var: U,dhm,local
wx_var: R,hms,local
wx_var: Z,ymd,local
wx_var: X,ydm,local
wx_var: E,dmy,local
wx_var: N,mdy,local
wx_var: Q,mdh,local
wx_var: G,mdhm,local

wx: 5 all WX,WIDE,WIDE
>time: %06Tz (DHM) %06Sz (HMS) %06Yz (YMD) %06Wz (YDM)

wx: 5 all WX,WIDE,WIDE
>time: %06Fz (DMY) %06Mz (MDY) %06Oz (MDH) %08Dz (MDHM)

wx: 5 all WX,WIDE,WIDE
>time: %06Ul (DHM) %06Rl (HMS) %06Zl (YMD) %06Xl (YDM)

wx: 5 all WX,WIDE,WIDE
>time: %06El (DMY) %06Nl (MDY) %06Qz (MDH) %08Gl (MDHM)

By using combinations and restricting the output of a variable other strings can be build... Example:

wx: 5 all WX,WIDE,WIDE
>date: %02Y-%02W-20%02F time: %02O:%02T:%02S zulu

Other broadcasts using WX variable.

In this example we show a special broadcast to be done every hour reporting the last 30 minutes maximum windspeed in Beaufort, and the maximum and minimum temperature over the last 24 hours from the moment it is broadcasted.

; temperature from lpt1 port 5, converted to centigrade
wx_var: T,val,lpt1_8/5,0,0.0989,-8.3419
wx_var: m,min1440,lpt1_8/5,0,0.0989,-8.3419
wx_var: M,max1440,lpt1_8/5,0,0.0989,-8.3419

; Wind maximum over 30 minutes from lpt1 port 6, convert pulses/sec to BF
wx_var: W,max30,lpt1_8/6,-0.0062,0.5361,0.9187

wx_var: Y,dhm,zulu
wx: 61 all DIGI_DEST,WIDE :BLN%1Y :WX @ %04Y: Wind: %2WBF Tmin:%3m'C Tmax:%3M'C

wx 1 all DIGI_DEST,WIDE :BLN%1YWX :1est test te2t test test3test test t4st test

About formatting a bulletin or announcement please read the chapter about the 'send' variable.

powered by cmsimple.dk | cmsimple-styles.com template modified by PE1MEW