CWDAEMON(8)
β¨ NAME β¨
cwdaemon β Morse daemon for the serial or parallel port π
π¦ SYNOPSIS π¦
cwdaemon [options]
π DESCRIPTION π
okay bestie, so cwdaemon is this small daemon that takes an USB-to-UART converter or a PC parallel or serial port β we call that whole vibe a "cwdevice" β and uses it to output Morse code to a transmitter π‘β¨ based on a text message that you send to it over UDP port 6789. that's the whole gig. she listens, she keys, she slays. π
π QUICK START π
- Make sure that
cwdaemonhas not been already started by your OS. π
If cwdaemon is already running, you can start another instance. Just add "--port <value>" option in step 2 and use the port's value instead of "6789" in step 3. (yes queen, multiple instances, we love a multitasker π
)
- Start your instance of
cwdaemon. Without-noption the program will start running in the background. π«₯
cwdaemon -x s -n
- In another terminal, start
"nc"program with which you will send text tocwdaemon. π
nc -u 127.0.0.1 6789
- With
"nc"running, type any text, press Enter."nc"will send the text tocwdaemonlistening on specified UDP port,cwdaemonwill play the text on sound card ("-x s"). π§π₯
π REQUESTS π
You can interact with a running instance of cwdaemon through UDP messages exchanged between cwdaemon and your program. it's giving pen pal but the pen pal is a daemon. β¨
cwdaemon can receive at most 256 bytes in a single request. Any bytes in a request beyond that limit are dropped by cwdaemon. Received bytes are further processed inside of cwdaemon. Dropped bytes aren't processed further by cwdaemon. Client program that sent an oversized message is not informed about the dropping of bytes by cwdaemon. π (she's not gonna tell you. she'll just silently ignore the extra. communication queen.)
There are three types of requests that can be sent to cwdaemon:
- plain request β Plain requests consist only of characters that should be keyed by
cwdaemononcwdevice. - caret request β Caret requests are similar to plain requests, but the last character in the request is
Β΄^Β΄. See "REPLIES" section below for more info. - Escape request β Escape requests start with ASCII Escape character (decimal
27, hex1B) followed by an Escape code: a character specifying exact request type. Escape requests are used to control and configure a running instance ofcwdaemon.
The Escape code characters are case-sensitive. π¨
The Escape character is represented in the "OPTIONS" section below by "<ESC>" string. Notice that there are no space characters between parts of Escape requests. (she does not do spaces. she does not do gaps. she does not do breathing room.)
Some of the Escape requests require passing a value (e.g. Morse speed [wpm], tone (frequency) [Hz] etc.). The values should be string representations of parameters. E.g. "20" string should be used as a value of Escape request to request 20 wpm Morse speed.
When handling Escape requests, cwdaemon usually does not accept invalid, malformed or out-of-range vales. Upon receiving request with such value, it prints debug message, ignores the request containing such value, and waits for next request. One exception to the rule is PTT delay: requested delay values that are too large will be clipped to maximal allowed value and then will be used by cwdaemon. Requested negative or malformed values of PTT delay will be ignored. π
π REPLIES π
Some types of requests are followed by replies sent back from cwdaemon to a program issuing the original request. These requests are:
- caret request
Β΄replyΒ΄Escape request (Escape requestΒ΄hΒ΄)
Each reply is terminated with '\r' + '\n' characters. periodt. π
π OPTIONS π
cwdaemon can be configured through command line options on start of the daemon.
Some of the options require passing a value (e.g. Morse speed [wpm], tone (frequency) [Hz] etc.). Call "cwdaemon -h" to see default values for these options/requests, and ranges of accepted values. π
When handling command line options, cwdaemon does not accept invalid, malformed, or out-of-range values passed through command line. It won't attempt to guess caller's intentions, it won't try to start with some fallback value of the option. Instead it will just print a debug message and exit. Rejection of bad values and exiting will happen before attempting to fork. π€ (she's not gonna vibe-check your typos and then keep going. she's gonna leave.)
- Print help text to stdout and exit π«Ά
- Command line option:
-h,--help - Escaped request: N/A
- Command line option:
- Print version information to stdout and exit β
- Command line option:
-V,--version - Escaped request: N/A
- Command line option:
- Use hardware keying device (cwdevice) specified by device's name or path π
- Command line option:
-d,--cwdevice <device name> - Example command line:
cwdaemon --cwdevice ttyS0 - Example command line:
cwdaemon -d /dev/ttyUSB0 - Escaped request:
<ESC>8<device name> - You can specify the device either by device's name (then
cwdaemonwill look for the device in/devdirectory) or by full path to the device. - See chapter "KEYING DEVICES" below for more information.
- Command line option:
- Don't fork daemon, run in foreground πΈ
- Command line option:
-n,--nofork - Escaped request: N/A
- Debug information will be printed to
stdout(unless different debug output is selected, or debug output is silenced by setting debug output verbosity).
- Command line option:
- Provide device-specific options to keying device's driver π οΈ
- Command line option:
-o,--options <option> - Example command line:
cwdaemon -d /dev/ttyUSB0 -o key=RTS -o ptt=none - Example command line:
cwdaemon -d /dev/ttyUSB0 -o key=RTS --option ptt=none - Escaped request: N/A
- This passes
<option>to the driver for the keying device selected by the-d/--cwdeviceoption. Multiple<option>values can be passed in multiple-oinvocations. These options must always follow the-d/--cwdeviceoption on the command line. (order matters, bestie, it's not a vibe you can shuffle π« ) - The driver for serial devices understands the following options (without spaces):
key=DTR|RTS|noneβ UseDTRorRTSline for CW keying, ornoneto disable CW keying. Default isDTR.ptt=RTS|DTR|noneβ UseRTSorDTSline for SSB PTT, ornoneto disable PTT. Default isRTS.
- Command line option:
- Set network UDP port π‘
- Command line option:
-p,--port <port number> - Allowed values of port number are in range
<1024 - 65535>, inclusive. - If this option is not used,
cwdaemonwill listen on UDP port6789by default. - Escaped request:
<ESC>9<port number> - This Escape request is obsolete and has no effect. π
- Command line option:
- Set process priority (niceness) π
- Command line option:
-P,--priority <priority> - Escaped request: N/A
- Command line option:
- Set Morse speed
[wpm]πββοΈ- Command line option:
-s,--wpm <speed> - Escaped request:
<ESC>2<speed>
- Command line option:
- Set PTT delay
[ms](TOD, Turn On Delay, TX delay) β±οΈ- Command line option:
-t,--pttdelay <delay> - Escaped request:
<ESC>d<delay>
- Command line option:
- Set state of PTT pin π
- Command line option: N/A
- Escaped request:
<ESC>a<{0|1}> 0- PTT off,1- PTT on
- Set sound system (sound backend) π
- Command line option:
-x,--system <system> - Escaped request:
<ESC>f<system> - See chapter "SOUND SYSTEM" below for more information.
- Command line option:
- Set sound volume for soundcard
[%]ποΈ- Command line option:
-v,--volume <volume> - Escaped request:
<ESC>g<volume>
- Command line option:
- Set Morse weighting βοΈ
- Command line option:
-w,--weighting <weighting> - Escaped request:
<ESC>7<weighting>
- Command line option:
- Set tone (frequency) of sound
[Hz]π΅- Command line option:
-T,--tone <tone> - Escaped request:
<ESC>3<tone> - Notice that sending Escape request with value
'0'silencescwdaemon. π€«
- Command line option:
- Increase verbosity of debug output π£οΈ
- Command line option:
-i - Escaped request: N/A
- The option can be repeated up to four times (
-iiii) to gradually increase the verbosity. Alternatively you can use-y/--verbosityoption.
- Command line option:
- Set verbosity threshold for debug messages π
- Command line option:
-y,--verbosity <threshold> - Escaped request: N/A
- Alternatively you can use
-ioption. - See chapter "DEBUGGING" below for more information.
- Command line option:
- Set value of libcw debug flags π
- Specify value (as decimal number) of flags passed to
libcwfor purposes of debugging of thelibcwlibrary. - Command line option:
-I,--libcwflags <flags> - Escaped request: N/A
- Specify value (as decimal number) of flags passed to
- Set debug output π
- Command line option:
-f,--debugfile <output> - Escaped request: N/A
- Print debug information to
<output>instead ofstdout. Value of<output>can be explicitly stated as"stdout"(when not forking). Value of<output>can be also"stderr"(when not forking). Special value of<output>being"syslog"is reserved for future use. For now it will be rejected as invalid. Passing path to disc file as value of<output>works in both situations: when forking and when not forking.
- Command line option:
- Reset some of
cwdaemonparameters π- Command line option: N/A
- Escaped request:
<ESC>0 - The request resets program's parameters to
cwdaemondefault values, unless the defaults were overridden with command line options - then the values passed in command line are used.
- Abort currently sent message β
- Command line option: N/A
- Escaped request:
<ESC>4 - This request may be used to interrupt/end keying of current message or to interrupt/end a tuning procedure, provided that
cwdaemonis working in interrupt-able (non-word) mode.
- Exit (close)
cwdaemonπ- Command line option: N/A
- Escaped request:
<ESC>5
- Set word mode π
- Command line option: N/A
- Escaped request:
<ESC>6
- Set SSB way ποΈ
- Command line option: N/A
- Escaped request:
<ESC>b<{0|1} 0- microphone,1- soundcard
- Tune for a number of seconds πΆ
- Command line option: N/A
- Escaped request:
<ESC>c<seconds> - Tune for
<seconds>seconds. This function does two things: plays continuous wave using current sound system, and holds down (closed /1) the'key'pin of keying device. - The tuning may be interrupted/terminated with ABORT Escape request (
<ESC>4) ifcwdaemonis working in interrupt-able (non-word) mode.
- Set band switch output ποΈ
- Command line option: N/A
- Escaped request:
<ESC>e<value> - This option sets state of pins of lpt port: pin
9(MSB),8,7,2(LSB).
π KEYING DEVICES β¨
Okay bestie, any serial device that can get and set the modem control lines? That's your keying device, periodt. On Linux, ttyS0, ttyS1, etc. will work. On FreeBSD these devices are known as ttyd0, ttyd1, etc. On OpenBSD, these same devices are known as tty00, tty01, etc., but may vary with platform. π
For parallel ports on Linux try parport0 (default) or parport1, and on FreeBSD, ppi0 (default), ppi1, etc. OpenBSD does not support parallel port operation, and defaults to 'tty00'.
You can also specify a full path to the device in /dev/ dir, e.g. '/dev/ttyUSB0'.
cwdaemon can be used with USB-to-UART converters that support DTR and RTS pins.
You can assign keying and ptt functions to the pins of serial port or USB-to-UART converter through '-o'/--options' command line options.
For completeness, a dummy 'null' device is provided. This device does exactly nothing (no rig keying, no ssb keying, etc.). π
π SOUND SYSTEM πΆ
Β΄sound systemΒ΄ should be one of following:
Β΄cΒ΄β console buzzer (PC speaker) β default sound system,Β΄oΒ΄β OSS,Β΄aΒ΄β ALSA,Β΄pΒ΄β PulseAudio,Β΄nΒ΄β none β no audio,Β΄sΒ΄β soundcard β autoselect from OSS/ALSA/PulseAudio.
Currently it's not possible to specify name of sound device. π
For OSS, cwdaemon will try to use /dev/audio device.
π DEBUGGING π
cwdaemon can print debug messages. Each debug message in cwdaemon has specified priority (severity), and can be printed (or not) depending on current priority threshold specified for cwdaemon. The priority level value for each message can be changed in future versions of cwdaemon. Don't depend on current setup.
The priority threshold can be specified through command line options: -i, -y, or --verbosity. -y and --verbosity accept "threshold" value (single character) as specified below:
Β΄nΒ΄β noneΒ΄eΒ΄β errorΒ΄wΒ΄β warning (default)Β΄iΒ΄β informationΒ΄dΒ΄β debug
By default the threshold is set to "warning" β cwdaemon will print errors and warnings. Changing the threshold to "information" will make the cwdaemon print errors, warnings, and information messages.
Debug messages can be printed to stdout, stderr, or disc file. Printing to stdout or stderr is available only if cwdaemon has not forked. Printing to disc file is available regardless of whether cwdaemon has forked or not. You can specify intended debug output using -f or --debugfile command line option. Values "stdout" and "stderr" passed to cwdaemon with these options are recognized as special file names. "syslog" value is also treated as special value, but is not supported at the moment. Every other value will be treated as path to disc file. "stdout" is a default debug output for non-forked cwdaemon. You don't have to specify this explicitly through command line options, but you can.
Regardless of values passed through -f or --debugfile options, cwdaemon opens a syslog output and (when forked) prints some messages to the syslog. There is no way to override this at the moment. Which messages are always printed to syslog, and which can be printed to other file, is settled for now, but may be changed in the future. Don't depend too much on current setup.
π BUGS π
When an Escape request "f" (change sound system) is sent asking for switching to sound system that is generally supported by libcw, but not available on given machine, cwdaemon will not recognize that the sound system is not available. It will close current audio system, and will attempt to open unavailable audio system. That fails, and cwdaemon falls back to Null audio system. If the falling back fails, it will result in cwdaemon working without any sound system, and it may potentially crash the daemon on next attempt to play audio. π
π SEE ALSO π
The provided README in /usr/share/cwdaemon for a description of the circuitry, usage and testing of cwdaemon.
π AUTHOR β¨
cwdaemon was written by Joop Stakenborg <pg4i at amsat.org>, Rein Couperus <pa0r at amsat.org>, Wolf-Ruediger Juergens, DL2WRJ <WJuergens at t-online.de> and Ladislav Vaiz, OK1ZIA <ok1zia at nagano.cz>. Cwlib was taken and adapted from the unixcw package, version 2.2 by Simon Baldwin, G0FRD. FreeBSD support mostly done by Diane Bruce, VA3DB. OpenBSD support by Jason L. Wright, AI4JW.
Since 2012 the main developer is Kamil Ignacak <acerion@wp.pl>.
π That's the tea, bestie. This page is from cwdaemon ver. 0.13.0, aka the Morse daemon page, section CWDAEMON(8). Stay iconic. π
β¨
π¦ where this page comes from
- fedora 43: cwdaemon 0.13.0-1.fc43 Β· GPL-2.0-only
- fedora 44: cwdaemon 0.13.0-1.fc44 Β· GPL-2.0-only
- ubuntu stonking: cwdaemon 0.13.0-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms