Allstar and P25 on Quantar

From W9CR
Jump to: navigation, search

This is a set of wildcard programing for the Quantar which enables Allstarlink and P25nx linking with mode switching controlled by local traffic. This is possible via some enhanced wildcard programing, and may be applicable for other users using different controllers.

Front of Quantar and controller

Features

  • Support for analog and digital P25 modes with linking
  • Asterisk controller has an audio delay of 10ms to 500ms via ARS digital delay board.
    • ID is done by analog controller in this mode
    • PL is output to controller for it to make the decision if it’s needed to repeat.
    • In COS mode P25 will be detected and no repeated.
  • PL tail on wire line when on controller (chicken burst)
  • When controller unkeys the transmitter stays keyed for 2 second with PL then drops it and stays Keyed for another 5 seconds. This will squelch even the worst baofeng’s receiver.
  • Failsoft mode if the controller fails/asterisk dies
    • Turns on in cabinet repeat and ID on that channel in analog mode (digital still works)
    • Requires PL on receive as defined in the channel.
    • Repeater has 4 alarm beeps on it in this mode.
    • Lose the analog repeater delay.
  • Mode lock which follows local users keyup after 10 seconds, and locks to that mode (blocks the other) for 5.5 minutes.
    • This currently has a brief clip of audio at 10 seconds as it changes channels.
    • A short call (under 10s) will not cause the system to lock
      • This allows for a short call to not lock the system for the full lockout period.
    • Blocks repeat or wireline of opposite mode.
    • If no received signal of given mode, it goes back to mixed mode.
  • Analog mode lock if external input 1 goes low, works on controller and failsoft modes.
    • Blocks P25 repeat
    • Alarm output on station alarm.
  • Raspberry Pi controller running both P25nx and Allstarlink DIAL software.
    • This is behind the cisco 1811 router
    • Nat rules allow the asterisk port open to the outside.

Parts needed

Part Description QTY Price Source
Quantar
Cisco 1841 Router 1 35 eBay
Rack Ears from 1841 1 10 eBay
Cisco Smart Serial Cable PN 72-1430-01 1 10 eBay
Cisco WIC-2A/S 2-Port Interface Card Network Module 1 30 eBay
v.24 board for Quantar 1 30 mike.lussier@gmail.com
25 pair Telco Cable Cat 3 PBX KSU RJ21 AMP connectors Male to Blunt, 5 Ft. 1 7 http://www.ebay.com/itm/122487217154
66 block 1 16.49 http://a.co/cxiEayf
Bridging Clip- 100 Pack 1 15.31 http://a.co/iW0AZf8
ARS Digital Audio Delay board 1 49 http://arsrepeaters.com/Audio_Delay_W462.php
Rasberry Pi 1 40 Amazon
16 GB Sandisk miconSDHC card 1 20 Amazon
1 RU drawer 1 50 http://www.ebay.com/itm/311572552441
RA-35/40 Radio interface 1 65 http://www.masterscommunications.com/products/radio-adapter/ra40.html
6" usb cable " 1 6 http://a.co/3M3OzDb
Heatsinks for Rpi 1 6 http://a.co/72cYxo3
Power supply, 12v to 5v for Rpi 1 8.99 http://a.co/a9f6IsV
Standoffs for RA-35 1 8 http://a.co/aUufBd4
Standoffs for Rpi 4 10 Digikey RPC1080-ND
Logic level converter 3.3 > 5v 1 7.99 http://a.co/j7BayV5
RS232 port for Rpi 1 11.25 http://a.co/76BGWub
NPN small signal 2n2222 eq 1 0.5
SPDT with middle switch 2 10
1k resistor 1 0.05
36 ohm resistor 1 0.05
10k resistor 5 0.05
3v Relay 1 1
Proto board 1 12.95 http://www.ebay.com/itm/322586917307
wirewrap wire
lacing twine
Total 460.63

Assembly Notes

Following the diagram and the pictures install the parts into the drawer.

Drawer layout

I drill two holes and then enlarge them with a nibbler to secure the end of the 25 pair cable by lacing it in place. I'll cut this 5' cable down to 2.5' and set the extra aside for use as hookup-wire later. If you need longer to reach your Quantar, then cut only what you need.

Punch down all the pairs as labeled in the diagram. Note the difference of going by pair vs the 1-50 numbering Motorola uses.

Logic Page 4 - Drawer interconnect

I assemble the "glue board" using the extra hookup wire and tack solder the switches to unused pads. Note the 36 Ohm resistor is to limit current on the relay coil as I'm running junkbox 3v telecom relays at 5v. If you have another relay, feel free to use it. The only requirement is that it can operate continuously. A reed relay would be a nice upgrade.

The GPIO ports are connected to the pads on the RA-35 interface using wire-wrap wire and dressed.

Note I use the heatsinks on the RPi as it does get warm.

The rs232 level converter can be installed in the front of the drawer if you have a DE-9 Greenlee punch. This makes for a clean appearance.

Software

The software used here is the basic asterisk for app_rpt, and the pnxmono software. Pnxmono converts the serial data to multicast and the cisco router had a Dynamic Multipoint VPN (DMVPN) to the rest of the world wide network. Both these programs run on the same RPI.

Cisco router

You need to have the advanced enterprise services image installed to support Serial TUNnel (STUN) and DMVPN.

Network Diagram

Example config. Please don't copy this blindly.

service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname #SET-HOSTNAME-HERE
!
aaa new-model 
!
!
aaa authentication login localauth local
aaa authorization exec default local
aaa accounting delay-start
aaa session-id common
!
clock timezone EST -5 0  $CHANGE THIS
clock summer-time EDT recurring
!
ip dhcp pool RPI
 network 172.31.4.100 255.255.255.252  #Change this to Fa0/1 
 default-router 172.31.12.101 #change this to Fa0/1 interface IP
 dns-server 4.2.2.2 #DNS SERVER
 lease 0 1 
!
!
ip cef
ip multicast-routing 
!
username w9cr privilege 15 secret 5 $1$9lDK$ALihMA.kF88ExXKVmFq7K/
username nx4y privilege 15 secret 5 $1$//au$PLHBB3ZORaUJwm6b8VuWB0
$ADD YOU IN HERE

crypto isakmp policy 1
 authentication pre-share
crypto isakmp key B841AF1D3FD327D83F6CF81D4CB address 0.0.0.0 0.0.0.0
crypto isakmp keepalive 60
!
!
crypto ipsec transform-set trans2 esp-des esp-md5-hmac 
 mode transport
crypto ipsec transform-set NO-CRYPT ah-sha-hmac 
 mode transport
crypto ipsec transform-set VPN-TS esp-aes esp-sha-hmac 
!
crypto ipsec profile vpnprof
 set transform-set NO-CRYPT 
!
stun peer-name 172.31.300.101 #CHANGE THIS TO FA0/1 IP
stun protocol-group 130 basic #change this to your group
!
!
!
interface Loopback0
 ip address 10.2.4.130 255.255.255.255 #what the admins give you
 ip pim sparse-mode
!
interface Tunnel1
 bandwidth 1000
 ip address 172.21.400.130 255.255.240.0 #change this
 no ip redirects
 ip mtu 1400
 ip pim nbma-mode
 ip pim sparse-mode
 ip nhrp authentication p25nx
 ip nhrp map multicast 44.98.249.177 
 ip nhrp map 172.21.1.1 44.98.249.177
 ip nhrp network-id 100001
 ip nhrp holdtime 600
 ip nhrp nhs 172.21.1.1
 ip nhrp server-only
 ip tcp adjust-mss 1350
 ip ospf network broadcast
 ip ospf priority 0
 delay 900
 cdp enable
 tunnel source FastEthernet0/0
 tunnel mode gre multipoint
 tunnel key 100001
 tunnel protection ipsec profile vpnprof shared
!
interface FastEthernet0/0
 description INTERNET
 ip address dhcp  #allow for DHCP, or you can set static.
 ip nat outside
 ip virtual-reassembly in
 duplex auto
 speed auto
 ipv6 address autoconfig default
 ipv6 enable
!
interface FastEthernet0/1
 description TO RPi NETWORK
 ip address 172.31.4567.101 255.255.255.252  # Must match subnet
 ip pim sparse-mode
 ip nat inside
 ip virtual-reassembly in
 ip tcp adjust-mss 1400
 ip igmp query-interval 125
 duplex auto
 speed auto
!
interface Serial0/0/0
 mtu 2104
 no ip address
 encapsulation stun
 clock rate 9600
 stun group 130
 stun route all tcp 172.31.4.102 #change to the IP of the RPi
!
interface Serial0/0/1
 no ip address
 shutdown
 clock rate 125000
!
router ospf 1
 network 10.2.4.130 0.0.0.0 area 0
 network 172.21.4.130 0.0.0.0 area 0
 network 172.31.4.100 0.0.0.3 area 0
! Turn off Crap
no ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip pim bidir-enable
ip pim spt-threshold infinity
ip nat inside source list NAT interface FastEthernet0/0 overload
#update these with your RPi Address.
ip nat inside source static tcp 172.31.4.102 22 interface FastEthernet0/0 45632 
ip nat inside source static tcp 172.31.4.102 222 interface FastEthernet0/0 222
ip nat inside source static tcp 172.31.4.102 8080 interface FastEthernet0/0 8080
ip nat inside source static udp 172.31.4.102 4569 interface FastEthernet0/0 4569
!
ip access-list standard NAT
 permit 172.31.0.0 0.0.255.255
!
ip access-list extended VTY-ACL
! UPDATE THIS.
 permit tcp 192.168.0.0 0.0.255.255 any range 22 telnet
 permit tcp 44.98.0.0 0.0.255.255 any range 22 telnet
 permit tcp 208.38.136.0 0.0.0.255 any range 22 telnet
 permit tcp host 67.78.199.10 any range 22 telnet
 permit tcp 10.0.0.0 0.255.255.255 any range 22 telnet
 permit tcp host 96.254.123.27 any range 22 telnet
 permit tcp 172.16.0.0 0.15.255.255 any range 22 telnet
 deny   ip any any log-input
!
ip radius source-interface FastEthernet0/0 
logging origin-id hostname
logging source-interface FastEthernet0/0
logging 44.98.254.1
!
snmp-server community p25nx RO
!
line con 0
 exec-timeout 0 0
line aux 0
 modem DTR-active
 no exec
 transport input telnet
 transport output none
 stopbits 1
line vty 0 4
 access-class VTY-ACL in  #VTY ACL
 exec-timeout 180 0
 transport input telnet ssh
 escape-character 3
!
scheduler allocate 20000 1000
ntp update-calendar
ntp server pool.ntp.org

Raspberry Pi

The RPI runs a stock DIAL image for asterisk, and should be configured for DHCP to make your life easier. There is a serial port which can be used to boot it in headless mode.

Install and configure the asterisk and enable simple-usb in the modules.conf file as we will be running in non-DSP mode. Why do DSP when the quantar can do the heavy lifting for us?

Simple USB config file

Again, not a complete install guide, just what's needed to get the simple USB interface working.

I typically align everything to -10 dBm for 60% deviation. It will allow you to swap anything with out needing to re-align in the future.

; SimpleUSB configuration
[usb_44233]
eeprom = 1              ; EEPROM installed: 0,1
hdwtype = 0             ; Leave this set to 0 for USB sound fobs modified using
rxboost = 0             ; 0 = 20db attenuator inserted, 1= 20db attenuator removed
carrierfrom = usb        ; no,usb,usbinvert
ctcssfrom = usb         ; no,usb,usbinvert
deemphasis = no         ; enable de-emphasis (input from discriminator)
plfilter = no           ; enable PL filter
; Transmitter parameters
txmixa = voice          ; Left channel output (A): no,voice
txmixb = no             ; Right channel output (B): no,voice
txboost = 0
invertptt = 0           ; Invert PTT 0 = ground to transmit, 1 = open to transmit
preemphasis = 0         ; Perform standard 6db/octave pre-emphasis
duplex = 1              ; Duplex 0,1
gpio1 = out1
gpio2 = in              ; in, out0 = default off or out1 = default on
gpio3 = out1 			; not working.
gpio4 = out1


Install pnxmono software

The pnxmono software needs to be installed and modified as the current software has a couple of severe bugs. The pnxmono software will not filter commands received from the network, so this can cause the Quantar to change channels. The local courtesy tone it uses has a channel change embedded in it as well, so this needs to be disabled. We'll change it to the remote tone which has no such issue.

The commands to get it from github:

  
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian stretch main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete mono-devel
adduser pnxmono --disabled-password 
mkdir -p /opt/pnx-mono
chown pnxmono:pnxmono /opt/pnx-mono
cd /opt/pnx-mono
su -c 'git clone https://github.com/p25nx/pnx-mono.git' pnxmono
cd pnx-mono
mv ctone1.cs ctone1.cs.old
cp ctone2.cs ctone1.cs
<pre>

You'll need to edit the ctone1.cs file to have this rather than ctone2 in it.
<pre>
public static byte[][] cTone1 =

Now build pnxmono

cd /opt/pnx-mono
su -c 'xbuild /p:configuration=Release' pnxmono
cd bin/Release

Now test it:
su -c 'mono pnx-mono.exe' pnxmono

You should hear it announce if you're connected to the Quantar v.24 port. The v.24 light should stop flashing on the front panel of the Quantar too.

The final thing needed to do is setup a service file to have it start this on system boot and when it crashes (and boy does it ever!)

Make a file /lib/systemd/system/pnx.service

[Unit]
Description=P25NX Service
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/opt/pnx-mono/bin/Release/pnx-mono.exe
StandardOutput=null
User=pnxmono
WorkingDirectory=/opt/pnx-mono/bin/Release

# safe_asterisk emulation
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
Alias=pnx.service


Reload systemd and start pnxmono:

systemctl daemon-reload
systemctl restart start

Now you're linked on the air with P25!

Quantar Programing

The Quantar must be programed for several channels correctly, as the wildcard functions cause the system to chanel change depending on state.

Essentially there is a mixed-mode channel and after a period of time, the system will move to an analog only or digital only channel. Once on this mode locked channel the other mode will be locked out on both RF and wireline. This prevents the analog controller from transmitting when on digital and vise-versa.

Information you will need to decide on:

Input needed Default Value Used where? Notes
Callsign-p25 BUTTPLUG-P25/R Chan 1 Callsign used during incabinet p25 repeat on channel 1
Callsign Failsoft mixed mode BUTTPLUG/R Chan 3 Callsign used during incabinet mixed mode repeat on channel 3
Callsign Failsoft Analog BUTTPLUG-ALG/R Callsign used during incabinet analog repeat on channel 5
Callsign interval 5 minutes RF Config Set it to 5 min as you want it to ID before the channel reverts. The ID is also, polite, it will be sent without PL and preempted by activity.
PL tone Transmit 146.2 hz Access Table 1
PL tone receive 146.2 hz Access Table 1
NAC Tx 0x293 Access Table 1
NAC Rx 0x293 Access Table 1
Rx Frequency 447.5 MHz Chan 1:5
Tx Frequency 442.5 MHz Chan 1:5
Tx Idle Frequency 442.425 MHz Chan 1:5 Idle frequency if you want the system to not output a low level carrier on the main tx frequency. Should be clost to the TX channel for fast lockup time
COS hold off/NAC detect time 30 ms Wildcard Table 1 Timer 8, sets the amount of time the station will look to decide if the received signal has a P25 nac on it. If you have p25 activating your COR increase this value. This sets an amout of time a signal is received prior to COR going active, so too long and it will chop the first part of the transmission
Non-PL hang time 5000 ms Wildcard Table 2
RX p25 holdoff - no failsoft 10000 ms Wildcard Table 5 Timer 9, Time p25 is received on channel 2 before switching to channel 1
P25 Lock timer 1- no failsoft 65534 ms Wildcard Table 5 Timer 1, chaned to timers 2:5, this can vary the amount of time P25 is mode locked by up to 65 seconds
RX p25 holdoff - failsoft 10000 ms Wildcard Table 15 Timer 9, Time p25 is received on channel 3 before switching to channel 1
P25 Lock timer 1 - failsoft 65534 ms Wildcard Table 15 Timer 1, chaned to timers 2:5, this can vary the amount of time P25 is mode locked by up to 65 seconds
RX Analog holdoff - no-failsoft 10000 ms Wildcard Table 10 Timer 9, Time analog (irrespective of PL) is received on channel 2 before switching to channel 4
RX Analog Lock timer 1 - no- failsoft 65534 ms Wildcard Table 15 Timer 1, chaned to timers 2:5, this can vary the amount of time Analog is mode locked by up to 65 seconds
RX Analog holdoff - failsoft 10000 ms Wildcard Table 13 Timer 9, Time analog repeat (irrespective of PL) is received on channel 3 before switching to channel 4
RX Analog Lock timer 1 - failsoft 65534 ms Wildcard Table 13 Timer 1, chaned to timers 2:5, this can vary the amount of time Analog Repeat is mode locked by up to 65 seconds
Timer 2 65534 ms Wildcard Table 30 Timer one ends and this starts, applies to all mode locks as it's a chained timer
Timer 3 65534 ms Wildcard Table 7 Timer one ends and this starts, applies to all mode locks as it's a chained timer
Timer 4 65534 ms Wildcard Table 8 Timer one ends and this starts, applies to all mode locks as it's a chained timer
Timer 5 65534 ms Wildcard Table 9 Timer one ends and this starts, applies to all mode locks as it's a chained timer

Channel Data

Channels in the Quantar are used to setup the various repeater modes, and then the wildcard switches channels.

  Channel 1 - P25 repeat, has ID and locked to CAI only
  Channel 2 - Mixed mode, "decision channel" for non-failsoft mode, Analog repeat and ID done by controller.
  Channel 3 - Mixed mode, "decision channel" for failsoft mode, Analog repeat and ID is in cabinet
  Channel 4 - Analog only, Analog repeat and ID done by controller
  Channel 5 - Analog only, Analog repeat and ID is in cabinet
Channel 1 2 3 4 5
Rx1 Frequency 447.500000 447.500000 447.500000 447.500000 447.500000
Tx Frequency 442.500000 442.500000 442.500000 442.500000 442.500000
Tx Idle Freq. 442.425000 442.425000 442.425000 442.425000 442.425000
Modulation Type Astro Cai Analog/Astro Cai Analog/Astro Cai Analog Analog
Tx Rated Deviation 5 5 5 5 5
Receive Channel Bw Wide 25-30 Wide 25-30 Wide 25-30 Wide 25-30 Wide 25-30
Call Sign BUTTPLUG-P25/R BUTTPLUG/R BUTTPLUG-ALG/R
Callsign Over Wl Disabled Disabled Disabled Disabled Disabled
Access Code Table 1 1 1 1 1
Carrier Sql Transition Normal Normal Normal Normal Normal
Analog Rx Activation S=Carrier Sql. Sc=Carrier And Pl/Dpl Sc=Carrier And Pl/Dpl Sc=Carrier And Pl/Dpl Sc=Carrier And Pl/Dpl
Analog Rptr Activation S=Carrier Sql. Off Sc=Carrier And Pl/Dpl Off Sc=Carrier And Pl/Dpl
Analog Rptr Holdin S=Carrier Sql. Off S=Carrier Sql. Off S=Carrier Sql.
Analog Rptr Access None None None None None
Tx Power Out 110 110 110 110 110
Tx Power Out/Battery 55 55 55 55 55
Wireline Tot 0 0 0 0 0
Local Tot 0 0 0 0 0
Rptr Tot 180 180 180 180 180
Mrti Tot 0 0 0 0 0
Alarm Over Air Enabled Enabled Enabled Enabled Enabled
Alarm Tone Over Wl Enabled Enabled Enabled Enabled Enabled
Pre-Emphasis Enabled Enabled Enabled Enabled Enabled
De-Emphasis Enabled Enabled Enabled Enabled Enabled
Hi-Pass Filter Enabled Enabled Enabled Enabled Enabled
Rptr Dod 2 2 2 2 2
Rptr Audio Hold-Off 0 0 0 0 0
Compander Disabled Disabled Disabled Disabled Disabled
Noise Canceller Disabled Disabled Disabled Disabled Disabled
Mrti Operation Disabled Disabled Disabled Disabled Disabled
Rcv Signal Inversion Disabled Disabled Disabled Disabled Disabled
Ptt Priority R>M>D>L>W W>R>M>D>L W>R>M>D>L W>R>M>D>L W>R>M>D>L
Analog Rptr Boost Enabled Enabled Enabled Enabled Enabled

Other Settings

Hardware

Hardware Configuration
Serial Number Buttplug-1
Station Name Bplug-Test
Hardware Platform Quantar
Rx Frequency Band 1 Uhf_R2 438-470
Rx Frequency Band 2 None
PA/Exciter Freq. Band Uhf_R2 438-470
PA Power Rating 110 Watts
Wireline 8-Wire
Wildcard Enhanced
Power Supply Ac High
Battery Type None
Station Type Astro Cai Capable
Intellirepeater Freq None
Frequency Reference Internal - Standard
Simulcast Disabled
Multi-Coded Squelch Disabled
Mrti Interface Disabled
Site Number 1
Scanning Receiver Disabled
Main/Standby Disabled

Wireline

Wireline
Wireline Operation 4 Wire Full Duplex
Remote Control Type Astro
Comparator None
Status Tone Disabled
Wireline Squelch Disabled
Rx Securenet/Astro To Wl Enabled
Equalization Disabled
ASTRO
Astro: Wl Interface V.24 Hybrid
Analog Lnk Chk Disabled
Digital Lnk Chk Enabled
Ext Xmit Clock Enabled
Modem Rx Level 0 To -28 Dbm
Modem Tx Level -14 Dbm
Rt/Rt Config Disabled

Access Code Table

Access Code Table Information
Access Table # 1
Rx Squelch Type Pl
Rx Pl/Dpl Code 4b 146.2 Hz
Tx Squelch Type Pl
Tx Pl/Dpl Code 4b 146.2 Hz
Astro Carrier Squelch Normal
Rx Astro Access Code 293
Tx Astro Access Code 293


RF Configuration

RF Configuration
Repeater Operation Repeater
Max Deviation 100%
Low Speed Deviation 17%
Antenna Relay Disabled
Call Sign Interval 5 Min
Startup Last Active Chan Disabled
Startup Channel 2
Astro Fade Tolerance 3 Frames
Astro Data Repeat Enabled
Wireline Drop out Delay 0 Sec
Astro Tx Filter Narrow Pulse

Wildcard Tables Explained

The following is the logic explained. This should help to explain the theory behind each table.

Here is a basic logic flow of the channel flows and a logical flow through the various states.

I/O, Timers and Flags

Input Active Low Timers Event Flags
1 – Analog Lock 1 – Chain Start 1 - Chan 1 ASTRO with Controller
2 – Failsoft 2 – Chain 2 – Chan 4 Analog with Controller
3 – UNUSED 3 – Chain 3 – Chan 5 Analog no Controller
4 - CH Reset 4 – Chain 4 – Chan 1 Astro no Controller
9 - PTT Contact close 5 – Chain Stop 5 – Hold Off with Controller Chan 4
Outputs Active High 6 - 6 – Hold Off no Controller Chan 5
1 – PL Active 7 - 7 – Hold Off Chan 1
2 – DON’T USE (low) 8 – COS, not ASTRO 8 –
3 - Alarm 9 – Mode Lock Holdoff 9 -
7 - RX COR Relay 10 – PL Hold off on WL 10 –
11 –
12 –
13 -
14 –
15 –
16 -


Carrier Squelch excluding P25

This consists of two tables

1 - COS + Audio
RX Carrier Detect '
Action Inaction
Timer 8 - 30ms Abort Timer 8
Clear Output 7
RX Qual Normal
28 - COR P25 Timer
Timer 8 Done and not RX Astro ID and not Channel 1
Action Inaction
Output 7 Null
RX Qual Force


This must be done this way as trying to combine RX Carried detect and the NAC detect on the same table will not work. As the NAC takes a bit longer to detect, the Carrier will be detected and the of course it will not see the NAC, and then open the squelch. about 20 ms later it will detect the NAC, but the wildcard has been executed and there's no going back.

Instead what is done is we detect carrier and Start timer 8 for 30ms (table 1). Then after 30ms Table 28 is run which checks we're not on channel 1 and not receiving a NAC code. If so it sets Output 7, and then does a force RX qualification. With out this last one, no audio would be output to the wireline. As we are using a PL detect circuit on the controller, if we're in carrier squelch mode we'd keyup the controller, but no audio would pass.

You may vary the Timer 8 value if need be, but keep in mind this is holding off COR until this time expires. Long values can cut off the beginning of a transmission or Pre-MDC


PL drop before carrier on controller

This consists of two tables:

2 - PTT From Wireline
Input 9 and not Channel 1
Action Inaction
TX PL Enable TX PL Disable
Key from WL Timer 10 - 5s
Abort Timer 10
24 - PL Hang Timer
Timer 10 Done ' '
Action Inaction
Dekey from WL Null
PL Enable

This provides a hang timer after the wireline unkeys, where the station will transmit without a PL. This allows even cheap (baofeng) HT's to not hear a squelch tail on the repeater transmitter.

Table 2 is the mapping of Input 9 to PTT from wireline for the station. Upon keydown it will enable the PL, keyup and abort timer 10 if it's running. When it unkeys, the inaction table will disable the PL, and then start timer 10. Timer 10 determines the length of the hang time without PL.

Table 24 will run when Timer 10 is done, and this unkeys the transmitter and then enables the PL.


Timer Chain

This consists of four tables:

30 - Timer 1>2
Timer 1 done
Action Inaction
Timer 2 - 65s Null
30 - Timer 2>3
Timer 2 done
Action Inaction
Timer 3 - 65s Null
30 - Timer 3>4
Timer 3 done
Action Inaction
Timer 4 - 65s Null
30 - Timer 4>5
Timer 4 done
Action Inaction
Timer 5 - 65s Null

This is an easy way to get >65 seconds of timer on the Quantar. What is done is the timer 1 is complete which kicks off 2>3>4>5. Each timer value is set and should be reset 1:5 when used for counting.

Event Flags are used to enable multiple uses of the chained timer as there are only 10 timers available on the wildcard.

Reset logic

As the wildcard cannot execute code unless an interrupt happens, this presents problems when coming out of reset. Good news is we're able to code if we're out of reset, either warm or cold. Due to the limits we need to have four tables

19 - Reset and not Failsoft
Warm Reset or Cold Reset and not Input 2
Action Inaction
Channel 2 Null
Abort Timer 1:5 Null
Clear Flag 1:7 Null

This table setups the default mode out of reset when the controller is good. Further it resets any event flags or timers in the event any are active (they shoudn't be from reset, but it's one of the bugs I've seen).

20 - Warm reset with controller and analog lock
Warm Reset and Input 1 and not Input 2
Action Inaction
Channel 4 Null
Abort Timer 1:5 Null
Clear Flag 1:7 Null
21 - Cold reset with controller and analog lock
Cold Reset and Input 1 and not Input 2
Action Inaction
Channel 4 Null
Abort Timer 1:5 Null
Clear Flag 1:7 Null

These two set us to channel 4 when the controller is good and the analog lock is enabled either from the switch or app_rpt.

22 - Warm reset Failsoft and analog lock
Warm Reset and Input 1 and Input 2
Action Inaction
Channel 5 Null
Abort Timer 1:5 Null
Clear Flag 1:7 Null
RX PL Enable
Alarm Tone 4 Alarm Tone Off 4
23 - Cold reset Failsoft and analog lock
Cold Reset and Input 1 and Input 2
Action Inaction
Channel 5 Null
Abort Timer 1:5 Null
Clear Flag 1:7 Null
RX PL Enable
Alarm Tone 4 Alarm Tone Off 4

These two setup the failsoft analog lock mode. This will select channel 5 which is configured for in cabinet repeat with PL. This would need to be activated via the switch on the glue board as the controller would be offline. An alarm tone will be generated letting the users know the analog controller is offline.

Analog lock

This causes the system to lock to analog mode when input 1 goes to ground. This is tied into GPIO of the RA-35 interface on GPIO 1 and to a manual switch on the glue board.

17 - Analog lock with controller
Input 1 and not Input 2
Action Inaction
Channel 4 Channel 2
Abort Timer 1:5
Abort Timer 9
Clear Flag 1:7 Null

If input 1 goes low (active), and input 2 is off (high), the controller is good, but go into analog lock channel 4 under controller. Abort any active timers and clear any event flags, as this could cause another channel change to happen if not stopped.

18 - Analog lock Failsafe
Input 1 and Input 2
Action Inaction
Channel 5 Channel 3
Abort Timer 1:5
Abort Timer 9
Clear Flag 1:7 Null
RX PL Enable
Alarm Tone 4 Alarm Tone Off 4

If input 1 goes low (active), and input 2 is low (active), the controller has failed. Go to channel 5 analog only, in cabinet repeat. As this is in failsoft mode an alarm tone will be generated. Abort any active timers and clear any event flags, as this could cause another channel change to happen if not stopped.

P25 receive non-failsoft mode

Now things get a bit more interesting. This is used if the analog controller is good. By default the system will be on decision channel 2, table 5 will run and if a local keydown is >10 seconds, table 27 will change the P25 only channel 1. When it unkeys the timer chain will start and then table 6 will change back to the decision channel. Flags are used to multiplex timer chain 1:5 and timer 9.

5 - RX P25 and No-Failsoft
RX Astro ID and not Input 2
Action Inaction
Timer 9 - 10s Timer 1 - 65s
Abort Timer 1:5 Abort Timer 9
Set Flag 1 Clear Flag 7
Set Flag 7

This will listen for a NAC and if not input 2 (failsoft), will start a 10 second timer (9) which is handled by table 27 due to setting flag 7. Flag 1 is set which enables table 6 to action off of the timer chain. The mode lock timer chain is aborted when this is met as well, aborting any which may be in progress, keeping the timers from starting until a local p25 user unkeys.

When a p25 user unkeys, the mode lock timer chain is started via timer 1, and timer 9 is aborted. The abort for timer 9 is important as a short keydown would start it, but not clear it, thus still causing a channel change.


27 - P25 Lock Hold off
Timer 9 done and Flag 7 and not Input 1
Action Inaction
Chan 1 Null
Clear Flag 7

When the Timer 9 (hold off timer) is done and flag 7 and not in analog lock mode (input 1), this will change to channel 1 and clear flag 7. The station will no be locked on a digital only channel.

6 - Timer P25 non-failsoft
Timer 5 done and Flag 1
Action Inaction
Chan 2 Null
Clear Flag 1

When the timer chain stops and the event flag 1 (set by table 5), the system will change back to the mixed mode channel 2, and clear flag 1.

P25 receive failsoft mode

If the analog controller is failed this is used. By default the system will be on decision channel 3, table 155 will run and if a local keydown is >10 seconds, table 27 will change the P25 only channel 1. When it unkeys the timer chain will start and then table 16 will change back to the decision channel 3. Flags are used to multiplex timer chain 1:5 and timer 9.

5 - RX P25 and Failsoft
RX Astro ID and Input 2
Action Inaction
Timer 9 - 10s Timer 1 - 65s
Abort Timer 1:5 Abort Timer 9
Set Flag 4 Null
Set Flag 7 Clear Flag 7

This will listen for a NAC and if input 2 (failsoft), will start a 10 second timer (9) which is handled by table 27 due to setting flag 7. Flag 4 is set which enables table 16 to action off of the timer chain. The mode lock timer chain is aborted when this is met as well, aborting any which may be in progress, keeping the timers from starting until a local p25 user unkeys.

When a p25 user unkeys, the mode lock timer chain is started via timer 1, and timer 9 is aborted. The abort for timer 9 is important as a short keydown would start it, but not clear it, thus still causing a channel change.


27 - P25 Lock Hold off
Timer 9 done and Flag 7 and not Input 1
Action Inaction
Chan 1 Null
Clear Flag 7

When the Timer 9 (hold off timer) is done and flag 7 and not in analog lock mode (input 1), this will change to channel 1 and clear flag 7. The station will no be locked on a digital only channel.

16 - Timer P25 Failsoft
Timer 5 done and Flag 4
Action Inaction
Chan 3 Null
Clear Flag 4

When the timer chain stops and the event flag 4 (set by table 15), the system will change back to the mixed mode channel 3, and clear flag 4.

Analog receive non-failsoft mode

If the analog controller is good this is used.

By default the system will be on decision channel 2, table 10 will run and if a local keydown is >10 seconds, table 25 will change the Analog only channel 4. When it unkeys the timer chain will start and then table 11 will change back to the decision channel 2. Flags are used to multiplex timer chain 1:5 and timer 9.

10 - RX Analog and No Failsoft
RX Analog and not Input 1 and not Input 2
Action Inaction
Timer 9 - 10s Timer 1 - 65s
Abort Timer 1:5 Abort Timer 9
Clear Flag 2 Set Flag 2
Set Flag 5 Clear Flag 5

This will listen for an analog user and if not input 2 (controller good), will start a 10 second timer (9) which is handled by table 25 due to setting flag 5. Flag 2 is set which enables table 11 to action off of the timer chain. The mode lock timer chain is aborted when this is met as well, aborting any which may be in progress, keeping the timers from starting until a local analog user unkeys.

When an analog user unkeys, the mode lock timer chain is started via timer 1, flag 2 is set, and timer 9 is aborted. The abort for timer 9 is important as a short keydown would start it, but not clear it, thus still causing a channel change.


25 - Analog Ch4 Hold Off
Timer 9 done and Flag 5 and not Input 1
Action Inaction
Chan 4 Null
Clear Flag 5

When the Timer 9 (hold off timer) is done and flag 5 and not in analog lock mode (input 1), this will change to channel 4 and clear flag 5. The station will now be locked on an analog only non-repeat channel under external control.

11 - Timer Analog and no Failsoft
Timer 5 done and Flag 2
Action Inaction
Chan 2 Null
Clear Flag 2

When the timer chain stops and the event flag 2 (set by table 10), the system will change back to the mixed mode channel 2, and clear flag 2.

Analog Receive Failsoft Mode

If the analog controller is bad this is used.

By default the system will be on decision channel 3, table 13 will run and if a local keydown is >10 seconds, table 26 will change the Analog only channel 5. When it unkeys the timer chain will start and then table 14 will change back to the decision channel 3. Flags are used to multiplex timer chain 1:5 and timer 9.

13 - RX Analog and Failsoft
Rptr Qual Met and Input 1 and not Cur Chan 1
Action Inaction
Timer 9 - 10s Timer 1 - 65s
Abort Timer 1:5 Abort Timer 9
Clear Flag 3 Set Flag 3
Set Flag 6 Clear Flag 6

This listens for the analog repeater to go active, and Input 2 (failsoft) and not currently channel 1 (p25 only). As channel the system will be on decision channel 3 to start this, analog repeater is enabled. RX analog cannot be used due the COS which sets "RX Qual", the system would lock as soon as it saw a carrier and not squelch. Further this will not work if on the p25 channel 1, as the p25 channel would repeat data as well.

After this it will start a 10 second timer (9) which is handled by table 26 due to setting flag 6. The mode lock timer chain is aborted when this is met as well, aborting any which may be in progress, keeping the timers from starting until a local analog user unkeys.

When an analog user unkeys, the mode lock timer chain is started via timer 1, flag 3 is set, and timer 9 is aborted. Flag 3 enables table 14 to action off of the timer chain. The abort for timer 9 is important as a short keydown would start it, but not clear it, thus still causing a channel change.


26 - Analog Ch5 Hold Off
Timer 9 done and Flag 6 and not Input 1
Action Inaction
Chan 5 Null
Clear Flag 6

When the Timer 9 (hold off timer) is done and flag 6 and not in analog lock mode (input 1), this will change to channel 5 and clear flag 6. The station will now be locked on an analog only repeat channel with ID and Time out timer.

14 - Timer Analog and Failsoft
Timer 5 done and Flag 3 and not Input 1
Action Inaction
Chan 3 Null
Clear Flag 3

When the timer chain stops and the event flag 3 (set by table 13), the system will change back to the mixed mode channel 3, and clear flag 3.


Analog Failsoft Mode but not Analog lock

If the analog controller is bad this is used.

This will move the system to Channel 3 for mixed mode failsoft in the event the controller dies. This will generate an alarm tone on the channel.

12 - Failsoft
Input 2 and not Input 1
Action Inaction
Chan 3 Chan 2
RX PL enable Null
Abort Timer 1:5
Abort Timer 9
Clear Flag 1:7
Alarm Tone 4 Alarm Tone Off 4

Channel 2 from Asterisk

This table will select channel 2 when active. With pnxmono it's possible for data to come from the network and change the channel of a quantar via v.24 commands. What's really needed is a way to filter this in the pnxmono software. Typically I find this happens with packet loss or looping, causing a channel select command to channel 4.

A cop command can be used to toggle this pin and shift to mixed mode again.

29 - Chan 2 from Controller
Input 4
Action Inaction
Chan 2 Null

Originally there was "and not Input 2 and not input 1" as well, but this exposed an interesting bug/feature in the wildcard function. This caused the failsoft wildcard to be evaluated after the hold off timer switched to channel 1/4/5. As soon as it was run, the system changed back to the decision channel.

Downside is possibly the controller could be used to override the analog lock feature. This might be a plus, as as it would enable a way to override the switch.

Operational Notes

Currently when asterisk is stopped on the host, the GPIO lines go active. This seams like it should be a software fix in the usb driver. Of course if the device is disconnected physically it works fine.

In non-pl mode on analog lock (or post decision channel) the system will repeat p25 data. This is due to fact the channel must be set to analog to block out the Astro wireline. Some IPC between the pnx and asterisk could fix this.

Further when on a analog channel after the initial 10 seconds, a P25 user will cause the analog lock timers to reset. This is true even if in PL mode. In PL mode it will not be repeated, but it will cause the timer to be reset to another 5 min.

When aligning the station you will not be able to set the squelch unless you remove the pertinent wildcard configs. It's best to make a tuning only table for tuning and then reprogram it after it's tuned.

Files

11x17 PDF document of diagrams and logic

Working codeplug showing this example