APRS Digipeatersoftware DIGI_NED
-
Bookmark This site

Telemetry

Input (reading data).

DIGI_NED is capable of transmitting telemetry data with fixed intervals. The telemetry data is transmitted as an APRS type 'T' identifier. With this type of message an APRS station can transmit 5 analog sources and an 8 bit digital source. In DIGI_NED a command "telemetry:" can be added to the startup .ini file. With this command the frequency of the transmission can be specified, the ports where this telemetry has to be send to. Then a list of sources can be supplied, fist the 5 analog sources and as last the digital source. A source can be used multiple times if you want.

There are currently 3 sources:

  • 'off': placeholder, always delivers 999 as value on an analog source or 11111111 when used as digital source.
  • 'lpt: reads the status register of the given lpt port.

This will give the status of the bits 'Busy', 'Ack', 'Paper Empty', 'Select' and 'Error'. The bits represents the logical value on the parallel port's pins. 'Busy' is inverted by hardware, but this is compensated in DIGI_NED. The low order 3 bits of the status register are always set to '0'.

  • 'lpt_8: reads the status register of the given lpt port using multiplexing.

First the 'strobe' output is made logical low and the 4 bits are read from the 'Busy', 'Ack', 'Paper Empty' and 'Select' bits.
These bits represent the lower 4 bits of a byte. Then the 'strobe' output is made logical high and the same 4 bits are read for the high nibble of the byte. When connecting a simple 8 to 4 multiplexer TTL chip you now can easily create an 8 bit input.


The lpt_8 device contains support for multiplexing via the lpt port. When reading the port the port number (which is 0 based and runs from 0 to 5) is put on bits 1, 2 and 3 of the control port. These bits correspond with the "Auto Linefeed", "Initialize Printer" and "Select Printer" outputs of the LPT port.

The association of port numbers put on the 3 bit address lines of the control port can be overruled. For example to completely reverse the numbers, so the first value is read from address 5, the next from 4 etc, you can specify:

telemetry: 20 all lpt2_8/5,lpt2_8/4,lpt2_8/3,lpt2_8/2,lpt2_8/1,lpt2_8/0...
(path truncated to be able to fit the example on 1 line...)

The 3 bit address on the control port can take values 0..7.

For more information about the use of the LPT port see also the web site: http://www.beyondlogic.com/. The LPT inputs are TTL level.

The analog values in the APRS telemetry command are numbered A1..A5, the binary bits are numbered B1..B8.

When using the LPT port as analog source the value read from the LPT status port, or the 8-bit value from the multiplexer, are used put into the analog field as decimal value (0..255).

When using the LPT port as binary source the following mapping is used:

APRS 5 bit input 8 bit input
B lpt lpt_8
B1 pin 11 (Busy) pin 11 (Busy) when pin 1 = '1'
B2 pin 10 (Ack) pin 10 (Ack) when pin 1 = '1'
B3 pin 12 (Paper Out) pin 12 (Paper Out) when pin 1 = '1'
B4 pin 13 (Select In) pin 13 (Select In) when pin 1 = '1'
B5 pin 15 (Error) pin 11 (Busy) when pin 1 = '0'
B6 '0' pin 10 (Ack) when pin 1 = '0'
B7 '0' pin 12 (Paper Out) when pin 1 = '0'
B8 '0' pin 13 (Select In) when pin 1 = '0'

APRS has a method of specifying what all the telemetry information means. This is done by means of an APRS message, which is addressed to the digipeater itself. In this version of DIGI_NED it is just transmitted as a beacon. To use this you have to change the beacon file to have call of your digipeater in it.

If the APRS program you use supports it, it will show the telemetry data with the correct labels and units. It can even do some equations and determine if a '1' bit in a binary value means 'active' or 'inactive'.

With PARM. the 'label' or 'name' of the parameters are specified. Each analog value can have a name and each bit of the binary value too. In the example digi_tlm.ini file for example 'A1' has the name 'Battery' and 'B1' has the name 'Busy'. You could change 'Busy' to 'Lamp' for example.

With UNIT. the unit in which the parameter should be expressed is defined. For Battery the unit is for example 'volt'. If the analog field is for example '12' then this could be displayed as: 'Battery 12 volt' using the information from our example. For binary values the word 'is' can be used for active and 'not' for inactive bit values. Without modification 'B1' could be displayed as: 'Busy is high', but when changing the 'Busy' name to 'Lamp' and unit 'high' to on this would be 'Lamp is on', now it is clear what this bit means!

Now you can also do some simple equations. For each analog value 'x' the equation:

value = a x^2 + b x + c

is used, where 'a', 'b' and 'c' are defined for each port using an EQNS. message. Default are 'a' and 'c' zero and 'b' one, so there is no change to the analog value.

With the EQNS. message this can be changed. For example say the analog value is expressed in tenths of volts for the battery and has a start value of 6 volts. Then you may want to divide the value by 10 before displaying. If you have analog value 60 then you mean that the battery potential is 12 volts. In this case you want to multiply the value by 0.1 (value for 'b') and add 6 volts to the measured value ('c'). 'a' shall stay zero.

To achieve this the values 0,0.1,6 have to be supplied for A1. All 5 analog ports can be specified this way in sequential order.

The last message that gives information is BITS. This one tells when a bit should be regarded as active. The BITS. message has 8 bits. If the first bit is '1' that means that the B1 value is regarded as active when it is logical high. A '0' means that a logical low is active. So if you connect a lamp-on detection to B1, which is low when the lamp is on, then the bit in the BITS. value shall be '0'. Default is BITS.11111111 which means that on all bits a '1' means active. For our inverting lamp detection this should be changed to BITS.01111111. Now a telemetry aware program will say 'lamp is on' when the B1 value is '0' or 'lamp is off' when the B1 value is '1'.

Telemetry is send at the interval specified with the "telemetry:" rule. Now you may want information now, or don't transmit at all. In that case you can query the digipeater with ?TLM. As argument you have to supply which telemetry info you want. This can be A1 to A5 or B1 to B8. To query for example the first digital value you send the query "?TLM B1" to the digipeater. The digipeater will respond with "B1 not high" or "B1 is high" depending on the state of B1.

Now we just specified all these beacons which tells more about the telemetry information, these can be used by DIGI_NED itself too.

When you supply the filename of the beacon file containing the telemetry information to the "tele_info:" rule then DIGI_NED will use this information (PARM., UNIT., EQNS. and BITS.).

When we have put our "lamp" example in the information the "?TLM B1" will return "lamp not on" or "lamp is on". Likewise "?TLM A1" can return for example "Battery 13.5 volt".

These queries are independent of the beacon transmissions. If you only want to query, but do not want any telemetry transmitted you can specify the interval on the "telemetry:" rule as '0'. Then telemetry is never transmitted. You can also stop sending the telemetry information, but still feed the beacon file to the "tele_info:" rule to get the nice responses.

A word of warning: The names you specify in PARM. and UNIT. are limited in space. And the number of characters you may use differs with each label. Therefore to make APRS compliant beacons it is needed to consult the APRS specification on http://www.tapr.org.

Output (writing data)

With Telemetry you can read out analog and digital values. It is also possible to set binary values. For this the up to three LPT devices can be used. Each LPT device supports 8 TTL level outputs, which can be set using an "!OUT" message to the digipeater. These TTL outputs are D0 to D7 (pin 2 to pin 9 on the parallel port).

The !OUT message needs 2 parameters. The first is the LPT port number (1, 2 or 3), the second is the bit-pattern you want to output.

You can specify 1 to 8 bits. Each bit can be '0' to change the bit into logical low, '1' to change the bit to logical high. The value 'x' or '/' can be used to leave a bit unchanged. The allocation is as follows:

!OUT

1

1

0

x

x

x

0

x

1

x

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

+

D7 (pin 9)

changed to "high"

|

|

|

|

|

|

|

|

|

+

-

D6 (pin 8)

changed to "high"

|

|

|

|

|

|

|

|

+

-

-

D5 (pin 7)

not changed

|

|

|

|

|

|

|

+

-

-

-

D4 (pin 6)

changed to "low"

|

|

|

|

|

|

+

-

-

-

-

D3 (pin 5)

not changed

|

|

|

|

|

+

-

-

-

-

-

D2 (pin 4)

not changed

|

|

|

|

+

-

-

-

-

-

-

D1 (pin 3)

changed to "low"

|

|

|

+

-

-

-

-

-

-

-

D0 (pin 2)

changed to "high"

|

+

-

-

-

-

-

-

-

-

-

LPT number

+

------

-

-

-

-

-

-

-

-

-

Command


The '/' character does the same as 'x' and its supported because it is conveniently located below the ASCII '0' which makes it easier for a TH-D7 user.

On the !OUT command you don't have to specify all 8 bits, if you only want to change the output on D0 then you can leave out the specification of all other bits. The bits which are not specified keep their current value.

In response to the "!OUT" command the digipeater will tell if the command was accepted and the resulting pattern on the LPT port. This bit pattern is arranged the same way as the on the !OUT command, so first D0, then D1, D2...D7.

Since this function is experimental, the !OUT command is only accepted from the digipeater owner specified with the "digi_owner:" rule. More owners for a DIGI are allowed, see the sample digi_ned.ini file.

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