Open malcolmh opened 7 years ago
I just had a glance look into the ICOM R6 Hamlib model, and I think that this error happens due to an inconsistency in the model. In order models which have no get_vfo or set_vfo, the vfo defaults to RIG_VFO_CURR. In the R6, it defaults to RIG_VFO_A.
Currently gorigctl server / gui local state machine implements the following logic:
So I guess easiest thing would be to change VFO in the Hamlib model to RIG_VFO_CURR. Alternatively, provide a get_vfo function.
Maybe @n0nb or @g4wjs can confirm this.
OK, I have changed IC-R6 (also IC-R10 & IC-R20) to use RIG_VFO_CURR. You can find my updated hamlib source here: https://github.com/malcolmh/hamlib/tree/icr6
Does it fix the problem?
Is Hamlib bundled into this program or does it use the host shared library? Also why should the CLI work but the GUI not?
gorigctl is using the hosts shared library. So if you recompile hamlib and install it (make install) gorigctl will use the updated (shared) library.
The GUI is using a state machine which can be considered an abstraction between the radio and the user. The state machine takes care of synchronizing the rig with the GUI.
The (local) CLI on the other hand doesn't have a state machine. It gives you, similar to the original rigctl, direct access to the radio. The user has to specifically get / set the radio's values.
OK, thanks. Now I know that I can test changes to Hamlib without having to build gorigctl.
After changing to RIG_VFO_CURR, it still does not read the frequency.
ok - strange. What's the error message you get?
No error message, just frequency reported as 0.0kHz:
┌Info───────────────────────────┐┌Frequency─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐┌SWR─────────────────────────────┐
│Icom IC-R6 ││ ││ │
│0.7 ALPHA ││ │└────────────────────────────────┘
└───────────────────────────────┘│ │┌S-Meter─────────────────────────┐
┌Latency────────────────────────┐│ ││ S0 │
│Offline ││ │└────────────────────────────────┘
│ ││ │
│ ││ │
└───────────────────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌Power On───────────────────────┐┌VFO───────────┐┌Mode──────────┐┌Filter─────────────────────────┐┌RIT───────────┐┌XIT───────────┐┌Antenna───────┐┌Att───────────┐┌Preamp────────┐┌Tuning Step────────┐
│n/a ││CURR ││ ││0 Hz ││n/a ││n/a ││n/a ││0 dB ││n/a ││n/a │
└───────────────────────────────┘└──────────────┘└──────────────┘└───────────────────────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└───────────────────┘
┌PTT────────────────────────────┐┌Split─────────┐┌TX Frequency───────────────────┐┌TX Mode───────┐┌TX Filter──────────────────────┐
│ ││ ││ ││ ││ │
└───────────────────────────────┘└──────────────┘└───────────────────────────────┘└──────────────┘└───────────────────────────────┘
┌Functions──────────────────────┐┌Logging───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐┌Levels──────────────────────────┐
└───────────────────────────────┘│15:32:45 Frequency: 0.000 kHz ││AF 0.43 │
┌Operations─────────────────────┐│ ││ATT 0 │
└───────────────────────────────┘│ ││RAWSTR 0 │
│ ││SQL 0.09 │
│ ││STRENGTH -60 │
│ │└────────────────────────────────┘
│ │┌Parameters──────────────────────┐
│ │└────────────────────────────────┘
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌Rig command:─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
When run as CLI, frequency is read OK: imac:work mherring$ ~/Downloads/gorigctl cli local -m 377 -o /dev/tty.usbserial -b 9600 get_vfo: function not available (-11)
rig command: f Frequency: 156600.000 kHz
but run as GUI: imac:work mherring$ ~/Downloads/gorigctl gui local -m 377 -o /dev/tty.usbserial -b 9600
08:16:11 Frequency: 0.000 kHz