Skip to content

Instantly share code, notes, and snippets.

@kotfic
Created August 27, 2022 18:20
Show Gist options
  • Save kotfic/ca5cb053ee08d3e44e2c44e0d30244b9 to your computer and use it in GitHub Desktop.
Save kotfic/ca5cb053ee08d3e44e2c44e0d30244b9 to your computer and use it in GitHub Desktop.
Steps to get FT-891 and rigctld working with udev and systemd
# /etc/udev/rules.d/99-usb-radio.rules
# Adds the /dev/ft891 device, note that ID_USB_INTERFACE_NUM is required because of the weird use of the USB to Dual serial adapter driver
SUBSYSTEM=="tty" ENV{ID_USB_INTERFACE_NUM}=="00" ATTRS{idVendor}=="10c4" ATTRS{idProduct}=="ea70" SYMLINK+="ft891" ENV{SYSTEMD_WANTS}="rigctld.service"
# Some info on setting up UDEV rules
https://www.thuben.com/amateur/software/fixed-devices
# SystemD service
https://www.thuben.com/amateur/software/rigctl
# Setting up the ENV{SYSTEMD_WANTS} stuff
https://blog.fraggod.net/2012/06/16/proper-ish-way-to-start-long-running-systemd-service-on-udev-event-device-hotplug.html
# /etc/systemd/system/rigctld.service
[Unit]
Description=rigctld Hamradio rig controler
After=syslog.target network.target
# Remove the service when udev no longger needs it (i.e. unplugged)
StopWhenUnneeded=yes
[Service]
Type=simple
# Use the /dev/ft891 symlink set up by following UDEV rule
ExecStart=/usr/bin/rigctld -m 1036 -r /dev/ft891 -s 38400 -p 4532
ExecReload=/bin/ill -HUP $MAINPID
RestartSec=60
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment