You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.1 KiB
2.1 KiB
title | summary | date | tags | draft | ||||||
---|---|---|---|---|---|---|---|---|---|---|
handy tools for MMDVM | Some nice ideas and so... | 2022-07-31T13:12:39+02:00 |
|
true |
the script
# file: "kill-mmdvm.sh"
#!/bin/bash
#udev/rules.d contains a rule file like:
#SUBSYSTEM=="tty", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0094", SYMLINK+="ttyGD77", TAG+="systemd", ENV{SYSTEMD_WANTS}="mmdvmhost.service"
#ACTION=="remove", SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1fc9", ENV{ID_MODEL_ID}=="0094", RUN+="/etc/udev/kill-mmdvm.sh"
#
#mmdvmhost service stopping lasts about 1 minute to succeed, so kill is the option...
if [ "$ACTION" = "remove" ]
then
systemctl kill -s KILL mmdvmhost.service
fi
restarting/reloading udev rules without reboot
# udevadm control --reload-rules && udevadm trigger
gd77 udev rules
# file: "/etc/udev/rules.d/99-gd77.rules"
# USB rules for GD-77
# Place this in /etc/udev/rules.d/ to let all users talk to the radios by USB.
#
SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0073", MODE="0666"
# HIDAPI/libusb
SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0073", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0094", MODE="0666"
# HIDAPI/hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0073", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0094", MODE="0666"
# HIDAPI/hiddev
## We need to unbind this device, otherwise LibUsb will fail to SetConfiguration() and ClaimInterface()
# For Bootloader (usbhid)
KERNEL=="hiddev*", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0073", MODE="0666", RUN+="/bin/bash -c 'ID=$(IFS=/; read -a array <<< %p; echo ${array[-3]}); echo $ID > /sys/bus/usb/drivers/usbhid/unbind'"
# OpenGD77
KERNEL=="ttyACM[0-9]*", SUBSYSTEM=="tty", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0094", MODE="0666", GROUP="dialout", SYMLINK+="OpenGD77"
Sources: