Configuring CW keyer
Configuring CW keyer
Many recent radio transceiver models support keying morse code directly from text using a special control command. Keying morse code from text using radio control commands does not require additional configuration settings.
However, additional configuration settings for CW keying are required:
for radio transceiver models that use RS-232 port RTS/DTR control lines for keying CW or ones that have a separate port/connector for CW keyer.
if you wish to use a physical morse key with Web Radio Control via a USB morse key adapter. Radio transceiver models with a USB connection also use RS-232 serial port RTS/DTR control lines for keying morse code to support external CW keyers. The Icom IC-7300 is an example of such radio.
In order to support the use cases above, Web Radio Control server software performs keying of morse code, which allows keying CW from text and based on signals coming from a physical morse key.
Configuring CW keying via RS-232 serial port or a USB serial port connection does not require building of any additional electrical connections between the radio and Raspberry Pi. Such connections are necessary only in use case 1, if the radio requires use of a separate CW keyer port/connector, which is controlled via a Raspberry Pi GPIO pin or via RTS/DTR control line of a separate USB — RS-232 adapter. In this case, you will need to build a suitable electrical connection from either the GPIO pin or the USB — RS-232 adapter control line to the radio CW keyer port. Please note that it is necessary to use an optical isolator when connecting Raspberry Pi GPIO pins to external devices in order to protect the GPIO connections from damage.
Keying via RS-232 serial port control line
If the radio transceiver model uses RS-232 serial port RTS/DTR control lines for keying CW, you will need to
add configuration settings for the serial port and the control line to the configuration file. If the radio
has a USB connector, like the Icom IC-7300 does, separate USB — RS-232 adapter is not necessary, since
radios with USB connectivity usually perform CW keying via the same serial port, which is used for control commands
(already defined in the
Connecting radios with a USB port:
with USB port] end
Connecting radios with an RS-232 serial port:
serial port adapter) ADAPTER -->|RS-232
serial cable| RADIO subgraph Radio transceiver RADIO[Radio transceiver with
RS-232 serial port] end
Add the following definitions to the end of the configuration file and replace the placeholders:
externalDeviceInterface: serial: switches: name: "radio-cw-key" device: "SERIAL_PORT_DEVICE" pin: "CONTROL_PIN"
radio-cw-key- An identifier for the hardware pin used for CW keying. The identifier is used internally by Web Radio Control to distinguish between pins that control devices. You can choose the identifier freely, but it makes sense to include the radio model in the ID. Note that the ID may only contain characters A-Z, a-z and 0-9. Example:
SERIAL_PORT_DEVICE- Serial port reference for CW keying in URI reference format.
The setup user interface lists all detected serial ports and adapters under title
Serial ports (for device control), see the screenshot below. Find the serial port that is connected to the radio from the list of serial ports and copy the text from the
URI referencecolumn here. Each URI reference has either an
The list of serial ports identifies USB serial port adapters with
tty, usbin the
Subsystem, busfield. Radio models with a USB connector will usually have the radio model and some form of serial number in the
id:URI reference, although there is no general rule on what the URI references will look like. With multiple radios of the same model or when using USB — RS-232 adapters it is usually not possible to know which serial port is connected to which radio, so you will have to test each URI reference.
If the radio has a USB connector, like the Icom IC-7300 does, separate USB — RS-232 adapter is not necessary, since radios with USB connectivity usually perform CW keying via the same serial port, which is used for control commands (already defined in the
CONTROL_PIN- RS-232 serial port control line used for CW keying: either
In addition to the above configuration, you will need to add the following reference to the
devices listing for the radio
you wish to used the CW keying functionality with (and pay attention to the number of spaces in the beginning of the lines):
morseKeyer: switch: name: "radio-cw-key"
radio-cw-key- Reference to the identifier of the hardware pin to use for CW keying. This needs to be the same ID as defined in the above configuration.
The full configuration should look like the example below:
... (continued) devices: - id: "radio1-id" type: "rigctld" rigctld: localInstance: enabled: true model: RADIO_MODEL_NUMBER rigDevice: "SERIAL_PORT_DEVICE" serialSpeed: SERIAL_SPEED morseKeyer: switch: name: "radio1-cw-key" ... (continued) ... (continued) externalDeviceInterface: serial: switches: name: "radio1-cw-key" device: "SERIAL_PORT_DEVICE" pin: "DTR" ... (continued)
Keying via GPIO pin
Web Radio Control can also perform CW keying via GPIO pins, which Raspberry Pi exposes in the GPIO header connector. The website pinout.xyz provides a more detailed description of the pins and their uses.
Using a GPIO pin to do CW keying is usually necessary only, if the radio transceiver model has a separate CW keyer port connector and you don’t have an extra USB — RS-232 adapter that you could use to perform keying via the serial port control lines. In this case, you will need to list the available GPIO pins in the setup user interface and choose one of the pins for CW keying. You will also need to build a suitable electrical connection from the GPIO pin and the GND ground pin to the radio CW keyer port via proper optical isolation to keep the GPIO pins safe.
The GPIO pin voltages in Raspberry Pi devices are 3.3V (indicating CW carrier on) and 0V (CW carrier off).
NOTE The GPIO pins are very sensitive to voltage and in most devices they are directly connected to the main processor GPIO lines without any additional protection. In order to protect the processor and the GPIO pins, it is necessary to use proper current limiting resistors and optical isolation when connecting the pins to any external device. Also note that the GPIO pins in Raspberry Pi have a maximum source current of 16 mA per pin and total source current of 50 mA for all of the pins.
Simplified diagram for connecting GPIO pin to a radio with a separate CW keyer port:
GPIO pin and GND
in GPIO connector] end GPIOPIN -->|Leads| OPTO(Opto-isolator) OPTO -->|Leads| KEYERCONN subgraph Radio transceiver KEYERCONN[Radio CW keyer connector pins,
usually KEY and GND] end
Add the following reference to the
devices listing for the radio you wish to used the CW keying functionality with
(and pay attention to the number of spaces in the beginning of the lines):
morseKeyer: switch: name: "CW_KEY_GPIO_PIN"
CW_KEY_GPIO_PIN- The name of the GPIO pin to use for CW keying. The Web Radio Control setup user interface lists the GPIO pin names under title
External hardware control switches. For example, the Raspberry Pi GPIO pins have names
nnis the pin number, e.g.
The full configuration for a radio using a GPIO pin for CW keying should look like the example below:
... (continued) devices: - id: "radio1-id" type: "rigctld" rigctld: localInstance: enabled: true model: RADIO_MODEL_NUMBER rigDevice: "SERIAL_PORT_DEVICE" serialSpeed: SERIAL_SPEED morseKeyer: switch: name: "GPIO17" ... (continued)