Hamlib

From Wildsong
Revision as of 05:06, 28 March 2023 by Brian Wilson (talk | contribs)
Jump to navigationJump to search

A library for radio and rig control.

https://github.com/Hamlib/Hamlib

Grig

Grig is an app for controlling rigs and rotators.

Getting started I want to set up Grig + the Kenwood TM-D710A on Plover (Ubuntu Linux), so that I can test Hamlib with that radio

I am trying to use it in my Svxlink projects.

I need the latest versions of things to work on Plover, so I am building them from source code. I want to try building in Docker so that I can keep the changes to Plover contained.

Build Hamlib in Docker

It comes with instructions, here: https://github.com/Hamlib/Hamlib/tree/master/docker-build This will build and install hamlib in /usr/local/hamlib-alpha/.

cd ~/docker
https://github.com/Hamlib/Hamlib.git
cd Hamlib/docker-build/
# Install the toolchain in an image
docker buildx build -t hamlib-build .
cd ..
# Use the toolchain to actually compile and install hamlib on the host.
docker run --rm -ti -u root -v $(pwd):/home/hamlib/build -v /usr/local/hamlib-alpha:/usr/local/hamlib-alpha hamlib-build
/usr/local/hamlib-alpha/bin/rigctl

That gives me a command line program rigctl. Use a "?" to get a list of commands. Now I need to plug in a rig to ctl. Here's a man page for it. https://www.mankier.com/1/rigctl

Other commands installed include ampctl ampctld rigctlcom rigctld rigctlsync rigctltcp rigmem rigsmtr rigswr rigtestlibusb rotctl rotctld


I am trying my Kenwood TH-D74A because it's sitting right next to me. Also, it has a built-in USB port. Very modern. On Plover it looks like it's showing up on /dev/ttyACM0

rigctl -l | grep TH-D74
rigctl -m 2042 -r /dev/ttyACM0 -u
Caps dump for model: 2042
Model name:	TH-D74
Mfg name:	Kenwood
Backend version:	20230318.3
Backend copyright:	LGPL
Backend status:	Stable
Rig type:	Other Receiver Transmitter Handheld Transceiver APRS TNC DxCluster DxCluster 
PTT type:	Rig capable
DCD type:	Rig capable
Port type:	RS-232
Serial speed: 9600..9600 bauds, 8N1 XONXOFF
Write delay: 0mS, timeout 500mS, 3 retry
Post Write delay: 0mS
Has targetable VFO: Y
Has async data support: N
Announce: 0x0
Max RIT: -0.0kHz/+0.0kHz
Max XIT: -0.0kHz/+0.0kHz
Max IF-SHIFT: -0.0kHz/+0.0kHz
Preamp: None
Attenuator: None
AGC levels: 9=NONE

CTCSS: 67.0 71.9 74.4 77.0 79.7 82.5 85.4 88.5 91.5 94.8 97.4 100.0 103.5 107.2 110.9 114.8 118.8 123.0 127.3 131.8 136.5 141.3 146.2 151.4 156.7 162.2 167.9 173.8 179.9 186.2 192.8 203.5 210.7 218.1 225.7 233.6 241.8 250.3 Hz, 38 tones
DCS: None
Get functions: TONE TSQL 
Set functions: TONE TSQL 
Extra functions:
Get level: ATT(0..12/0) VOXDELAY(3..300/1) SQL(0..1/0.01) RFPOWER(0.05..1/0.01) VOXGAIN(0..1/0.01) 
Set level: ATT(0..12/0) VOXDELAY(3..300/1) SQL(0..1/0.01) RFPOWER(0.05..1/0.01) VOXGAIN(0..1/0.01) 
Extra levels:
Get parameters: TIME(0..0/0) 
Set parameters: TIME(0..0/0) 
Extra parameters:
Mode list: AM CW USB LSB FM WFM CWR FMN 
VFO list: VFOA VFOB 
VFO Ops: 
Scan Ops: 
Number of banks:	0
Memory name desc size:	6
Memories:
	0..999:   	MEM
	  Mem caps: FREQ MODE WIDTH TXFREQ SPLIT RPTRSHIFT RPTROFS TS FUNC TONE CTCSS NAME 
TX ranges #1 for TBD:
RX ranges #1 for TBD:
TX ranges #2 for TBD:
	144000000 Hz - 148000000 Hz
		VFO list: VFOA VFOB 
		Mode list: FM 
		Antenna list: ANT_NONE
		Low power: 0.05 W, High power: 5 W
	430000000 Hz - 440000000 Hz
		VFO list: VFOA VFOB 
		Mode list: FM 
		Antenna list: ANT_NONE
		Low power: 0.05 W, High power: 5 W
RX ranges #2 for TBD:
	118000000 Hz - 174000000 Hz
		VFO list: VFOA VFOB 
		Mode list: AM CW USB LSB FM WFM CWR FMN 
		Antenna list: ANT_NONE
	320000000 Hz - 524000000 Hz
		VFO list: VFOA VFOB 
		Mode list: AM CW USB LSB FM WFM CWR FMN 
		Antenna list: ANT_NONE
TX ranges #3 for TBD:
RX ranges #3 for TBD:
TX ranges #4 for TBD:
RX ranges #4 for TBD:
TX ranges #5 for TBD:
RX ranges #5 for TBD:
TX ranges #1 status for TBD:	OK (0)
RX ranges #1 status for TBD:	OK (0)
TX ranges #2 status for TBD:	OK (0)
RX ranges #2 status for TBD:	OK (0)
TX ranges #3 status for TBD:	OK (0)
RX ranges #3 status for TBD:	OK (0)
TX ranges #4 status for TBD:	OK (0)
RX ranges #4 status for TBD:	OK (0)
TX ranges #5 status for TBD:	OK (0)
RX ranges #5 status for TBD:	OK (0)
Tuning steps:
	5.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	6.2500 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	10.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	12.5000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	15.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	20.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	25.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	30.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	50.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
	100.0000 kHz:   	AM CW USB LSB FM WFM CWR FMN 
Tuning steps status:	OK (0)
Filters:
	14.0000 kHz:   	FM 
	7.0000 kHz:   	FMN 
	9.0000 kHz:   	AM 
Bandwidths:
	AM	Normal: 9.0000 kHz,	Narrow: 0.0 Hz,	Wide: 0.0 Hz
	FM	Normal: 14.0000 kHz,	Narrow: 0.0 Hz,	Wide: 0.0 Hz
	FMN	Normal: 7.0000 kHz,	Narrow: 0.0 Hz,	Wide: 0.0 Hz
Spectrum scopes: None
Spectrum modes: 
Spectrum spans: 
Spectrum averaging modes: 
Spectrum attenuator: None
Has priv data:	Y
Has Init:	Y
Has Cleanup:	Y
Has Open:	Y
Has Close:	N
Can set Conf:	N
Can get Conf:	N
Can set Frequency:	Y
Can get Frequency:	Y
Can set Mode:	Y
Can get Mode:	Y
Can set VFO:	Y
Can get VFO:	Y
Can set PTT:	Y
Can get PTT:	N
Can get DCD:	N
Can set Repeater Duplex:	Y
Can get Repeater Duplex:	Y
Can set Repeater Offset:	Y
Can get Repeater Offset:	Y
Can set Split Freq:	Y
Can get Split Freq:	Y
Can set Split Mode:	E
Can get Split Mode:	E
Can set Split VFO:	Y
Can get Split VFO:	Y
Can set Tuning Step:	Y
Can get Tuning Step:	Y
Can set RIT:	N
Can get RIT:	N
Can set XIT:	N
Can get XIT:	N
Can set CTCSS:	Y
Can get CTCSS:	Y
Can set DCS:	Y
Can get DCS:	Y
Can set CTCSS Squelch:	Y
Can get CTCSS Squelch:	Y
Can set DCS Squelch:	N
Can get DCS Squelch:	N
Can set Power Stat:	N
Can get Power Stat:	N
Can Reset:	N
Can get Ant:	N
Can set Ant:	N
Can set Transceive:	E
Can get Transceive:	N
Can set Func:	Y
Can get Func:	Y
Can set Level:	Y
Can get Level:	Y
Can set Param:	Y
Can get Param:	Y
Can send DTMF:	N
Can recv DTMF:	N
Can send Morse:	N
Can send Voice:	N
Can decode Events:	N
Can set Bank:	N
Can set Mem:	Y
Can get Mem:	Y
Can set Channel:	Y
Can get Channel:	Y
Can ctl Mem/VFO:	N
Can Scan:	N
Can get Info:	Y
Can get power2mW:	N
Can get mW2power:	N

Overall backend warnings: 0   

Well that's extensive but I want to try Grig. Let's see what that takes.

Build Grig (in Docker?)

cd ~/docker git clone https://github.com/fillods/grig.git cd grig/docker-build docker buildx build -t grig-build . cd .. docker run --rm -ti -u root -v $(pwd):/home/grig/build -v /usr/local/grig:/usr/local/grig grig-build