Pages: [1]   Go Down

Author Topic: Example source code for reading rig frequency from FLRIG?  (Read 203 times)

KD2EIP

  • Member
  • Posts: 21
Example source code for reading rig frequency from FLRIG?
« on: May 26, 2022, 05:22:09 PM »

I've been unable to get pyfldigi to read the current frequency from FLRIG.  Does anyone have a sample program in python/C/C++/pearl/Fortran/Cobol that does this?  The objective is to automate my antenna switch to select the best antenna for the current frequency.  I don't want to be sending 10 meter output into a 20/40 fan dipole by mistake.  Or even 2m/70cm into a long wire.

This is going to be on a Raspberry Pi 4 if that makes a difference.  I get "connection refused" with the tests/test_client.py sample program in the pyFldigi distribution and python3.

Thanks - Ed KD2EIP
Logged

N0NB

  • Member
  • Posts: 165
    • N0NB on the Web
Re: Example source code for reading rig frequency from FLRIG?
« Reply #1 on: May 27, 2022, 06:01:01 AM »

Hamlib has a layer that integrates with Flrig.  Perhaps this will be of help:

https://github.com/Hamlib/Hamlib/blob/master/rigs/dummy/flrig.c
Logged
73, de Nate
Bremen, KS

SKCC 6225

KD2EIP

  • Member
  • Posts: 21
Re: Example source code for reading rig frequency from FLRIG?
« Reply #2 on: May 27, 2022, 01:08:29 PM »

Perfect!  I've been using C for years but I'm just beginning to learn Python.

Thank you very much!

Ed
Logged

KD2EIP

  • Member
  • Posts: 21
Re: Example source code for reading rig frequency from FLRIG?
« Reply #3 on: May 27, 2022, 02:30:47 PM »

So who really needs to program with this around (part of hamlib)?  Rigctl works fine:

/usr/local/bin/rigctl -m4 f

Returns the current frequency in Hz.  A simple shell script will do everything that I need.  Thanks again!!!
Logged
Pages: [1]   Go Up