AB3AP K3 CLI

I seem to be in a tiny minority of computer users who enjoys the command line interface (CLI). It doesn't look flashy, to say the least, but is fast and powerful. In the case of k3.py I created a handful of single letter commands with optional arguments. Generally, the command alone retrieves a value, and the same command with an argument sets a value.

Requirements

I use the free and excellent anaconda distribution of python3 because it comes with many useful libraries. If you choose to use it, use the anaconda commands to then install:

For non-anaconda installs, please Google to find how to do it for your OS.

Download Software

Put both of my python files below in the same directory. (If you're experienced with python, libK3.py can be anywhere so long as it's mentioned in your PYTHONPATH env var.)

Run It!

Once python and pyserial are installed, run k3.py. Type 'h' or '?' for a list of available commands. It will try to connect to /dev/ttyUSB0 serial port. If you're using a different one, start it this way:

k3 -d mySerialPort
where of course you replace mySerialPort with the appropriate port.

Examples

I add occasional comments after a triple pound string, ###.

ab3ap$ k3.py
k3$ h
k3.py for interactive mode.  Commands:

   a              display VFO A frequency.
   a f_kHz        set VFO A to f_kHz.
   a f_kHz s_kHz  set VFO A to f_kHz,
                  set VFO B to f_kHz + s_kHz,
                  enter SPLIT mode.
                  (Exit SPLIT when s_kHz = 0.)
   b [...]   as above for command 'a'but for VFO B.
   c text    send cw text.
   d         display serial device.
   h or ?    this message.
   f         flip VFO A/B settings.
   k         display keyer speed.
   k wpm     set keyer speed to wpm.
   m [mode]  change mode based on freq.
   n         use normal bandwidth for mode.
   p [pwr]   get/set transmitter power in Watts.
   q         immediately kill 'c' cw generation.
   s [s_kHz] split from current frequency by s_kHz.
   S         display rig serial number.
   t         toggle test mode on/off.

k3$ a		### Retrieve VFO A frequency.
10 106.2
k3$ b		### Retrieve VFO B frequency.
10 118.02

k3$ a 14028	### 'a' command with arg moves to that freq
k3$ a
14 028.0

k3$ s 1		### Go into split mode, up 1 kHz
k3$ a
14 028.0
k3$ b		### You can't see it, but the K3 is now in SPLIT
14 029.0
k3$ s		### 's' with no arg exits split mode

k3$ a 14030 2	### Another way to go into split
k3$ a
14 030.0
k3$ b
14 032.0

k3$ k		### Check keyer speed
24 wpm
k3$ k 28	### Change keyer speed
k3$ k
28 wpm

k3$ t		### Go into TEST mode (tx off)
k3$ t		### Toggle out of TEST mode (tx on now)
k3$