IU2FRL ICOM CI-V Python Library
Python library for communicating with iCOM radios using CI-V.
Compatible devices
Theorically speaking, all ICOM devices implementing the CI-V protocol should be compatible, in particular, the following devices were tested:
- IC-7300 (fw: 1.42)
- IC-7300 MKII (fw: 1.02)
- Tested using the IC-7300 module
- IC-706 MKII
- IC-821H
- IC-9700 (fw: 1.43)
Usage
1. Installing dependencies
- Install the package using
pip install iu2frl-civ
2. Importing the module
- Import the module using
from iu2frl_civ.device_factory import DeviceFactory
3. Creating the device object
- Initialize the target device using
radio = DeviceFactory.get_repository(radio_address="0x94", device_type=DeviceType.Generic, port="COM10")
[!TIP] Usage of named arguments (like
radio_address="0x94") over positional arguments is highly recommended as it provides better support for future releases or library code reviews
Where:
device_type = DeviceType.Genericis the type of device you want to controlradio_address = 0x94is the transceiver address
Then, additional arguments can be passed:
port = "/dev/ttyUSB0": communication port of the transceiverbaudrate: int = 19200: baudrate of the devicedebug = False: useful to troubleshoot communication issuescontroller_address = "0xE0": address of the controller (this library)timeout = 1: serial port communication timeout in secondsattempts = 3: how many attempts to perform in case of timeout or errorsfake = False: if set to True, the library will use a fake connection to the transceiver (serial commands will be printed to the console and not sent to any port)
4. Use the radio object
Once the device object is created, any supported method can be used, for example:
- Power on the transceiver:
device.power_on() - Get the current frequency:
device.read_operating_frequency()
5. Check the command output
Some commands have an expected value to be returned (like the device.read_operating_frequency()), most returns a boolean value, while other returns nothing (void). If the device does not support a command (or it was not yet implemented), or if some error occurred, an exception is thrown:
NotImplementedError: the current device does not implement this feature yetCivCommandException: something went wrong in the data exchange between the transceiver and the library (probably due to device misconfiguration, faulty cables, etc)CivTimeoutException: the communication timed out (something wrong with wiring or connection parameters like port or baudrate)
6. Debugging
If some commands are not working as expected, the following code can be used to enable debugging:
import logging
logger = logging.getLogger("iu2frl-civ")
logger.setLevel(logging.DEBUG)
Sample code
[!IMPORTANT] Do not rename the
testsfolder or thefake_generic.pyfile, as those are used for testing the library.
Some sample commands are available in the tests folder.
ic7300.py: A simple test script that demonstrates how to use the library to communicate with the IC-7300 transceiver.ic7300_clock.py: A simple script to set the clock of the IC-7300 transceiver by syncing to the PC.ic706_mkii.py: A simple test script that demonstrates how to use the library to communicate with the IC-706 MKII transceiver.ic821h.py: A simple test script that demonstrates how to use the library to communicate with the IC-821H transceiver.fake_generic.py: A simple test script that fakes a connection to transceiver, used to validate builds.
Developer info
Any help is welcome to either add more devices or improve existing ones, please see the developers section, accessible via relative link or GitHub Link
Device-specific documentation
IC-821H
General information
- The device seems not to support the
set_operating_frequencymethod, so you should usesend_operating_frequencyinstead. - The device seems not to reply to CI-V commands (or maybe my unit is defective?), so the library does not acknowledge any command.
- The device is quite slow in responding to commands, so you should use a longer timeout (default is 1 second).
Programming a memory channel
To program a memory channel, you can use the set_memory_mode method. For example, to set 145.600 FM to channel 79:
print("- Writing 145.600 MHz to memory 79")
radio.set_memory_mode(79)
time.sleep(1)
radio.send_operating_frequency(145600000)
time.sleep(1)
radio.set_operating_mode(OperatingMode.FM)
time.sleep(1)
radio.memory_write()
time.sleep(1)
Scan modes
To scan through memory channels, you first set the channel mode, then you toggle the scan mode:
print("- Setting memory mode")
radio.set_memory_mode(i + 1)
time.sleep(1)
print("- Starting scan")
radio.start_scan()
time.sleep(10)
print("- Stopping scan")
radio.stop_scan()
To scan trough frequencyes, first set the frequency mode, then toggle the scan mode:
print("- Setting VFO A")
radio.set_vfo_mode(VFOOperation.SELECT_VFO_A)
time.sleep(1)
print("- Starting scan")
radio.start_scan()
time.sleep(10)
print("- Stopping scan")
radio.stop_scan()
Project info
Original project
This project was forked and then improved from: siyka-au/pycom
Contributors
Metadata
Release files for iu2frl-civ 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iu2frl_civ-0.4.0.tar.gz | 43.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iu2frl_civ-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.9 kB
Release files / iu2frl_civ-0.4.0.tar.gz
| Download URL | iu2frl_civ-0.4.0.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6b4d0fa50904379bda4a382a316332acfd198f75a5f3d7c9c8a962303ca2738
|
|
BLAKE2b-256 checksum How to use checksums |
aa0c6263b39869084eb151ab8b2f346a342e1baf181c4e7cca0b41e3a8e3b0e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / iu2frl_civ-0.4.0-py3-none-any.whl
| Download URL | iu2frl_civ-0.4.0-py3-none-any.whl |
|---|---|
| Size | 53.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7b3cb7064eaec43155bf6f4515e124f0218ce757e4f31f42f3dd089f536a8b0
|
|
BLAKE2b-256 checksum How to use checksums |
863b8e48a04f53ccb7d5c131754fb6638be7b3b79d99ad3495fda7540ce39d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency log