Set up older Yaesus with radio configure --model, without asking them
The FT-817, FT-818, FT-857 and FT-897 have no ID command, and take every five bytes they're sent as a command, so radio doesn't probe them: --model sets one up on its only serial port, at the CAT rate it comes with (baud= in radios.conf), or --baud's. Where nothing answered, radio says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4794c186ee
commit
d910982ea7
+60
-1
@@ -397,7 +397,7 @@ teardown() {
|
||||
fake_radio silent
|
||||
run bash "$REPO/radio" probe "$PTY"
|
||||
[ "$status" -eq 1 ]
|
||||
[ "$output" = "Nothing answered on $PTY at 38400 115200 19200 9600 4800 baud" ]
|
||||
[ "${lines[0]}" = "Nothing answered on $PTY at 38400 115200 19200 9600 4800 baud" ]
|
||||
}
|
||||
|
||||
# --- radio configure ---
|
||||
@@ -1711,3 +1711,62 @@ auto() {
|
||||
run bash "$REPO/radio" unconfigure --force
|
||||
[ "$status" -eq 2 ]
|
||||
}
|
||||
|
||||
# --- radios that can't be asked ---
|
||||
|
||||
# An FT-817 on an FTDI CAT cable: one serial port, and no sound card
|
||||
ft817() {
|
||||
usb 1-4 0403:6001 FTDI "FT232R USB UART" A12345
|
||||
port 1-4 ttyUSB0 usb-FTDI_FT232R_USB_UART_A12345-if00-port0
|
||||
stub pgrep 'exit 1'
|
||||
stub systemctl '[ "$*" != "--user is-active --quiet hampack-rigctld" ]'
|
||||
answers ttyUSB0 ""
|
||||
}
|
||||
|
||||
@test "configure --model sets up a radio that can't be asked, without asking it" {
|
||||
ft817
|
||||
: > "$STUB_LOG"
|
||||
run bash "$REPO/radio" configure --model 1020
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${lines[0]}" = "Setting up the Yaesu FT-817 (Hamlib model 1020), on /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A12345-if00-port0 at 4800 baud" ]
|
||||
[ "${lines[1]}" = "It can't be asked what it is, so check it's a Yaesu FT-817, and that its CAT RATE menu says 4800 (or give --baud)." ]
|
||||
! grep -q "TIOCMBIC" "$STUB_LOG"
|
||||
grep -qx "ExecStart=/usr/bin/rigctld -m 1020 -r /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A12345-if00-port0 -s 4800 -T 127.0.0.1 -t 4532" "$HOME/.config/systemd/user/hampack-rigctld.service"
|
||||
grep -qx "name=Yaesu FT-817" "$HAMPACK_STATE/radio"
|
||||
|
||||
run bash "$REPO/radio" configure --model 1022 --baud 38400
|
||||
[ "$status" -eq 0 ]
|
||||
grep -q "^ExecStart=/usr/bin/rigctld -m 1022 .* -s 38400 " "$HOME/.config/systemd/user/hampack-rigctld.service"
|
||||
}
|
||||
|
||||
@test "configure --model --flrig gives flrig a radio that can't be asked" {
|
||||
ft817
|
||||
stub flrig 'exit 0'
|
||||
run bash "$REPO/radio" configure --model 1041 --flrig
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"flrig: controls the FT-818ND on /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A12345-if00-port0 at 4800 baud"* ]]
|
||||
grep -qx "xcvr_name:FT-818ND" "$(FLRIG_PREFS)"
|
||||
}
|
||||
|
||||
@test "configure only takes --baud for a radio that can't be asked, and won't guess its port" {
|
||||
ft817
|
||||
run bash "$REPO/radio" configure --baud 9600
|
||||
[ "$status" -eq 2 ]
|
||||
[[ "$output" == "--baud is for a radio radio can't ask"* ]]
|
||||
run bash "$REPO/radio" configure --model 3073 --baud 9600
|
||||
[ "$status" -eq 2 ]
|
||||
|
||||
port 1-4 ttyUSB1 "" 1
|
||||
run bash "$REPO/radio" configure --model 1020
|
||||
[ "$status" -eq 2 ]
|
||||
[[ "$output" == "The Yaesu FT-817 can't be asked which of ttyUSB0 ttyUSB1 it's on"* ]]
|
||||
}
|
||||
|
||||
@test "says how to set up a radio that can't be asked, when nothing answers" {
|
||||
ft817
|
||||
run bash "$REPO/radio" --probe
|
||||
[[ "$output" == *"An FT-817, FT-818, FT-857 or FT-897 can't be asked what it is: give its Hamlib model, as in \`radio configure --model 1020\`"* ]]
|
||||
run bash "$REPO/radio" probe "$RADIO_DEV/ttyUSB0"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"radio configure --model 1020"* ]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user