Baycom-and-RH6.2-HOWTO

v0.1, Jan 17 2004

How To reuse an old computer with a (serial) Baycom modem for a simple Packet Radio Station


Introduction

This document describes how to reuse an old computer with a serial Baycom modem or PC-Com modem for a simple console-based Packet Radio Station.

Who Would Want To Read This Guide

This is a guide for the Radio Amateur trying to find a useful application for some of the old, but not quite obsolete equipment collecting dust in the basement.
This HowTo assumes that its reader has a good deal of knowledge about using and installing Linux software, or at least knows how and where to get help. Basics like how to compile a kernel or how to edit config files are a must and not the scope of this document.
Since the intended hardware may be too slow for a GUI application, this HowTo describes a purely console-based packet terminal.

Disclaimer

This document EXCLUSIVELY describes the setup of a PR terminal with the prerequisites outlined in Prerequisites, it does NOT strive to give general information.
This is NOT a replacement for the AX25-HOWTO.
Most of the information in this HOWTO has been tested with the devices to which I have access and have proven useable.

Copyright

This document is copyright © 2004 Michael Hofmann.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation. The full text of the license can be found at http://www.gnu.org/copyleft/fdl.html

Back to Index

Prerequisites

What you need to start. Note that if you want to use different components, like a different OS, kernel, modem or even a different PC or serial port, you are on your own. No other components than outlined here have been tested.

Hardware

  • A PC, which in my case was a 386SX/25 with 16MB RAM and a 1GB SCSI harddisk, though anything newer/faster/more expensive would do. (Mine was a gift from someone who would have otherwise thrown it away)
  • A serial Baycom modem or PcCom modem attached to ttyS0 (the first serial port, or COM1 in DOS-speak), and to the transceiver.
  • Of course the necessary RF rig, in my case being a Kenwood TM-431E and a Lambda/4 vertical antenna.

    Software

  • RedHat 6.2 installed and configured to your needs. It is still available at www.linuxiso.org, but since it is a very old version, it may not be available for very much longer, so get it while you can.
  • The 2.2.25 kernel, from www.kernel.org or your nearest mirror thereof.
  • The libax25 libraries. Needed to provide the basic AX.25 functionality to applications.
  • The ax25-tools - providing sethdlc, mheardd, mheard, axparms, beacon and more.
  • The ax25-apps - providing call and listen, the basic test apps.
  • My startbaycom script - this starts and sets up the baycom driver and port.
  • The terminal application. I don't know of any other console app than LinPac, so this is what we are using.

    The packet-specific software may be found on the download page of my homepage, where I provide RPMs, slightly modified where needed, the start script and this document.

    Back to Index

    Compilation and Installation

    Kernel Setup

    I have used the 2.2.25 kernel, which is the latest to date (Jan. 2004) and probably will be forever, since the 2.2 branch has been abandoned in favour of the 2.4 and 2.6 kernels. If you are using the RH stock 2.2.14-5.0 kernel and something doesn't work, you are on your own.

    The most relevant options for our AX.25 configuration are:

    Loadable module support  --->
        [*] Set version information on all module symbols
        ...
    Code maturity level options  --->
        [*] Prompt for development and/or incomplete code/drivers
        ...
    General setup  --->
        ...
        [*] Networking support
        ...
    Networking options  --->
        <*> UNIX domain sockets
        ...
        [*] TCP/IP networking
        ...
    Amateur Radio Support --->
        --- Packet Radio protocols
        <M>   Amateur Radio AX.25 Level 2 protocol
        ...
        --- AX.25 network device drivers
        <M> BAYCOM ser12 fullduplex driver for AX.25
        <M> BAYCOM ser12 halfduplex driver for AX.25

    If you have previously compiled the kernel with "Set version information on all module symbols", you only need to "make modules modules_install" in case you later decide to add other modules.
    After you have recompiled the kernel and modules, install them, adapt your boot loader and reboot the machine.

    Software Installation

    While the kernel compiles, install the RPMs listed under Software, starting with libax25 to provide dependencies.
    Note that we are using these RPMs even though newer tarballs are available because some of those tarballs do not compile on stock RH 6.2.

    Configuration

    Edit /etc/conf.modules so that kmod, the kernel module loader, knows which modules are required:

    alias   bcsf      baycom_ser_fdx
    alias   net-pf-3  ax25

    Edit /etc/ax25/axports:

    # port callsign    speed paclen window description
      1 <YOUR_CALLSIGN> 1200 255    3      Baycom_modem 

    portname - is a text name that you will refer to the port by.
    callsign - this is obvious.
    baudrate - is the speed at which you wish the port to communicate with your modem.
    paclen   - is the maximum packet length you want to configure the port to use for AX.25 connections.
    window   - is the AX.25 window (K) parameter. This is the same as the MAXFRAME setting of many TNC's.
    description - is a free-form description of the port.

    Start Script

    Now copy the "startbaycom" script to /usr/local/bin and make it executable. You need to modify the script by adding your callsign.

    #! /bin/bash
    #
    setserial /dev/ttyS0 uart none                     # this frees the serial port for the packet driver
    sethdlc -i bcsf0 -p mode "ser12*" io 0x3f8 irq 4   # load the driver and set parameters
    sethdlc -i bcsf0 -a txd 200 slot 100 ppersist 40   # set the channel access parameters
    ifconfig bcsf0 hw ax25 <YOUR_CALLSIGN> up          # assign your callsign
    ifconfig bcsf0 192.168.13.13			   # assign an arbitrary IP address
    echo 100 > /proc/sys/net/ax25/bcsf0/t2_timeout     # set T2
    

    When complete, execute the script. Calling "ifconfig" (without any parameters) will now show you an additional network device named "bcsf0" with your callsign set as the hwaddress. The first "sethdlc" parameters tell it to use the serial port at the given address and interrupt, with 1200baud and software DCD (the "*" behind "ser12").
    The second "sethdlc" command sets the channel access parameters of bcsf0. In this case TxDelay to 200mS, SlotTime to 100mS and PPersist to 40ms.

    Automagic Start at Boot Time

    Not yet written.

    Back to Index

    Usage and Features

    If everything went well, your system is now already capable of receiving packet traffic. Just execute "sethdlc -i bcsf0" and watch what is going on. Abort with Ctrl-C.

    Test Tools

    The ax25-apps provide two very basic test tools that are ideally suited to get a quick insight.

  • listen - a monitor for AX.25 traffic. No configuration is necessary, just execute "listen -art". Check the man page for details and parameters.
  • call - a simple programme to make AX.25 connections. Execute "call 1 <Digi>", where "1" is the port designator as defined in /etc/ax25/axports and <Digi> is the digipeater or packet radio station you want to connect. Again, check the man page for details and parameters.
  • Application Software

    From the ax25-tools package, there is

  • mheard - displays recently heard callsigns. You need to start the "mheardd" daemon supplied by the same package before it can work. The daemon logs any callsigns it recognizes in /var/ax25/mheard/mheard.dat, so if you want to clear the list, delete this file.
  • beacon - transmits periodic messages over AX.25. Call "beacon 1 <Message>", where "1" is the port designator as defined in /etc/ax25/axports and <Message> is, who would have thought, the message you want to transmit. Without additional parameters, beacon will transmit this message every 30 minutes. The man page gives you more information about it.
  • To the best of my knowledge, there is only one console packet terminal available for Linux, which is called
  • LinPac.
  • At the time of this writing, the most recent version was LinPac-1.0pre4, available as tarballs, divided into a daemon and a terminal part.
    I have taken the liberty to compile the source with slight modifications on RH6.2 and repackage them into RPMs, so you can download and install them easily.
    When calling "linpacd" and "lpterm console" for the first time, the ~/LinPac-pre directory will be created in your home directory, holding various config files.
    Start LinPac as root or you may not have access permission to the baycom driver.
    The user configuration is beyond the scope of this document and left to the reader.

    Make sure to read the LinPac manual, for you have to edit several files before you can use it, at least station.data, init.mac and info.mac.
    Also note that you have to restart linpacd after editing the files so that the config files are effective.

    Back to
    Index

    General Tips

    Information on Baycom hardware is available at the Baycom web site.

    Troubleshooting

    If you get bad connection quality with lots of rejected packets, you may need to set the modulation level (on the mic line) on your modem. John Ackermann has a web site describing various ways how to get good results.

    You may also need to finetune some of the parameters in /proc/sys/net/ax25/bcsf0. These are run-time configurable kernel parameters that you can write to with the "echo" command. See
    next chapter.
    You may also need to change some channel access parameters, see below. The sethdlc man page is a good source of information for this.

    Don't forget to do a "depmod -a" if you want to use newly compiled modules without rebooting.

    Check your path settings ("echo $PATH") if programmes are not found.

    If you need further help, you may want to check the archives of the rec.radio.amateur.digital.misc Newsgroup or post your question there.

    Run Time Configurable Parameters

    The kernel allows you to change many parameters at run time. The contents of the files in the /proc/sys/net/ax25/bcsf0 directory each represent one configured parameter. Here is a brief description:

    FilenameValues DefaultMeaning
    ip_default_mode0=DG 1=VC0 IP Default Mode
    ax25_default_mode0=Normal 1=Extended0 AX.25 Default Mode
    backoff_type0=Linear 1=Exponential1 Backoff
    connect_mode 0=No 1=Yes1 Connected Mode
    standard_window_size 1 .. 72Standard Window. The maximum number of unacknowledged transmitted frames.
    extended_window_size 1 .. 6332 Extended Window
    t1_timeout1s .. 30s1000 (10s*100)T1 Timeout. How long to wait before retransmitting an unacknowledged frame.
    t2_timeout 1s .. 20s300 (3s*100) T2 Timeout. The minimum amount of time to wait for another frame to be received before transmitting an acknowledgement.
    t3_timeout 0s .. 3600s30000 (300s*100) T3 Timeout. The period of time to wait between sending a check that the link is still active.
    idle_timeout 0m or greater20m Idle Timeout. The period of time a connection can be idle before we close it down.
    maximum_retry_count 1 .. 3110 N2. How many times to retransmit a frame before assuming the connection has failed.
    maximum_packet_length 1 .. 512256 AX.25 Frame Length

    To set a parameter all you need to do is write the desired value to the file itself, for example to check and set the T2 Timeout you'd use something like:

    # cat /proc/sys/net/ax25/bcsf0/t2_timeout
    300
    # echo 100 >/proc/sys/net/ax25/bcsf0/t2_timeout
    # cat /proc/sys/net/ax25/bcsf0/t2_timeout
    100
    

    This is from a post of Bob, VK2YQA, to news://rec.radio.amateur.digital.misc:

      Shortening the max packet length gives better results in flaky conditions 
      because there is less time for the packet to be corrupted in.
      I'd accept the default settings as they appear in the proc filesystem, 
      set standard_window_size at 1 and thats it.
      

    Channel Access Parameters

    This is from the sethdlc man page:
      The txdelay (txd)  sets the transmitter keyup delay time.  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).
    
      The txtail sets the time PTT is held after the last packet. Do not set this
      value to 0. Most modems need some extra time to actually clock the last bits 
      out to the transmitter.
    
      The  slottime (slot) parameter  specifies  how  often  the  channel  access 
      algorithm is executed. Unless you have very specific requirements, set this 
      to 100ms.
    
      The 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. Default is 40.

    Bob again has some good advice:
      Ensuring that the TXDelay and TXtail is both long enough and short enough is 
      also important. I remember setting my TXD by changing the number dynamically 
      as a ping job was in progress, then adding about 10% when errors occurred. 
    My old IC2A used to run at around 30mS but an older relay based XTAL clunker needed 400mS. If you think it maybe a problem (and remember that the time also helps the other guy's squelch open) set it to something ridiculous like 1 second and see if the throughput improves.

    References

    Check out the AX25-HowTo for more information. But beware and take a good deal of scepticism with you when reading it, because some of the information therein is outdated or not applicable to our setup.

    For more ham radio or packet software, point your browser to http://radio.linux.org.au. The Hamsoft Linux Ham Radio Applications and Utilities Database attempts to maintain a complete list of amateur radio related applications for Linux.

    Feedback

    Please report Success, Failure, Errors and Typos to westbound <at> despammed.com.


    Back to Index