SETHDLC(8)
π sethdlc β¨
okay so bestie, welcome to sethdlc β that's section 8 of the Linux Programmer's Manual, the packet-radio-flavored corner of it π. This is the little tool that gets and sets the port info for Linux HDLC packet radio modem drivers, and honestly? iconic. Let's get into it π«Ά
πΈ NAME πΈ
<hotpink>sethdlc</hotpink> β get/set Linux HDLC packet radio modem driver port information π
β SYNOPSIS β
sethdlc [ -bdhs ] [-i device]
sethdlc [-i device] -c cal
sethdlc -p [-i device] [ mode mode ] [ io iobase ] [ irq irq ]
[ dma dma ] [ dma2 dma2 ] [ serio seriobase ] [ pario pariobase ]
[ midiio midiiobase ] [ options options ]
sethdlc -a [-i device] [ txd txdelay ] [ txtail txtail ]
[ slot slottime ] [ ppersist ppersistence ] [ full ] [ half ]
π DESCRIPTION π
So sethdlc is this program that sets and/or reports the config info tied to a soundcard radio modem port. And like, what counts as "config info"? the modem type, which I/O port it's on, the IRQ, the DMA channel a particular modem port is using, and where to spit out a transmitter keying (PTT) signal β¨
Here's the vibe breakdown, no cap:
- With the
-poption βsethdlcsets and/or reports the port configuration π - With the
-aoption βsethdlcsets and/or reports the AX.25 channel access parameters. And yes bestie, these same parameters can also be set with thekissparmsutility π - With the
-coption βsethdlctells the driver to send a calibration pattern for cal seconds π¦
And if you run it without -p, -a and -c? Then sethdlc just stays in the foreground and displays received packets, main character energy π
. The AX.25 header gets decoded, and eventually a FlexNet compressed header too. CTRL-C terminates sethdlc β that's your exit, periodt. And if you specify additional options, sethdlc may display additional information π₯
β¨ OPTIONS β¨
sethdlc accepts the following options:
-bβ Trace the bits at the output of the demodulator, after RX clock recovery. Heads up: this option is only available ifsethdlcand the soundcard modem kernel driver are compiled with debugging support on. Super useful for driver debugging π§-dβ Trace DCD, PTT and other status information on stdout.sethdlcdisplays two times per second a line containing this information β-hβ Display an overview of the available command line parameters and exit π-iβ The device argument specifies the HDLC modem device which should be configured or interrogated. It will usually have the following form:bc[0-3]for the baycom driver andsm[0-3]for the soundcard modem driver π-sβ Trace the bits at the demodulator output, before the RX clock recovery, to stdout. Important: this option is only available the modem driver is compiled with debugging support on. It may not be available on some modem, such as thepar96π
π¦ PARAMETERS π¦
The following parameters can be assigned to a soundcard radio modem port π
tiny math note: all numerical parameter values are assumed to be in decimal unless preceded by "0x" β¨
modeβ sets the type of hardware and the operating mode of the driver.ser12andpar96are valid modes for the baycom driver. A star"*"may be added to enable software DCD. Themodestring format of the soundmodem driver is as follows:hw:mode.hwmay be eithersbc,wssorwssfdx. The first one specifies SoundBlaster compatible soundcards, the second one WindowsSoundSystem compatible hardware, and the third one WSS fullduplex operation (which currently works with Crystal Semiconductor ChipsetsCS423[126]). Themodeportion may beafsk1200orfsk9600. Optionally, the receive and transmit modes may be different (hw:txmode.rxmode) πioportβ sets the I/O port address. Typical values for theser12modem are0x3f8,0x2f8,0x3e8or0x2e8, for thepar96modem0x378,0x278or0x3bc, for thesbcmodems0x220and for thewssmodems0x530,0x608,0xe80or0xf40πirqβ sets the hardware IRQ number. Typical values for theser12modem are 4 and 3, for thepar96modem 7 or 5, for thesbcmodems are 7 or 5 and for thewssmodems, any free IRQ from the set 2, 7, 9, 10, 11 will do. The driver automatically configures the WSS soundcard to the correct IRQ πdmaβ sets the hardware DMA number. Typical values for thesbcmodems are 1 or 0 and for thewssmodems, any free DMA from 0 to 3 (except 2) will do. The driver automatically configures the WSS soundcard to the correct DMA. The Baycom modems do not need DMA βdma2β sets the second hardware DMA number. This is only needed for full duplex operation with the soundmodem driver πseriobaseβ optionally sets the address of a serial port, where the driver will output a PTT signal at theTxDandRTSpins, and a DCD signal at theDTRpin. As Baycom modems do have their own PTT pin, this parameter is not used by the Baycom modem driver πΈpariobaseβ optionally sets the address of a LPT port where the driver will output a PTT signal on theDATA0line and a DCD signal on theDATA1line. As Baycom modems do have their own PTT pin, this parameter is not used by the Baycom modem driver π«Άmidiiobaseβ optionally sets the address of a MPU401 compatible MIDI port, where the driver will output a PTT signal. Since the MIDI port is effectively an UART and therefore cannot output a DC signal, the output must be fed through a retriggerable monoflop with a period of about 15ms. Seehttp://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.htmlfor a sample schematic diagram. As Baycom modems do have their own PTT pin, this parameter is not used by the Baycom modem driver π§txdelayβ sets the transmitter keyup delay time. Unlikekissparms, the unit is tens of ms. This is the time the transmitter needs to switch its PA on and for its frequency synthesizer to settle. Typical values for a handheld transceiver are 200ms (i.e. 20), and for a good crystal driven transceiver 20ms (i.e. 2) π₯txtailβ sets the time PTT is held after the last packet. Unlikekissparms, the unit is tens of ms. Do not set this value to 0. Most modems need some extra time to actually clock the last bits out to the transmitter π€slottimeβ specifies how often the channel access algorithm is executed. Unlikekissparms, the unit is tens of ms. Unless you have very specific requirements, set this to 100ms (i.e. 10) πppersistβ sets how "eagerly" the station starts to transmit as soon as the channel gets free. The optimum value is 256 divided by the number of stations on the channel. (This should really be done automatically by the L2) πfullβ sets the modem to full duplex mode. Note: some modems do not actually support full duplex mode, in this case this parameter makes the modem start its transmission as soon as it gets packets from the upper layer, without waiting for the channel to become free. This is needed by some implementations of alternative channel access algorithms, e.g. DAMA πhalfβ sets the modem to half duplex mode β
π CONSIDERATIONS OF CONFIGURING BAYCOM PORTS π
Okay so this part matters, bestie: it is important to note that sethdlc merely tells the Linux kernel where it should expect to find the I/O port and IRQ lines of a particular serial port. It does not configure the hardware to use a particular I/O port π«Ά. In order to do that, you will need to physically program the serial board, usually by setting some jumpers or by switching some DIP switches π
This section will provide some pointers in helping you decide how you would like to configure your baycom ports β¨
The "standard MS-DOS" port associations are given below:
COM1, port 0x3f8, irq 4
COM2, port 0x2f8, irq 3
COM3, port 0x3e8, irq 4
COM4, port 0x2e8, irq 3
LPT1, port 0x378, irq 7
LPT1 (on hercules graphics adapter), port 0x3bc, irq 7
LPT1, port 0x278, irq 5
π¦ CONSIDERATIONS OF CONFIGURING SOUNDCARD RADIO MODEM PORTS π¦
Some cards need to be initialized before they act as a WSS or SoundBlaster compatible card. This driver does not do this π. You can use the standard linux sound driver, if compiled as a module. Just load the sound driver (insmod sound) and remove it again (rmmod sound). The card should then be configured for either soundblaster or WSS compatibility β. If this does not work for some reason, you'll have to write your own soundcard configuration utility. This is not as complicated as it sounds; it can be done from user space (but requiring root privileges) using ioperm and/or iopl π
It is important that the audio levels of your radio match those of the soundcard. To help achieve this, there are two utilities: smdiag and smmixer. See their respective manpage π
the drama: the sound driver and the soundcard modem driver are mutually exclusive, i.e. they cannot both access the same soundcard at the same time. Even worse, the sound driver reserves the soundcard as soon as it gets loaded. The souncard modem driver however reserves the card only when the interface is started, i.e. during ifconfig sm[0-3] up π
Also: 9600 baud may not currently work on SoundBlaster cards with DSP revision 4.x, i.e. SB16 and SB32 AWE. This is because they seem to not be fully backwards compatible π
π₯ CAUTION π₯
CAUTION: Using an invalid port can lock up your machine. fr fr, do not play with this one π
π SEE ALSO π
smdiag (8), smmixer (8), kissparms (8), linux/drivers/net/hdlcdrv.c, linux/drivers/net/baycom.c, linux/drivers/net/soundmodem.c π
π AUTHOR π
sethdlc was written by Thomas Sailer, HB9JNX/AE4WA (t.sailer@alumni.ethz.ch). Inspired by setserial β¨
and that's the whole page, bestie π«Ά this was Sethdlc 0.1, dated 27 April 2008 β go configure something iconic π π
π¦ where this page comes from
- alpine 3.24: ax25-tools-doc 1.1.0-r0 Β· GPL-2.0-or-later
- debian bookworm: ax25-tools 0.0.10-rc5+git20190411+3595f87-6
- debian trixie: ax25-tools 0.0.10-rc5+git20230513+d3e6d4f-3 Β· GPL-2.0-only
- ubuntu jammy: ax25-tools 0.0.10-rc5+git20190411+3595f87-5
- ubuntu noble: ax25-tools 0.0.10-rc5+git20230513+d3e6d4f-1build2 Β· GPL-2.0-only
- ubuntu questing: ax25-tools 0.0.10-rc5+git20230513+d3e6d4f-3
- ubuntu resolute: ax25-tools 0.0.10-rc5+git20230513+d3e6d4f-3build1 Β· GPL-2.0-only
- ubuntu stonking: ax25-tools 0.0.10-rc5+git20230513+d3e6d4f-3build1 Β· GPL-2.0-only
- Copyright 1996 Thomas Sailer (t.sailer@alumni.ethz.ch)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms