A small library to communicate with ICOM devices using CI-V protocol
Project description
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-706 MKII
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", debug=True)
[!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)
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.ic706_mkii.py: A simple test script that demonstrates how to use the library to communicate with the IC-706 MKII 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
Project info
Original project
This project was forked and then improved from: siyka-au/pycom
Contributors
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 iu2frl_civ-0.2.1.tar.gz.
File metadata
- Download URL: iu2frl_civ-0.2.1.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d8b4fa2d21e8c9be3ee25d5537bb6ce70e32fadda20627408ca42c03c0ce49b
|
|
| MD5 |
d7301eb3673f59a50874d2dc34f73839
|
|
| BLAKE2b-256 |
280d56abec4d1fa6b30be49d76da7acfb5d2b8d4af7a9830df7da3d9acdafaea
|
Provenance
The following attestation bundles were made for iu2frl_civ-0.2.1.tar.gz:
Publisher:
publish.yml on iu2frl/iu2frl-civ
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iu2frl_civ-0.2.1.tar.gz -
Subject digest:
3d8b4fa2d21e8c9be3ee25d5537bb6ce70e32fadda20627408ca42c03c0ce49b - Sigstore transparency entry: 167321070
- Sigstore integration time:
-
Permalink:
iu2frl/iu2frl-civ@095560b1f0aa1cd828e3e9aec3ece4349261c775 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/iu2frl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@095560b1f0aa1cd828e3e9aec3ece4349261c775 -
Trigger Event:
release
-
Statement type:
File details
Details for the file iu2frl_civ-0.2.1-py3-none-any.whl.
File metadata
- Download URL: iu2frl_civ-0.2.1-py3-none-any.whl
- Upload date:
- Size: 36.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a16dc6a869d96b3ca74a13e662e8f35d0b7686a67658a669ec74d3ca24b70016
|
|
| MD5 |
20ed74265b4b10067144cb046dbc2d9a
|
|
| BLAKE2b-256 |
9affcbab567d4aa76f0c770d6186e212f2757db5938d243f9c0ad98279fa4fcf
|
Provenance
The following attestation bundles were made for iu2frl_civ-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on iu2frl/iu2frl-civ
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iu2frl_civ-0.2.1-py3-none-any.whl -
Subject digest:
a16dc6a869d96b3ca74a13e662e8f35d0b7686a67658a669ec74d3ca24b70016 - Sigstore transparency entry: 167321074
- Sigstore integration time:
-
Permalink:
iu2frl/iu2frl-civ@095560b1f0aa1cd828e3e9aec3ece4349261c775 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/iu2frl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@095560b1f0aa1cd828e3e9aec3ece4349261c775 -
Trigger Event:
release
-
Statement type: