Yaesu FT-991A CAT control using Emacs Lisp
For many years, modern Amateur Radio Transceivers have had the ability to be controlled remotely. For Yaesu equipment, there exists CAT (Computer Aided Transceiver) protocol to support this capability. Some time ago the hamlib project was started by myself (VK3FCS/KM5WS) and Stéphane Fillod, F8CFE to support computer control of Amateur Radio equipment. It has been quite a few years since I have been involved, but its been rewarding to watch it grow due to the hard work and dedication of many open source developers.
Fast forward to the present, where I spend a considerable amount of time inside Emacs writing C/C++/Lua/Python code. To the right of me sits an FT-991A that keeps me company. I had been wanting to brush up on Emacs Lisp, and writing an Emacs Minor Mode to control this radio seemed like a good idea.
The project is called catmacs (CAT for Emacs). Initially I have targeted RX functions for Yaesu’s FT-991(A), but this could be expanded over time.
The project is up on bitbucket, if you want to check it out 😉 The Emacs Lisp package file is catmacs.el.
git clone https://bitbucket.org/pymaximus/catmacs
You can set the catmacs keymap prefix in your emacs customization file. Here is an example setting the command prefix and loading catmacs package.
;; ;; catmacs key map prefix, change to suit. ;; (global-set-key (kbd "C-c m") 'catmacs-keymap) (load "catmacs")
To load catmacs.el without installing into your emacs directory (or using package manager), just issue the following command from inside emacs.
M-x load-file RET /path/to/catmacs.el RET
To install catmacs from melpa, issue the following command.
M-x package-install RET catmacs RET
Ok lets activate catmacs and try it out.
You can activate the non global minor mode as follows
M-x catmacs-mode
You can see a list of catmacs functions by executing
M-x apropos RET catmacs-mode RET
Shown below is the output from apropos.
Type RET on a type label to view its full documentation. catmacs Group: CAT client for Yaesu Transceivers. Properties: group-documentation custom-prefix custom-group catmacs-ab-set Command: AB - Set - VFO-A to VFO-B. catmacs-accept-timeout User option: Sets the timeout for accepting process output. See ‘accept-process-output’ for details. Properties: standard-value custom-type custom-requests variable-documentation catmacs-ag-set Command: AF - Set - AF GAIN (0-255). catmacs-ag-set-ni Function: AF - Set - AF GAIN P1 P2. catmacs-ai-set Command: AI - Set - Auto Information STATE. catmacs-baud-rate User option: Baud rate for CAT serial communications. Properties: standard-value custom-type custom-requests variable-documentation catmacs-bd-set Command: BD - Set - Band Down. catmacs-bd-set-ni Function: BD - Set - Band Down P1. catmacs-bs-set Command: BS - Set - Band Select. catmacs-bs-set-ni Function: BS - Set - Band Select P1. catmacs-bu-set Command: BU - Set - Band Up. catmacs-bu-set-ni Function: BU - Set - Band Up P1. catmacs-ch-set Command: CH - Set - Channel Up/Down. catmacs-ch-set-ni Function: CH - Set - Channel Up/Down P1. catmacs-da-set Command: DA - Set - Dimmer. catmacs-da-set-ni Function: DA - Set - Dimmer P1 P2 P3. catmacs-dn-set Command: DN - Set - Microphone Down. catmacs-dn-set-ni Function: DN - Set - Microphone Down. catmacs-ed-set Command: ED - Set - Encoder Down. catmacs-ed-set-ni Function: ED - Set - Encoder Down P1 P2. catmacs-eu-set Command: EU - Set - Encoder Up. catmacs-eu-set-ni Function: EU - Set - Encoder Up P1 P2. catmacs-fa-read Command: FA - Read - Frequency VFO-A. catmacs-fa-read-ni Function: FA - Read - Frequency VFO-A. catmacs-fa-set Command: FA - Set - Frequency VFO-A. catmacs-fa-set-ni Function: FA - Set - Frequency VFO-A P1. catmacs-fs-set Command: FS - Set - Fast Step. catmacs-fs-set-ni Function: FS - Set - Fast Step P1. catmacs-if-read Command: IF - Read - Information. catmacs-if-read-ni Function: IF - Read - Information. catmacs-lk-set Command: LK - Set - Lock. catmacs-lk-set-ni Function: LK - Set - Lock P1. catmacs-md-set Command: MD - Set - Operating Mode. catmacs-md-set-ni Function: MD - Set - Operating Mode - P1 P2. catmacs-mode Command: CAT client for Yaesu FT991A Transceiver Variable: Non-nil if Catmacs mode is enabled. Properties: variable-documentation event-symbol-element-mask event-symbol-elements modifier-cache catmacs-mode-hook Variable: Hook run after entering or leaving ‘catmacs-mode’. Properties: variable-documentation catmacs-mode-map Variable: Keymap for ‘catmacs-mode’. Properties: variable-documentation catmacs-nb-read-ni Function: NB - Read - Noise Blanker - P1. catmacs-nb-set Command: Set Noise Blanker STATUS. catmacs-nb-set-ni Function: NB - Set - Noise Blanker - P1 P2. catmacs-nl-read-ni Function: NL - Read - Noise Blanker Level - P1. catmacs-nl-set Command: NL - Set - Noise Blanker LEVEL. catmacs-nl-set-ni Function: NL - Set - Noise Blanker Level - P1 P2. catmacs-nr-read-ni Function: NR - Read - Noise Reduction - P1. catmacs-nr-set Command: Set Noise Reduction STATUS. catmacs-nr-set-ni Function: NR - Set - Noise Reduction - P1 P2. catmacs-pa-set Command: Set - Pre-Amp (IPO). catmacs-pa-set-ni Function: PA - Set - Pre-Amp (IPO) - P1 P2. catmacs-qr-set Command: QR - Set - QMB recall. catmacs-qr-set-ni Function: NR - Set - QMB Recall. catmacs-ra-set Command: RA - Set - RF Attenuator. catmacs-ra-set-ni Function: RA - Set - RF Attenuator (P1 P2). catmacs-rg-set Command: RG - Set - RF GAIN. catmacs-rg-set-ni Function: RG - Set - RF GAIN P1 P2. catmacs-rl-set Command: RG - Set - NOISE REDUCTION LEVEL. catmacs-rl-set-ni Function: RG - Set - RL P1 P2. catmacs-send-process Function: Send to a specified PROCESS, a COMMAND string. catmacs-send-serial Command: Send a COMMAND string over serial port. catmacs-serial-port User option: Serial port for CAT communications. Properties: standard-value custom-type custom-requests variable-documentation catmacs-sq-set Command: SQ - Set - Squelch LEVEL. catmacs-sv-set Command: SV - Set - Swap VFO. catmacs-test Command: For test, execute some catmacs-xyz-set-ni commands. Properties: event-symbol-element-mask event-symbol-elements modifier-cache catmacs-up-set Command: UP - Set - Microphone UP.
For ease of use, the most popular functions have key bindings (assuming you use C-c m as the catmacs prefix).
- C-c m f – Set Frequency
- C-c m m – Set Mode
- C-c m q – Set QMB Recall
- C-c m a – Set RF Attentation
- C-c m l – Set VFO-A Lock
- C-c m b – Set Band Select
- C-c m v – Set AF Gain (Volume)
- C-c m s – Swap VFO
- C-c m e u – Set Encoder Up
- C-c m e d – Set Encoder Down
- C-c m i d – Set Microphone Down
- C-c m i u – Set Microphone Up
- C-c m n b – Set Noise Blanker
- C-c m n l – Set Noise Blanker Level
- C-c m p – Set Pre-Amplifier
Show below is the interactive mode for setting frequency on VFO-A, using C-c m f

C-c m f setting frequency to 14250 kHz
And here is another example setting the mode interactively using C-c m m

C-c m m Setting Mode interactively
Finally, here is an example setting Pre-Amplifier type using C-c m p

C-c m p Setting Pre-Amplifier type interactively
If you need to change the catmacs group settings, the customization buffer provides that capability. On Mac, the CAT interface appears under /dev/tty.SLAB-USBtoUART. You may need to change this if you are on another OS. This is what the customization looks like.
Awesome!! More time inside Emacs where I am productive!!
This package is also available via Melpa to make installation easier.
73’s de vk3fcs/km5ws