Allstar® and P25 on Quantar

From W9CR
Jump to navigation Jump to 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.

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.
    • Loose 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. 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.

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.

Example config. Please don't copy this

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 BA4841AF1D3FD327D83F6CF81D4CB 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?

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
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
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 180 0 180
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
Outbnd Analog Lnk Timer 120 Sec
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.

Table 1

17 - Analog Lock
Timer 8 done and not RX Astro ID and not Chan 1
ACTION INACTION
Channel 2