Scroll to navigation

CWDAEMON(8) System Manager's Manual CWDAEMON(8)

NAME

cwdaemon - morse daemon for the serial or parallel port

SYNOPSIS

cwdaemon [options]

DESCRIPTION

Cwdaemon is a small daemon which uses the pc parallel or serial port and a simple transistor switch to output morse code to a transmitter from a text message sent to it via udp port 6789.

OPTIONS

cwdaemon can be configured either through command line arguments on start of the daemon, or through requests (escaped requests) sent over network. Each escaped request starts with ASCII Escape character (decimal 27, hex 1B). The Escape character is represented in the list below by "<ESC>" string. Notice that there are no space characters between parts of escaped requests.

Some of the arguments and requests require passing a value (e.g. Morse speed [wpm], tone (frequency) [Hz] etc.). Call "cwdaemon -h" to see default values for these arguments/requests, and ranges of accepted values.

When handling command line arguments, 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 argument. Instead it will just print a debug message and exit. Rejection of bad values and exiting will happen before attempting to fork.

When handling escaped requests, cwdaemon usually does not accept invalid, malformed or out-of-range vales either. But instead of exiting upon receiving request with such value, it simply 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.

Command line argument: -h, --help

Escaped request: N/A

Command line argument: -V, --version

Escaped request: N/A

Command line argument: -d, --cwdevice <device>

Escaped request: <ESC>8<device>

See chapter "DEVICES" below for more information.

Command line argument: -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 argument: -p, --port <port number>

Escaped request: <ESC>9<port number>

This escaped request is obsolete and has no effect. Command line argument works as expected.

Command line argument: -P, --priority <priority>

Escaped request: N/A

Command line argument: -s, --wpm <speed>

Escaped request: <ESC>2<speed>

Command line argument: -t, --pttdelay <delay>

Escaped request: <ESC>d<delay>

Command line argument: N/A

Escaped request: <ESC>a<{0|1}>

0 - PTT off, 1 - PTT on

Command line argument: -x, --system <system>

Escaped request: <ESC>f<system>

See chapter "SOUND SYSTEM" below for more information.

Command line argument: -v, --volume <volume>

Escaped request: <ESC>g<volume>

Command line argument: -w, --weighting <weighting>

Escaped request: <ESC>7<weighting>

Command line argument: -T, --tone <tone>

Escaped request: <ESC>3<tone>

Notice that sending escaped request with value '0' silences cwdaemon.

Command line argument: -i

Escaped request: N/A

The argument can be repeated up to four times (-iiii) to gradually increase the verbosity. Alternatively you can use -y/--verbosity option.

Command line argument: -y, --verbosity <threshold>

Escaped request: N/A

Alternatively you can use -i option.

See chapter "DEBUGGING" below for more information.

Command line argument: -I, --libcwflags <flags>

Escaped request: N/A

Command line argument: -f, --debugfile <output>

Escaped request: N/A

Print debug information to <output> instead of stdout. 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 argument: N/A

Escaped request: <ESC>0

The request resets program's parameters to cwdaemon default values, unless the defaults were overridden with command line arguments - then the values passed in command line are used.

Command line argument: N/A

Escaped request: <ESC>4

Command line argument: N/A

Escaped request: <ESC>5

Command line argument: N/A

Escaped request: <ESC>6

Command line argument: N/A

Escaped request: <ESC>b<{0|1}

0 - microphone, 1 - soundcard

Command line argument: N/A

Escaped request: <ESC>c<seconds>

Tune for <seconds> seconds. The tuning is performed by both selected sound system, and by current hardware keying device.

Command line argument: N/A

Escaped request: <ESC>e<value>

This argument sets band switch output on parport bits 9 (MSB), 8, 7, 2 (LSB).

DEVICES

Any serial device that supports getting and setting the modem control lines can be used. 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'.

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 system,
´o´ - OSS,
´a´ - ALSA,
´p´ - PulseAudio,
´n´ - none - no audio,
´s´ - soundcard - autoselect from OSS/ALSA/PulseAudio.

DEBUGGING

cwdaemon can print debug strings. Each debug string in cwdaemon has specified verbosity (verbosity level), and can be printed (or not) depending on current verbosity threshold specified for cwdaemon. The verbosity level value for each string can be changed in future versions of cwdaemon. Don't depend on current setup.

The verbosity threshold can be specified through command line arguments: -i, -y, or --verbosity. -y and --verbosity accept "threshold" value (single character) as specified below:

´n´ - none
´e´ - errors
´w´ - warnings (default)
´i´ - information
´d´ - details

By default the threshold is set to "warnings" - cwdaemon will print all errors and warnings. Changing the threshold to "information" will make the cwdaemon print errors, warnings, and information.

Debug strings 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 argument. Values "stdout" and "stderr" passed to cwdaemon with these arguments 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 arguments, but you can.

Regardless of values passed through -f or --debugfile arguments, cwdaemon opens a syslog file and (when forked) prints some (few) 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 escaped 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 is 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>.

Morse daemon ver. 0.10.2