app_rpt COS and PTT through Parallel Port

This skinny direction set is only for the ACID distribution of app_rpt. (may be valid for other distros ?)

Using the Parallel port for radio COS / PTT is the cheapest and easiest route to go unless you want to hack-up a USB sound dongle that we will not talk about here. If you wish to do that see this link / PDF.

When using parallel port pins for any logic connections most especially experimental ones, I always suggest using something to buffer the lines in the printer/parallel port so that you do not do more damage than to just the port of your PC if higher voltage gets to one of the pins.

Parallel Port Breakout card with Opto-Coupled Transisters on output.

Parallel Port Breakout card with Opto-Coupled Transisters on output.

When I had built a DOS box repeater in the 90’s, I used a opto-coupled transistors to isolate the pins. Now-A-Days you can save yourself a bunch of time and money by buying parallel port cards already made with opto-couplers for cnc driving/controlling on eBay for $30 or less. They even have screw terminals for easy wiring ! The benefit I had back then is I could change the Parallel port card if I damaged it. Now they are built-in. Easy to damage more than just the port.

Just some “experience” talking here. And you know our moto definition of that word ( or see our home page )





First, you need to include a line like this for your  node in RPT.CONF :

iobase = 0x378      ; Parallel port address (using for cor/ptt & switches +dh-rbi )

The address is the parallel port address in hex. Normally 378, 278, 3bc are common addresses for the 1st, 2nd and 3rd ports.

OH… for those that do not know…

PTT is for “push to talk”. A TX line that normally goes to ground when active but not all are like this.

COS/COR is “carrier operated signal” or “carrier operated relay”. The logic on this line varies widely depending on where you can get the signal in the receiver. If your radio has a “s-meter”, that would be a good area to find a appropriate signal.

A short description of the pins we use on a parallel port.

We have:

8 data output lines starting with pin 2 as output 1 (pp1) to pin 9 as output 8 (pp8). These can be used for PTT on multiple nodes as defined in usbradio.conf . I would suggest starting from Output 8 (pin 9 / pp9) and work backwards to reserve the first three for a DH-RBI-1 or future devices. You can also use these to control other devices using relays (out of scope with this page).

5 data input lines  Pins 10,11,12,13 & 15 can be used for COS detections across multiple nodes. You can also use these from other sensors to trigger events in software (off topic, not going there in this page).

Changing the logic in/out with the software:

Parallel Port pins are defined in app_rpt software as “pp1”, “pp2”, “pp3″…etc

Setting them in USBRADIO.CONF


; carrierfrom=no      ;  available options for COS/COR type – Uncomment what’s needed.
; carrierfrom=dsp              ; use a valid signal decoded in DSP (internal)
; carrierfrom=pp                ; states we use pp for COS w/normal logic
carrierfrom=ppinvert     ; this option inverts the logic for cor on the chosen pp
; carrierfrom=usb              ; for hacking usb dongle method
; carrierfrom=usbinvert  ; same as above but inverted
; carrierfrom=vox              ; use vox for COS ( useful for a HF remote base )


txtoctype=notone    ; Transmit tone control type: no,phase,notone
; no – CTCSS tone encoding with no hang time
; phase – encode CTCSS and reverse phase  AKA (“reverse burst”) before unkeying TX
; notone – encode CTCSS and stop sending tone before unkeying TX  AKA (“chicken burst”)

plfilter=yes      ; Filter PL tones/don’t pass to transmitter

invertptt=0     ; use this to invert the normal logic state of the line

#includeifexists custom/usbradio.conf

Some important notes:

The example above is a no-tone with carrier signal (COS) inverted. A simple set-up.

If you lack the ability to set-up a COS circuit, your best option is to set cos as tone/dsp and use that tone to signal a active receiver. Yes that makes your machine a PL’d repeater that you can not turn off the tone. But perhaps it will get you up and running for now.

You may need to invert the logic of pins manually with hardware/transistor to prevent transmitter “key-up” while booting your asterisk machine or it is powered off in certain circumstances where that initial transmitter hang would be disruptive until you get it turned on or booted.

As parallel port outputs (from PC) will only sink about 150 -250 ma of current and about 250-450 ma if you are using the opto-coupled board, you may need to use the line to toggle a external transistor or relay to achieve higher currents to switch the PTT or other devices. If in doubt, use a low current fast relay or transistor to buffer the signal. Save your port and/or machine.

EchoLink Configuration for app_rpt

As with all our “skinny” guides on app_rpt, we speak only of the ACID distribution.

In your /etc/asterisk directory you will find a echolink.conf file.

This is the only file you need to edit for a working system to enable echolink connections via one of your allstar defined (or private defined) nodes. You “can” configure this to a node that is not your repeater node. When you want echolink connectivity, just connect your node to it or use a startup macro to maintain it from startup. The reason one might want to do it this way is that you will have the ability to disconnect from echolink connectivity. It can be desirable in some situations. You can not disconnect it from the assigned node.

File contents:

[el0]                                                  ; echolink definition 1 (computer logic 0=1)
confmode=yes                             ; enable conference mode yes or no – allows multi-connections
call=YOURelCALL-r                  ; Your echolink callsign, include the -r or -l or/as per your setup
pwd=YOURelPASSWORD      ; your echolink password
name=Mike                                    ; your firstname or club name
qth=City,State   ; your listed email as per echolink setup
maxstns=20                                 ; max connections on this port
node=804396                               ; your echolink ode number
recfile=/tmp/recorded.gsm   ;  file and location to record audio
astnode=50444                           ; your allstar node number to attach echolink to
context=radio-secure               ; context of asterisk connection

freq=147.210                               ; not mandatory
tone=114.8                                    ; not mandatory CTCSS Tone (0 for none)

lat=0                     ; lat & long (profile) of site – not mandatory but suguested
power=0 ; 0=0W, 1=1W, 2=4W, 3=9W, 4=16W, 5=25W, 6=36W, 7=49W, 8=64W, 9=81W (Power in Watts)

height=0 ;0=10 1=20 2=40 3=80 4=160 5=320 6=640 7=1280 8=2560 9=5120 AMSL in Feet

gain=0 ; Gain in db (0-9)
dir=0 ; 0=omni 1=45deg 2=90deg 3=135deg 4=180deg 5=225deg 6=270deg 7=315deg 8=360deg             ; you have 3 defined servers of 6 or more         ; use what works for you.          ; sometimes, some servers not working


deny=a1ass  ; deny access to station(s) –  state one line at a time:  deny = callsign


You do have a echolink audio gain control in rpt.conf file if/as needed.

You can have a second echolink definition [el1] and more but keep in mind that echolink will only allow one echonode per IP address ( could change someday).

app_rpt Macro and Scheduler

First I should lightly define this for those that do not understand.

A MACRO is a single or multiple set of commands to be executed by a single simple command.

You could use it to have a user command that executes a string of commands making the entire function easy to preform for any user. An example would be to make several link connections with just a 4 digit macro command. It is all about what you put in the MACRO.

To my knowledge, you can not make a macro do anything you could not do with a command directly because you are entering actual commands to be executed. Need more… You can  execute a system/asterisk command line that would make just about anything possible within a script file but it has to be defines as a command first. Use your macro to call that command

Set-up for these are in rpt.conf

They are programed in this fashion,

A number for the macro (will be the executing command #)

A equals sign =

each command as you might issue to it from the keypad but separated by a space

after the last command in the string, end with a pound sign # (space#)

The format looks like this for a macro number of 10:

10=*81 *229285 #

So if you were to enter *5 10 ,  it would execute macro 10 (*5 is the command to execute a macro and the 10 is the macro we are executing). Our example here macro 10- plays the time (*81) and then makes a link connection for monitor (*2) on node (29285)

This can be a powerful way to make complex functions work in a simple way. Use your imagination and you can dream up some pretty snazzy stuff.

What makes this even more powerful, The scheduler.

The scheduler allows you to automatically “EXECUTE A MACRO” at a given time of day and/or date. A macro is the only thing the scheduler can execute. So if you want to automate, start with the macro.

Here is the format (like system cron for those familiar with linux)

First item in the string is the macro number we are going to execute at the chosen time. It must be a macro number you have defined in MACROS

After the macro number, a equal sign, then the time of execution in this format.

Minutes, Hour, DayofTheMonth, Month, DayOfTheWeek (seperated by a space) and use a STAR “*” for a wildcard, meaning it could match anything in that position.


10=00 * * * *

This will execute macro 10 on the top of the hour (at 00 minutes of any hour , any day of the month, any month, any day of the week)

1=05 * * * 0

This will execute “macro 1” at 5 minutes into any/every hour but only on Sunday (0=sunday 6=saturday…    computer logic numbers)

2=30 12 * * * ; execute macro 2 at 12:30 everyday

3=15 18 25 12 * ; execute macro 3 at 6:15pm christmas day

Remember you must “specify all 5 time parameters”. If it does not matter, it is a * -wildcard or it might not work.

Be certain to think your scheduler and macros through. Understand the implications of what you are doing. Test the macros out for functionality before setting them on a schedule (*5xx).

Handy functions for this are things like the hourly time announcement, disconnecting links after late hours, playing voice announcements, disabling functions for late at night and turning them back on in daytime. etc.