Re: [Hamlib-developer] Python API
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: George B. <geo...@gm...> - 2025-03-31 18:29:42
|
Good question, Dave From my point of view, I see three major plusses - 1. You get stability. In the time I've been working on Hamlib(about 2.5 years), I've seen more changes/tweaks to the rigctl commands than to the Hamlib API, and more emphasis on API continuity. And I don't know of any hard-and-fast definition of the rigctld protocol. 2. You get flexibility. Using the API means you can use rigctld if you like, connect directly to the rig via USB or serial, or even use TCP/IP directly to those rigs that support it. No changes to app code, just configure the connection. 3. You get (limited) portability. Using code from other apps in your own app means transliterating, not writing from scratch. Just my 2 cents 73 N3GB PS: replies to the list, please On 3/31/25 8:46 AM, Dave Baxter wrote: > > Hi George. > > For those of us who have not used the Hamlib API (for any language.) > What advantage and/or other features does it give, over using rigctld > for example for anyone developing an application for their own, or > other's use? > > Why would it be preferable* to using rigctld via TCP/IP? > > (* I can see that if you expose a rigctld port to, "the world"! That > is probably not a safe thing to do, as from past traffic on this list > I suspect rigctld is not hardened to anyone attempting to find an > exploitable hole in it! But hiding it behind a properly configured > VPN is likely OK, for such a remote usage case.) > > Not criticising in any way, Just curious and would like to know more... > > 73. > > Dave G0WBX > > > On 31/03/2025 09:44, George Baltz wrote: >> What you are looking for is the Python binding for Hamlib. On Linux >> it's usually a separate package, installed along with the main >> library. Example code is available in the source tree, or at >> https://github.com/Hamlib/Hamlib/blob/master/bindings/py3test.py >> >> Creating the Python bindings is a build-time option - I don't know if >> it is available in the stock packages. If you build Hamlib yourself, >> it is pretty simple to add it. >> >> Using rigctl or rigctld is an option, but that means re-inventing a >> lot of code. >> >> On 3/29/25 4:06 AM, Stephen Pattinson via Hamlib-developer wrote: >>> Hi, >>> I have written a Python (3.12.3) to talk to my IC7300 via Hamlib >>> (V4.6.2) in a Windows 10 environment, but I'm just issuing "rigctl" >>> commands and capturing the response. This works fine, but it's >>> rather crude. >>> Of course I would like to use the API which I believe is available, >>> but I cannot find how to download the necessary additional software >>> or library, or find the documentation for the Python API. >>> I have looked at >>> "https://hamlib.sourceforge.net/manuals/4.3/index.html", but this >>> seems exclusively C >>> Ironically, the most pertinent info I retrieved from a search is >>> from the Google AI (Sigh!) which suggests I need "hamlib-python", >>> but I can't find where the AI has scooped up this information. >>> If anybody can point me at installation instructions and >>> documentation for the API, I would be grateful. >>> Thanks/73 >>> Steve VK3SPX >>> >>> >>> _______________________________________________ >>> Hamlib-developer mailing list >>> Ham...@li... >>> https://lists.sourceforge.net/lists/listinfo/hamlib-developer >> >> >> _______________________________________________ >> Hamlib-developer mailing list >> Ham...@li... >> https://lists.sourceforge.net/lists/listinfo/hamlib-developer |