Icom IC-7300 radio driver for bench automation — Hamlib rigctld TCP client
Project description
rf-bench-drivers-icom
Icom IC-7300 radio driver for bench automation. Part of the rf-bench-drivers family of packages.
Communicates with the IC-7300 via Hamlib rigctld over a plain TCP socket — no pyvisa, no direct CI-V, no external Python dependencies.
Related packages
| Package | Namespace | Description |
|---|---|---|
rf-bench-drivers-icom |
rf_bench.icom |
This package — Icom IC-7300 driver |
rf-bench-drivers-yaesu |
rf_bench.yaesu |
Yaesu FT-891 driver |
rf-bench-drivers-siglent |
rf_bench.siglent |
Siglent instrument drivers (SSA3000X, SDG1000X, SDS2000X, SDM3000X, SPD3303X) |
rf-bench-drivers-utils |
rf_bench.utils |
RF math utilities (power conversions, noise, IP3, etc.) |
Hardware requirements
- Icom IC-7300 connected via USB-B cable to
/dev/ttyUSB0(or another serial port) - Hamlib installed (
sudo pacman -S hamlib/sudo apt install hamlib/brew install hamlib) rigctldrunning before you instantiateIC7300
Starting rigctld
rigctld -m 3073 -r /dev/ttyUSB0 -s 115200
- Model
3073is the IC-7300 in Hamlib 4.x (use373for Hamlib 3.x) - Baud rate must match the radio: Menu → Set → Connectors → CI-V Baud Rate = 115200
- Default listen port is 4532 (TCP)
If you need to run two radios simultaneously, start the second rigctld on a different port (e.g. --port 4533) and pass that port to the driver.
Install
pip install rf-bench-drivers-icom
Usage
from rf_bench.icom import IC7300
# Connect (rigctld must already be running on localhost:4532)
rig = IC7300()
# Or specify host/port explicitly
rig = IC7300("localhost", 4532)
# Context manager form (auto-closes)
with IC7300() as rig:
rig.set_mode("usb")
rig.set_frequency(14_200_000) # Hz
rig.set_agc("off")
strength = rig.get_strength()
print(f"Signal: {strength:.1f} dB")
API
Constructor
IC7300(host="localhost", port=4532)
Methods
| Method | Description |
|---|---|
get_frequency() |
Returns VFO-A frequency in Hz (float) |
set_frequency(freq_hz) |
Sets VFO-A frequency in Hz |
get_mode() |
Returns (mode_str, passband_hz) — e.g. ("USB", 2400) |
set_mode(mode, passband_hz=0) |
Sets mode; mode is 'usb', 'lsb', 'cw', 'cwr', 'am', 'fm', 'rtty'; passband_hz=0 uses radio default |
get_strength() |
Returns raw Hamlib STRENGTH float (dB re S9 for Hamlib 4.x; range approx -54 to +60) |
get_strength_settled(settle_s=0.5, samples=3) |
Waits settle_s seconds, then averages samples strength readings |
set_agc(mode) |
Sets AGC: 'off', 'fast', 'mid', 'slow' — 'off' is a true hardware bypass on IC-7300 |
get_agc() |
Returns AGC value: 0=off, 1=fast, 2=mid, 3=slow |
set_rf_gain(gain) |
Sets RF gain, 0.0–1.0 (1.0 = maximum) |
close() |
Closes the rigctld TCP connection |
The class also supports the context manager protocol (with IC7300() as rig:).
Default passband widths
| Mode | Passband |
|---|---|
| USB / LSB | 2400 Hz |
| CW / CWR | 500 Hz |
| AM | 6000 Hz |
| FM | 15000 Hz |
| RTTY | 500 Hz |
Notes
- All frequency values are in Hz throughout the API.
get_strength()returns Hamlib's raw STRENGTH value. For Hamlib 4.x with the IC-7300 this is dB relative to S9 (S9 = 0, S9+10 = 10, S1 ≈ −48). The exact calibration varies — use a signal generator andget_strength_settled()to build a calibration table.set_agc("off")achieves a true hardware AGC bypass on the IC-7300. This is not the case on all radios.rigctldmust be running before you callIC7300(). The constructor connects immediately and will raiseConnectionRefusedErrorif rigctld is not listening.- No external Python dependencies — pure stdlib (
socket,time).
License
GPL-3.0-or-later. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rf_bench_drivers_icom-0.1.0.tar.gz.
File metadata
- Download URL: rf_bench_drivers_icom-0.1.0.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6e3452a9a6fa9a89b306a0ccc4968a693ec07ad6a1817d17a83260f676d0a4
|
|
| MD5 |
1981c93416b4e70604e3f51c2146f694
|
|
| BLAKE2b-256 |
51227b92bca35be6e97c7d205677b016a7ef10042e0ccfed712fb9a369197506
|
File details
Details for the file rf_bench_drivers_icom-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rf_bench_drivers_icom-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b5fdc351cd763a75dfb954703d69e8d4b5e4d02d4e6b0bf02b029bd8c6d127
|
|
| MD5 |
9b2bb2b3d714516978a944fd23854983
|
|
| BLAKE2b-256 |
9afcf910501388d7505de4c2779a422a890229e37842327ab8cfa09c57250292
|