first commit
This commit is contained in:
Executable
+147
@@ -0,0 +1,147 @@
|
||||
#!/usr/bin/python2
|
||||
#
|
||||
# This is a simple serial programmer for the 818 VHF/UHF modules.
|
||||
# by w0anm
|
||||
# This code was created from examples on the web.
|
||||
#
|
||||
# $Id: 818-prog 12 2014-12-27 18:27:47Z w0anm $
|
||||
|
||||
import time
|
||||
import serial
|
||||
|
||||
# configure the serial connections (the parameters differs on the device
|
||||
# you are connecting to)
|
||||
ser = serial.Serial(
|
||||
port='/dev/ttyS2',
|
||||
baudrate=9600,
|
||||
parity=serial.PARITY_NONE,
|
||||
stopbits=serial.STOPBITS_ONE,
|
||||
bytesize=serial.EIGHTBITS
|
||||
)
|
||||
|
||||
# ser.open()
|
||||
ser.isOpen()
|
||||
print '\r\n\n'
|
||||
print 'Programing DRA818x and SA818x Module \r\n\n'
|
||||
print 'Device name:'
|
||||
print ' ' + ser.portstr # check which port was really used
|
||||
|
||||
key=1
|
||||
while key == 1:
|
||||
print '------------------------------------------------------'
|
||||
Spacing=raw_input('Enter Channel Spacing (0 or 1): ')
|
||||
FreqTx=raw_input('Enter Tx Frequency (xxx.xxxx): ')
|
||||
FreqRx=raw_input('Enter Rx Frequency (xxx.xxxx): ')
|
||||
tx_ctcss=raw_input('Enter Tx ctcss Code Value (xxxx): ')
|
||||
rx_ctcss=raw_input('Enter Rx ctcss Code Value (xxxx): ')
|
||||
squelch=raw_input ('Enter Squelch Value (1-9): ')
|
||||
Volume=raw_input('Enter Volume (0-8): ')
|
||||
PreEmphasis=raw_input('Enable Pre/De-Emphasis (y/[n]): ')
|
||||
if PreEmphasis == "":
|
||||
PreEmphasis="n"
|
||||
|
||||
HighPass=raw_input('Enable High Pass Filter (y/[n]): ')
|
||||
if HighPass == "":
|
||||
HighPass="n"
|
||||
|
||||
LowPass=raw_input('Enable Low Pass Filter (y/[n]): ')
|
||||
if LowPass == "":
|
||||
LowPass="n"
|
||||
|
||||
#
|
||||
print ''
|
||||
print 'Verify:'
|
||||
print '------------------------------------------------------'
|
||||
print ' Channel Spacing: ' + Spacing + ' '
|
||||
print ' Tx Frequency: ' + FreqTx + ' '
|
||||
print ' Rx Frequency: ' + FreqRx + ' '
|
||||
print ' Tx CTCSS code: ' + tx_ctcss + ' '
|
||||
print ' Rx CTCSS code: ' + rx_ctcss + ' '
|
||||
print ' Squelch Value: ' + squelch + ' '
|
||||
print ' Volume Value: ' + Volume + ' '
|
||||
print ' PreEmphasis Enabled: ' + PreEmphasis + ' '
|
||||
print ' High Pass Enabled: ' + HighPass + ' '
|
||||
print ' Low Pass Enabled: ' + LowPass + ' '
|
||||
|
||||
print '------------------------------------------------------'
|
||||
Answer=""
|
||||
Answer=raw_input(' Is this correct ([y]/n, or a to abort) ?')
|
||||
if Answer == "":
|
||||
Answer = "y"
|
||||
|
||||
if Answer == "y":
|
||||
break
|
||||
|
||||
if Answer == "a":
|
||||
exit()
|
||||
|
||||
|
||||
# print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
|
||||
|
||||
# Example of the command:
|
||||
# ser.write("AT+DMOSETGROUP=1,446.0500,446.0500,0020,4,0020\r\n")
|
||||
|
||||
# Set Freq/Group
|
||||
print 'Sending Freq Information...'
|
||||
ser.write("AT+DMOSETGROUP=" + Spacing + "," + FreqTx + "," + FreqRx + "," + tx_ctcss + "," + squelch + "," + rx_ctcss + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETGROUP:1
|
||||
if response == '+DMOSETGROUP:1':
|
||||
print " Error, invalid information (" + response + "). Check input format.."
|
||||
print " Command Sent:"
|
||||
print " AT+DMOSETGROUP=1," + FreqTx + "," + FreqRx + "," + tx_ctcss + "," + squelch + "," + rx_ctcss + "\r\n"
|
||||
exit()
|
||||
|
||||
# Set Volume
|
||||
print "Setting Volume - " + Volume + " "
|
||||
ser.write("AT+DMOSETVOLUME=" + Volume + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETVOLUME:1
|
||||
if response == '+DMOSETVOLUME:1':
|
||||
print " Error, invalid information (" + response + ")..."
|
||||
print " Command Sent:"
|
||||
print " AT+DMOSETVOLUME=" + Volume + "\r\n"
|
||||
exit()
|
||||
|
||||
# Set Filters:
|
||||
# convert filters values, 0 is enable, and 1 is disable
|
||||
if PreEmphasis == "n":
|
||||
PreEmpFilter='1'
|
||||
else:
|
||||
PreEmpFilter='0'
|
||||
|
||||
if HighPass == "n":
|
||||
HPass='1'
|
||||
else:
|
||||
HPass='0'
|
||||
|
||||
if LowPass == "n":
|
||||
LPass='1'
|
||||
else:
|
||||
LPass='0'
|
||||
|
||||
print 'Setting Filters'
|
||||
ser.write("AT+SETFILTER=" + PreEmpFilter + "," + HPass + "," + LPass + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETFILTER:1
|
||||
if response == '+DMOSETFILTER:1':
|
||||
print " Error, invalid information (" + response + ")..."
|
||||
print " Command Sent:"
|
||||
print " AT+SETFILTER=" + PreEmpFilter + "," + HPass + "," + LPass + "\r\n"
|
||||
exit()
|
||||
|
||||
Executable
+152
@@ -0,0 +1,152 @@
|
||||
#!/usr/bin/python2
|
||||
# This is a simple serial programmer for the 818 VHF/UHF modules.
|
||||
# Supported command line interfaces, non-interactive
|
||||
# by w0anm
|
||||
# This code was created from examples on the web.
|
||||
#
|
||||
# $Id: 818cli-prog 12 2014-12-27 18:27:47Z w0anm $
|
||||
|
||||
|
||||
import sys, getopt
|
||||
import time, serial
|
||||
|
||||
def main(argv):
|
||||
mode = '0' # 0 for NFM, 1 for FM
|
||||
group = '446.1687,446.1687,0000,1,0000'
|
||||
volume = '4'
|
||||
filter = '0,0,0'
|
||||
device = '/dev/ttyAMA0'
|
||||
|
||||
try:
|
||||
opts, args = getopt.getopt(argv,"hd:m:g:v:f")
|
||||
except getopt.GetoptError:
|
||||
print '\n818cli-prog [-d <device>] [-m <mode> -g <group> -v <volume> -f <filter>'
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
print '\n818cli-prog [-d <device>] [-m <mode>] -g <group> [-v <volume>] [-f <filter>]'
|
||||
print ' device = serial device, default /dev/ttyUSB0'
|
||||
print ' e.g., -d /dev/ttyUSB0'
|
||||
print ' mode = 0 - 12.5 Khz Ch Space, 1 - 25 Khz Ch Space, default 0'
|
||||
print ' e.g., -m 0'
|
||||
print ' group = <RxFreq>,<TxFreq>,<Rxct>,<Squelch>,<Txct>'
|
||||
print ' <RxFreq> and <TxFreq> format: xxx.xxxx '
|
||||
print ' <Rxct> and <Txct> format:'
|
||||
print ' xxxx (tones) '
|
||||
print ' xxx[N,I] (DTCS) '
|
||||
print ' <Squelch> value is 0-8'
|
||||
print ' e.g., -g 446.0500,446.0500,754N,6,754N '
|
||||
print ' volume = Value is 0-8, default 4'
|
||||
print ' e.g., -v 4 '
|
||||
print ' filter = <pre-emphasis>,<low-pass>,<high-pass>'
|
||||
print ' default is all filters disable (1,1,1)'
|
||||
print ' to enable a filter, use 0 for the value '
|
||||
print ' to disable a filter, use 1 for the value'
|
||||
print ' e.g., -f 0,0,0 (enables all filters) '
|
||||
print ' '
|
||||
print 'Command line example:'
|
||||
print ' 818cli-prog -d /dev/ttyUSB0 -m 0 -g 446.0500,446.0500,754N,6,754N -v 4 -f 0,0,0 '
|
||||
sys.exit()
|
||||
elif opt in ("-d"):
|
||||
device = arg
|
||||
elif opt in ("-g"):
|
||||
group = arg
|
||||
elif opt in ("-m"):
|
||||
mode = arg
|
||||
elif opt in ("-v"):
|
||||
volume = arg
|
||||
elif opt in ("-a"):
|
||||
filter = arg
|
||||
|
||||
############################################################################
|
||||
|
||||
# configure the serial connections (the parameters differs on the device
|
||||
# you are connecting to)
|
||||
ser = serial.Serial(
|
||||
port=device,
|
||||
baudrate=9600,
|
||||
parity=serial.PARITY_NONE,
|
||||
stopbits=serial.STOPBITS_ONE,
|
||||
bytesize=serial.EIGHTBITS
|
||||
)
|
||||
|
||||
# ser.open()
|
||||
ser.isOpen()
|
||||
print '\r\n\n'
|
||||
print 'Programing DRA818x and SA818x Module \r\n\n'
|
||||
print 'Device name:'
|
||||
print ' ' + ser.portstr # check which port was really used
|
||||
|
||||
# Set Connexion
|
||||
print 'Sending Connexion ...'
|
||||
ser.write("AT+DMOCONNECT\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
print (response)
|
||||
|
||||
# Set Freq/Group
|
||||
print 'Sending Freq Information...'
|
||||
ser.write("AT+DMOSETGROUP=" + mode + "," + group + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETGROUP:1
|
||||
if response == '+DMOSETGROUP:1':
|
||||
print " Error, invalid information (" + response + "). Check input format.."
|
||||
print " Command Sent:"
|
||||
print " AT+DMOSETGROUP=" + mode + "," + group + "\r\n"
|
||||
print ' group usage:'
|
||||
print ' <mode> = Channel Space (0 or 1)'
|
||||
print ' <group> = RxFreq,TxFreq,Rxct,Squelch,Txct'
|
||||
print ' Using this format: '
|
||||
print ' xxx.xxxx,yyy.yyyy,rrrr,s,tttt\n'
|
||||
print ' For example:'
|
||||
print ' -g 446.0500,446.0500,754N,6,754N '
|
||||
print ' RxFreq and TxFreq xxx.xxxx '
|
||||
print ' Rxct and Txct format xxxx (tones) '
|
||||
print ' or xxx[N,I] (DTCS) \n '
|
||||
print ' Squelch value range: 0-8'
|
||||
exit()
|
||||
|
||||
# Set Volume
|
||||
print "Setting Volume - " + volume + " "
|
||||
ser.write("AT+DMOSETVOLUME=" + volume + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETVOLUME:1
|
||||
if response == '+DMOSETVOLUME:1':
|
||||
print " Error, invalid information (" + response + ")..."
|
||||
print " Command Sent:"
|
||||
print " AT+DMOSETVOLUME=" + volume + "\r\n"
|
||||
exit()
|
||||
|
||||
print 'Setting Filters'
|
||||
ser.write("AT+SETFILTER=" + filter + "\r\n")
|
||||
time.sleep(1.00)
|
||||
|
||||
#evaluate response
|
||||
raw_serial = ser.readline()
|
||||
response = raw_serial[:-2]
|
||||
|
||||
# Bad response --> +DMOSETFILTER:1
|
||||
if response == '+DMOSETFILTER:1':
|
||||
print " Error, invalid information (" + response + ")..."
|
||||
print " Command Sent:"
|
||||
print " AT+SETFILTER=" + filter + "\r\n"
|
||||
exit()
|
||||
|
||||
print 'Setup Complete'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
|
||||
le programme 818cli-prog , programme la radio sur 432.975 MHZ , CTCSS 71.9Hz , volume a 4 , tous filtres activés . c'est la configuration de base des spotnik Delta.
|
||||
|
||||
|
||||
|
||||
|
||||
This program is written in python2 and is configured to use a FTDI USB to
|
||||
Serial Adapter. I have tested this on Linux systems and the on BeagleBone
|
||||
Black computer.
|
||||
|
||||
For the BealeBone Black, I've included a simple install script that will
|
||||
install any package dependencies.
|
||||
|
||||
There are no variable format checks at this time. When prompted for values,
|
||||
pay close attention to the format of the data. For example:
|
||||
|
||||
|
||||
Frequencies should be entered as XXX.YYYY using the full four digits.
|
||||
CTSS/DCS values should be entered with four digits, 0022 or 0754N. See
|
||||
below for more details.
|
||||
|
||||
|
||||
Standard CTCSS Tones:
|
||||
|
||||
Motorola RELM | Motorola RELM
|
||||
Tone Code Code | Tone Code Code
|
||||
================================================================
|
||||
None None 000 | 167.9 6Z 33
|
||||
67.0 XZ 001 | 173.8 6A 34
|
||||
71.9 XA 002 | 179.9 6B 35
|
||||
74.4 WA 003 | 186.2 7Z 36
|
||||
77.0 XB 004 | 192.8 7A 37
|
||||
79.7 WB 005 | 203.5 M1 38
|
||||
82.5 YZ 006 | 210.7 M2 none
|
||||
85.4 YA 007 | 218.1 M3 none
|
||||
88.5 YB 008 | 225.7 M4 none
|
||||
91.5 ZZ 009 | 233.6 none none
|
||||
94.8 ZA 010 | 241.8 none none
|
||||
97.4 ZB 011 | 250.3 none none
|
||||
100.0 1Z 012 | 69.4 WZ none
|
||||
103.5 1A 013 | 159.8 none none
|
||||
107.2 1B 014 | 165.5 none none
|
||||
110.9 2Z 015 | 171.3 none none
|
||||
114.8 2A 016 | 177.3 none none
|
||||
118.8 2B 017 | 183.5 none none
|
||||
123.0 3Z 018 | 189.9 none none
|
||||
127.3 3A 019 | 196.6 none none
|
||||
131.8 3B 020 | 199.5 none none
|
||||
136.5 4Z 021 | 206.5 8Z none
|
||||
141.3 4A 022 | 229.1 9Z none
|
||||
146.2 4B 023 | 254.1 0Z none
|
||||
151.4 5Z 024 | 150.0 none none
|
||||
156.7 5A 025 |
|
||||
162.2 5B 026 |
|
||||
|
||||
The CTCSS tones should be entered using all for digits, for example CTCCS
|
||||
tone 181.8, should be entered as 0020.
|
||||
|
||||
|
||||
DCS Codes:
|
||||
|
||||
CDCSS or Digital Code Squelch (DCS) is a further development of the continuous
|
||||
tone-coded squelch system or CTCSS that uses a slow-speed, binary data
|
||||
stream passed as sub-audible data along with the transmission. Motorola
|
||||
calls this Digital Private Line or DPL. It consists of a 23-bit telegram
|
||||
sent repeatedly on the channel at 134 bits per second along with the voice
|
||||
transmission. This allows for over 100 possible fleet codes to be used.
|
||||
This gives it an advantage over the CTCSS tones in that there are more
|
||||
possible codes to use; however, it does use more bandwidth and can be
|
||||
affected by voice tones below 300 Hz if not properly filtered by the
|
||||
radio circuitry. Below is a chart of the DCS codes:
|
||||
|
||||
6 50 125 174 255 343 445 526 703
|
||||
7 51 131 205 261 346 446 532 712
|
||||
15 53 132 212 263 351 452 546 723
|
||||
17 54 134 214 265 356 454 565 731
|
||||
21 65 141 223 266 364 455 606 732
|
||||
23 71 143 225 271 365 462 612 734
|
||||
25 72 145 226 274 371 464 624 743
|
||||
26 73 152 243 306 411 465 627 754
|
||||
31 74 155 244 311 412 466 631
|
||||
32 114 156 245 315 413 503 632
|
||||
36 115 162 246 325 423 506 654
|
||||
43 116 165 251 331 431 516 662
|
||||
47 122 172 252 332 432 523 664
|
||||
|
||||
The format needs to be full three digets plus an "N". For example, DCS code 7
|
||||
should be entered as : 007N
|
||||
|
||||
|
||||
|
||||
Inverted Codes
|
||||
|
||||
The format for inverted codes is the same as DCS codes except instead of an "N"
|
||||
you change it to "I". For example, DCS code 7 inverted, would be entered as:
|
||||
007I.
|
||||
|
||||
|
||||
|
||||
$Id: README.txt 3 2014-12-03 01:04:43Z w0anm $
|
||||
|
||||
|
||||
Reference in New Issue
Block a user