[Hamlib-developer] rigctld telnet startup delay
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Saku <oh...@sr...> - 2023-01-03 11:50:08
|
Hi ! I return to this subject that I have sent once to Mike @ Jul-2022. There is a problem in rigctld start (delay telnet server to be ready) if rig is powered OFF. ----------------------------------------------------------------------------- Setup here is as follows: Fedora 36, Icom IC7300 connected with USB A/B cable. CI-V Link to [REMOTE] CI-V Baud rate 19200 CI-V Tranceive OFF rigctld --version: rigctl Hamlib 4.6~git Mo Dec 12 05:18:38 2022 +0000 SHA=df8b88 ----------------------------------------------------------------------------- Preface: Cqrlog uses rigctld by sending text commands via telnet (localhost:4532). Most common way is that Cqrlog starts rigctld when it is starting. Cqrlog expects that rigctld will accept connections to localhost:4532 right after it has started that. How ever if rig, here Icom IC7300, is powered off during Cqrlog start (but having power supply ON) rigctld does not open telnet service immediately. If rig is already powered on using power button at rig front face rigctld responses immediately to telnet connect request. ----------------------------------------------------------------------------- Problem: Script to reproduce telnet server startup delay: [saku@hamtpad tmp]$ cat ./tst.sh #!/bin/bash echo "Starting /usr/local/bin/rigctld" echo "parameters: -m 3073 -r /dev/icom7300 -t 4532 -s 19200 -C auto_power_on=0 --vfo &" /usr/local/bin/rigctld -m 3073 -r /dev/icom7300 -t 4532 -s 19200 -C auto_power_on=0 --vfo & SECONDS=0 while [ 1 -gt 0 ] do telnet localhost 4532 echo "Time passed since rigctld was started: "$SECONDS" sec" sleep 1 done ----------------------------------------------------------------------------- *1) Result when IC7300 has power supply ON, but NOT powered by it's Power button:* [saku@hamtpad tmp]$ ./tst.sh Starting /usr/local/bin/rigctld parameters: -m 3073 -r /dev/icom7300 -t 4532 -s 19200 -C auto_power_on=0 --vfo & Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 0 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 1 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 2 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 3 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 4 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 5 sec Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 6 sec Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. *It takes 7 seconds before rigctld's telnet server accepts connections when ic7300 powered OFF* ----------------------------------------------------------------------------- *2) Result when IC7300 has power supply ON, and powered ON by it's Power button:* [saku@hamtpad tmp]$ ./tst.sh Starting /usr/local/bin/rigctld parameters: -m 3073 -r /dev/icom7300 -t 4532 -s 19200 -C auto_power_on=0 --vfo & Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Time passed since rigctld was started: 0 sec Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. *rigctld's telnet server immediately accepts connections when ic7300 powered ON* ----------------------------------------------------------------------------- That is the bottle neck. Rigtcld does not open TCP service immediately. I think it tries to catch rig for some time and after run to timeout (perhaps?) it opens TCP telnet service. That came in to my mind because when *auto_power_on=1 then at the time 2 sec passed rig turns ON but telnet still does not get connected*. So rigctld must be working with rig and has not opend telnet socket yet even rig is already powered on by ci-v command. * * *That means NO command can be sent during 7sec waiting time* because we do not have any telnet connection. It also means that if rigctld is started at same time with the client program (maybe inside from client like Cqrlog do), while rig is powered off, client will fail to get connected to rigctld. *Suggestion:** *** ** *TCP telnet service should open immediately and after that rigctld should start seeking is there a rig with user stated "-m" model and stack commands received via telnet while doing that. * ----------------------------------------------------------------------------- File with debug texts Start_with_rig_power_off_and_vvvvv.txt (over 500 lines) can be found from my Google drive: https://drive.google.com/file/d/1fY5Mbhz5feWkggWTnlqBi9nN6Gvqivdc/view?usp=sharing -- Saku OH1KH |