aioc-util.py is a command-line tool for configuring the AIOC
device, viewing its internal registers and change them, including setting the PTT source.
This utility is written by Hrafnkell Eiríksson TF3HR based on code from G1LRO and from Simon Küppers/skuep.
The code is only tested against AIOC firmware v1.3. Firmware v1.2 does not seem to work. Please upgrade your AIOC if needed.
- Python 3
- hid Python package to access the USB HID interface
- A hid shared library for your platform, see below.
Clone this repository (or download it zipped)
git clone https://github.com/hrafnkelle/aioc-util.gitCreate and activate a virtual environment in the cloned repository, then install dependencies. A virtual environment is reccomended since the distribution provided HID python module seems to be an older version (at least on Debian/Raspian OS). That way the hid module can be pip installed without affecting the whole system. If you have installed python3-hid or python3-hidapi with apt you may need to uninstall that.<>
cd aioc-util
python3 -m venv venv
source venv/bin/activate
pip install hidA udev rule is provided to allow non-root access to the AIOC device. Install it by copying
the file to /etc/udev/rules.d/, then reload rules and replug the device:
sudo cp udev/rules.d/91-aioc.rules /etc/udev/rules.d/
sudo udevadm control --reload
sudo udevadm triggerUnplug and replug your AIOC USB device after installing the rule.
After this, you can run aioc-util.py without sudo.
The libusb/hidapi project also has a udev rule that could be used.
If needed, install libhidapi-hidraw0 and libhidapi-libusb
sudo apt install libhidapi-hidraw0 libhidapi-libusbcd aioc-util
python3 -m venv venv
.\venv\Scripts\activate
pip install hidOn Windows, you need to provide the hidapi.dll library. Download the Windows release build of the hidapi project (from the Releases page), locate hidapi.dll, and copy it into this project's root directory (alongside aioc-util.py).
List the available command line arguments
./aioc-util.py --help./aioc-util.py --vptt-lvlctrl 0x80 --vptt-timctrl 10 --vcos-lvlctrl 0xff --vcos-timctrl 20 --storeTo key a radio set ptt1 state to on, to unkey use off
./aioc-util.py --set-ptt1-state on./aioc-util.py --open-usb 0x1234 0x5678 --dumpOn Windows you may need to put python in front of the script name
python aioc-util.py --dumpIf you need to find the USB Vendor ID (VID) and Product ID (PID) for your device, you can use the following commands:
-
Linux: use
lsusbto list USB devices and look for your device’s VID:PID pair. -
Windows (PowerShell):
Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -like "USB\VID*" } | Select-Object Name, InstanceId
You may need to set the AIOC register values to defaults before using the suggestions below.
./aioc-util.py --defaults --storeTo use with APRSDroid, the virtual PTT should be enabled on the AIOC. This way you don't have to rely on the VOX function of your radio to key the radio for transmission.
./aioc-util.py --ptt1 VPTT --storeIt is simple to set up an AllStarLink node with the AIOC.
Make sure you have a udev rule to allow access to the HID functionality of the AIOC like described above. Set the VCOS_TIMCTRL register to 1500
./aioc-util.py --vcos-tmctrl 1500 --storeASL3 supports the AIOC on its default USB VID PID values. You can edit the file /etc/asterisk/res_usbradio.conf and
uncomment the line with the AIOC USB VID and PID values. This way you don't have to change the VID and PID so it looks like a CM108 interface. If you would rather change the VID and PID values then you can do that with
./aioc-util.py --set-usb 0x0d8c 0x000c --store