Skip to content

Conversation

@mdblack98
Copy link
Contributor

strncpy can produce "truncated" warnings and can be easily replaced by memcpy and ensuring the string is null terminated.

@KaComet
Copy link
Contributor

KaComet commented Nov 6, 2022

Testing with an IC-9700 connected via USB and hamlib --version (rigctl Hamlib 4.6~git Fri Nov 04 18:26:52 2022 +0000 SHA=bf22bc) yields the following results.

For all tests the below two rigctrl commands were used. This allows for the --vfo option and non-vfo options to be evaluated.
rigctld -m 3081 -s 115200 -r /dev/icom-9700-a -vvv
rigctld -m 3081 -s 115200 -r /dev/icom-9700-a -vvv --vfo

RX only radio mode:
Works as intended with both the --vfo and non-vfo options.

TX only radio mode:

  • Works as intended with both the --vfo and non-vfo options.

Full Duplex radio mode non-vfo option: (rigctld -m 3081 -s 115200 -r /dev/icom-9700-a -vvv)

  • When not initially in satellite mode, the radio enters split mode (repeater split.) The RX frequency is set and the TX frequency is not set. The rigctrl loop hangs after one update cycle (frequency updates stop.)
  • When initially in satellite mode, the radio exits satellite mode and enters split mode (repeater split.) The RX frequency is set and the TX frequency is not set. The rigctrl loop hangs after one update cycle (frequency updates stop.)

Full Duplex radio mode --vfo option: (rigctld -m 3081 -s 115200 -r /dev/icom-9700-a -vvv --vfo)

  • When not initially in satellite mode, the radio enters split mode (repeater split.) The RX frequency is set and the TX frequency is not set. The rigctrl loop hangs after one update cycle (frequency updates stop.)

  • When initially in satellite mode, the radio exits satellite mode and enters split mode (repeater split.) The RX frequency is set and the TX frequency is not set. The rigctrl loop hangs after one update cycle (frequency updates stop.)

  • Rigctrl output shown in the following file. Full duplex rigctrl output.txt

Other Rigctrl outputs will be provided on request.
image

@KaComet
Copy link
Contributor

KaComet commented Nov 6, 2022

Two things I noticed from the PR:

  • S VFO123 1 VFOABC is not the correct way to setup crossband operation on the IC-9700. This sets up repeater split (single band.) The correct way appears to be U currVFO SATMODE 1
  • currVFO does not appear to be avaliable when the IC-9700 is in satelite mode. See Rigctrl output below:
$rigctl -m 3081 -s 115200 -r /dev/icom-9700-a -vvv --vfo
Rig command: F curVFO 145000000
rig_parse_vfo: 'curVFO' not found so vfo='None'
icom_set_freq: set freq failed: vfo_fixup:(from rig_get_freq:1964) vfo=currVFO, vfo_curr=VFOA, split=1
vfo_fixup: Leaving currVFO alone
rig.c(1966) vfo=currVFO, curr_vfo=VFOA
rig_get_freq(1988): freqMainA=145825080, modeMainA=USB, widthMainA=2400
rig_get_freq(1988): freqMainB=432155816, modeMainB=, widthMainB=0
rig_get_freq(1988): freqSubA=0, modeSubA=, widthSubA=0
rig_get_freq(1988): freqSubB=0, modeSubB=, widthSubB=0
rig_get_cache(258):  vfo=VFOA, current_vfo=VFOA
rig_get_cache(434): vfo=VFOA, freq=145825080, mode=USB, width=2400
rig_get_freq(2022): freqMainA=145825080, modeMainA=USB, widthMainA=2400
rig_get_freq(2022): freqMainB=432155816, modeMainB=, widthMainB=0
rig_get_freq(2022): freqSubA=0, modeSubA=, widthSubA=0
rig_get_freq(2022): freqSubB=0, modeSubB=, widthSubB=0
rig_get_freq: VFOA cache hit age=55ms, freq=145825080, use_cached_freq=0
 1:rig_get_freq: elapsed=0ms
icom_band_changing: lastfreq=1, thisfreq=1
icom_band_changing: Band change not detected
icom.c(1264):icom_band_changing returning2(0) 
Command rejected by the rig
Command rejected by the rig

set_freq: error = rig_get_cache(258):  vfo=VFOA, current_vfo=VFOA
rig_get_cache(434): vfo=VFOA, freq=145825080, mode=USB, width=2400
rig_get_freq(2022): freqMainA=145825080, modeMainA=USB, widthMainA=2400
rig_get_freq(2022): freqMainB=432155816, modeMainB=, widthMainB=0
rig_get_freq(2022): freqSubA=0, modeSubA=, widthSubA=0
rig_get_freq(2022): freqSubB=0, modeSubB=, widthSubB=0
rig_get_freq: VFOA cache hit age=55ms, freq=145825080, use_cached_freq=0
 1:rig_get_freq: elapsed=0ms
icom_band_changing: lastfreq=1, thisfreq=1
icom_band_changing: Band change not detected
icom.c(1264):icom_band_changing returning2(0) 
Command rejected by the rig

icom.c(1417):icom_set_freq returning2(-9) Command rejected by the rig

 1:rig.c(1796):rig_set_freq returning(-9) Command rejected by the rig

0:rigctl_parse.c(2073):rigctl_set_freq returning(-9) Command rejected by the rig

Command rejected by the rig

@mdblack98
Copy link
Contributor Author

mdblack98 commented Nov 6, 2022 via email

@KaComet
Copy link
Contributor

KaComet commented Nov 6, 2022

Whoops, currVFO does work.

"I don't see where Gpredict tries to set the rig mode at all. The "U" command is not referenced."
Line 1502 of gtk-rig-ctrl.c: buff = g_strdup("S VFOB 1 VFOA\x0a");
This is what I was referencing. Running this line results in the following:
20221106_173402

You cannot operate on crossband satellites when the radio is in this mode. Additionally, I think you missed a spot around line 2416 in gtk-rig-ctrl.c

@KaComet
Copy link
Contributor

KaComet commented Nov 6, 2022

@mdblack98, are you testing this code with one of your own radios? If not, I could always submit some PRs to your fork while I'm ironing out the bugs. I have been working on a some code that adds support to changing the RIT and the TX/RX mode, with the intention of submitting a PR. However, If rigctrl is moving in the direction of --vfo then this needs to be done first.

@mdblack98
Copy link
Contributor Author

mdblack98 commented Nov 7, 2022 via email

@mdblack98
Copy link
Contributor Author

mdblack98 commented Nov 7, 2022 via email

@KaComet
Copy link
Contributor

KaComet commented Nov 7, 2022

@mdblack98, don't need to change anything. That specific line of code already exists at line 1516. I've tried all the configurations of the VFO Up/Down selector. It's a bit crazy to continue this back and forth testing style. I own a, FT-991A, IC-9700, and FT-736R. I will submit my own PR which I will test with my own radios to minimize the chance I'm breaking compatibility with existing radios.

@mdblack98
Copy link
Contributor Author

mdblack98 commented Nov 7, 2022 via email

@KaComet
Copy link
Contributor

KaComet commented Nov 8, 2022

@mdblack98, After some experimentation, I have a working version of Gpredict that uses --vfo. There were a few less than obvious snags with getting it setup. I should have a PR up soon. Just need to drag out the 991A to ensure I'm not breaking compatibility with the PTT modes.

@csete
Copy link
Owner

csete commented Dec 24, 2023

Thanks for the fix @mdblack98.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants