Radio Interface
Budget: $250 – $750 USD
I find myself in need of a device that can communicate with a two-way radio that has rs232 input/output for control and display of operating frequency @ 9600 baud, 8 bits, 1 stop and no parity. Simple (16 x 2) display, switches for frequency set.
All messages conform to the NMEA 0183 proprietary message format as follows:
“$”....................Start of message character, ASCII “$” (024h).
“P” ...................Proprietary message identifier.
iii......................Company identifier.
c .......................Message class identifier; Identifies a message as either a COMM or NAV
message.
nn .....................Message identifier, two-digit number in ASCII characters.
d.....d ................Message data characters defined for each message.
Chksum............Message checksum, including message identifier (nn) through data characters (d…..d). The two-digit checksum is generated by adding all values of valid
characters together, ignoring carry (if any). This value is converted into two
encoded hex1 characters (30h-3Fh).
<CR> ...............ASCII carriage return (0Dh).
<LF>................ASCII line feed (0Ah).
Sample frequency selection protocol (sent from RPI to radio):
Message format:
“GRM”.............Company identifier.
“C” ...................Message class.
“16”..................Message identifier.
mk ....................Standby frequency: m = MHz, where m = desired MHz frequency - 30h, ranging from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
a .......................Transceiver function: N = normal, M = monitor, 0 = unchanged.
“0”....................8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
iiii.....................Identifier string. Note that if the identifier string is less than four characters, left justify the string and insert spaces for empty characters. An empty identifier
string (four spaces) is allowed.
f........................Frequency type (see Extended Frequency Type Enumeration).
Example message:
$PGRMC16G>M0KOJC2<chksm><CR><LF>
This example command would set the standby frequency to 119.350 MHz with an identifier of “KOJC ATIS”, and place the radio in Monitor mode. This is interpreted by noting that the ASCII ‘G’ corresponds with 47h, +30h = 77h, converted to decimal equals 119 for the MHz portion. The KHz portion converts ASCII ‘>’ to 3Eh, -30h yields Eh, x25KHz steps = 350 KHz, with no 8.33 KHz channel offset. The identifier string portion is “KOJC” and the frequency type ‘2’ corresponds to “Automated Terminal Information Station” in the extended frequency type enumeration.
Message format (for current radio status to be received by RPI):
“GRM”.............Company identifier.
“C” ...................Message class.
“01”..................Message identifier.
mk ....................Active frequency: m = MHz, where m = desired MHz frequency - 30h, ranging
from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
mk ....................Standby frequency: m = MHz, where m = desired MHz frequency - 30h, ranging from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
a .......................Transceiver status:
I = Intercom (no other status applicable)
R = Normal receive
M = Monitor selected
T = Transmit enable
S = Stuck mic
F = Comm failure
s........................Squelch setting: (ASCII) 0 = automatic; 1 = manual override
hh .....................COM channel spacing: (ASCII) 25 = 25kHz
o .......................Active frequency 8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
o .......................Standby frequency 8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
Example Message:
$PGRMC01G4LFR02500<chksm><CR><LF>
Active frequency is 119.100MHz, the standby frequency is 124.550MHz, unit is receiving, and squelch is automatic.
All messages conform to the NMEA 0183 proprietary message format as follows:
“$”....................Start of message character, ASCII “$” (024h).
“P” ...................Proprietary message identifier.
iii......................Company identifier.
c .......................Message class identifier; Identifies a message as either a COMM or NAV
message.
nn .....................Message identifier, two-digit number in ASCII characters.
d.....d ................Message data characters defined for each message.
Chksum............Message checksum, including message identifier (nn) through data characters (d…..d). The two-digit checksum is generated by adding all values of valid
characters together, ignoring carry (if any). This value is converted into two
encoded hex1 characters (30h-3Fh).
<CR> ...............ASCII carriage return (0Dh).
<LF>................ASCII line feed (0Ah).
Sample frequency selection protocol (sent from RPI to radio):
Message format:
“GRM”.............Company identifier.
“C” ...................Message class.
“16”..................Message identifier.
mk ....................Standby frequency: m = MHz, where m = desired MHz frequency - 30h, ranging from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
a .......................Transceiver function: N = normal, M = monitor, 0 = unchanged.
“0”....................8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
iiii.....................Identifier string. Note that if the identifier string is less than four characters, left justify the string and insert spaces for empty characters. An empty identifier
string (four spaces) is allowed.
f........................Frequency type (see Extended Frequency Type Enumeration).
Example message:
$PGRMC16G>M0KOJC2<chksm><CR><LF>
This example command would set the standby frequency to 119.350 MHz with an identifier of “KOJC ATIS”, and place the radio in Monitor mode. This is interpreted by noting that the ASCII ‘G’ corresponds with 47h, +30h = 77h, converted to decimal equals 119 for the MHz portion. The KHz portion converts ASCII ‘>’ to 3Eh, -30h yields Eh, x25KHz steps = 350 KHz, with no 8.33 KHz channel offset. The identifier string portion is “KOJC” and the frequency type ‘2’ corresponds to “Automated Terminal Information Station” in the extended frequency type enumeration.
Message format (for current radio status to be received by RPI):
“GRM”.............Company identifier.
“C” ...................Message class.
“01”..................Message identifier.
mk ....................Active frequency: m = MHz, where m = desired MHz frequency - 30h, ranging
from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
mk ....................Standby frequency: m = MHz, where m = desired MHz frequency - 30h, ranging from 118 to 136 MHz, (i.e. 76h to 88h, A2h); k = (KHz offset / 25KHz) + 30h,
ranging from 000 to 975KHz in 25 KHz steps.
a .......................Transceiver status:
I = Intercom (no other status applicable)
R = Normal receive
M = Monitor selected
T = Transmit enable
S = Stuck mic
F = Comm failure
s........................Squelch setting: (ASCII) 0 = automatic; 1 = manual override
hh .....................COM channel spacing: (ASCII) 25 = 25kHz
o .......................Active frequency 8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
o .......................Standby frequency 8.33 KHz offset: (ASCII) 0 = 25 KHz frequency (.000)
Example Message:
$PGRMC01G4LFR02500<chksm><CR><LF>
Active frequency is 119.100MHz, the standby frequency is 124.550MHz, unit is receiving, and squelch is automatic.