9
May
2020
Using Xastir for APRS on Linux
14:57

Using Xastir for APRS on Linux

9 May 2020 14:57

This article is about setting up the Xastir program for amateur radio packet transmission of GPS coordinates called APRS on the terrestrial frequency 144.800 MHz.

Introduction

APRS is a system for transmitting coordinates and short messages in amateur radio broadcasts based on the digital form PACKET. The APRS network consists of amateur radio APRS stations, on-air packet relays (Digipeater or, in short, digi) and receiving (RX-only) or bidirectional (RX/TX) I-Gates to the global computer network Internet. 100% of the messages are regional in nature - the icons on the map indicate stations, including moving ones. It is possible to transmit text messages similar to SMS or news (immediately to all stations, or stations of a certain group).

Linux has all the necessary components to work in the VHF APRS network - as a node, digital repeater or bridge from the air to the Internet i-Gate. The AX.25 message passing system has actually been part of the Linux kernel for a long time, so Linux is in many ways preferable to Windows for implementing APRS. With the development of Raspberry PI microcomputers, new versions of programs and packages for APRS under the Linux operating system began to be released. All programs run both on Raspberry PI and on desktop computers, because... the source texts are the same.

Xastir is a universal tool for working with APRS on a desktop computer:

  • display information about stations on a detailed map of the area
  • sending and receiving messages (including service messages) through the transceiver interface, i.e. on air
  • automatic processing of requests from other stations (including answering machine)
  • management of ports of KISS modems and external TNC modems
  • maintaining a queue of messages, a list of heard stations, etc.
  • displaying various icons of any APRS objects or their traces (“tracks”), drawing azimuths at the station, determining distances.
  • management of topographic maps (selection, downloading from the Internet, caching)
  • message logging.
  • and much more. :-)

Xastir can work in different ways:

  • via Internet TCP-IP
  • via radio, using software KISS or hardware modem (TNC), or network modem MKISS.

I am considering an option here - transmitting and receiving APRS through a radio station (transceiver) at a frequency of 144.800 MHz using software kISS/soundmodem modem, which can generate and decode an audio signal with AFSK 1200 modulation.

Installing and configuring Xastir and Soundmodem

1. We install all the necessary programs

su -
apt update
apt install xastir soundmodem

Note: During installation on a clean Debian system, a window appeared asking you how to run the program.

selecting AX-25 option
ВыбI chose the first option -"Yes", allow unprivileged users to use AX.25. User group 'xastir-ax25'.

2. We give rights to run the program

To run xastir, you need 4755 permissions - where 4 means giving root permissions to the program when appropriate.

As root (sudo) you need to run the following commands:

su -
chmod 4755 /usr/bin/xastir
usermod -a -G dialout user

(where "user" - replace with the name of the account you usually work under (for example, vladimir))

usermod -a -G xastir-a25 user

(where “user” is replaced with the name of the specific user under whose account you are working (for example, vladimir)).

logout

3. Launch the program and perform preliminary setup

xastir

The xastir program should run fine without root rights. If startup with normal user rights does not happen, see point 2.

window

In the configuration window, indicate your call sign with the prefix minus one: "-1"(SSID -1 means main QTH or "home" station) and station coordinates - latitude and longitude, antenna power and gain.
In the LONG longitude field, instead of W, enter the letter E - eastern hemisphere.

To find out the coordinates of your home, you can use the QTH locator map TK5EP:

  1. Go to TK5EP: and find your QTH on the map.
  2. In the second browser window, open the site page Traveleu.ru, enter numbers in the form fields,
  3. The coordinates obtained using the TK5EP service in the form 59° 56' 26.44 " 30° 15' 09.45" can be converted to another form on TravelEU by clicking on the "Convert" button.
  4. The result - coordinates in the form 59° 56.441' 30° 15.158' is entered from the keyboard into the Xastir program window.
  5. Don't forget to change the sign of the eastern hemisphere - E

There is a simplified way - indicate in Xastir approximate coordinates accurate to degrees, for example 60 N 30 E, and move the station to the desired location using the mouse - see the next paragraph "4. Setting up an area map".

It should look something like this:
window2
Click OK

4. Setting up an area map

Using the mouse, select the rectangle with the section of the map where the call sign is marked (where we are). This fragment will be scaled to fill the entire screen.
map . If necessary, use the In and Out buttons at the top of the window to set the desired map scale.

In the "Map" - "Map chooser" menu you can change the map type from a simplified vector to a more beautiful, topographic OpenStreetMap: specify osm_tiled_fosm.geo and click OK.
A new map will be downloaded via the Internet.
karta2

If you need to move the station icon to another point, zoom in using the In/Out buttons and the arrow buttons (right - left, up - down), place the cursor at the desired point and press the right mouse button. Select context menu item "Move my station here" - "Move my station here".
moving station marker

6. Determining the name of the COM port to control the transceiver

  • Disconnect cable Yaesu CT-62 (or RPC-Y857) - a cable that provides control of the transceiver via the COM port) from the USB port of the computer
  • launch dmesg remember the last lines.
  • Connect cable Yaesu CT-62 (or RPC-Y857) - a cable that provides control of the transceiver via the COM port) to the USB port of the computer.
  • launch dmesg look at the last lines - there should be a mention
    /dev/ttyUSB0 or /dev/ttyUSB1. Copy this value (CTRL+C).

    5. Setting up soundmodem

To configure the modem you need to run the program soundmodemconfig from the superuser shell su:

su
soundmdemconfig

Create a new configuration File - New - Configuration

Specify the configuration name -KISS and press OK.
config KISS

Double-click on the created configuration.
On the first tab we indicate the operating mode alsa.

Before the next setting, find out the name of the sound card in the terminal:

aplay -l

From the command output you can guess that the system has two sound cards 0 - built-in and 1 - external.
the first of which is designated 0.0, and the second 1.0.

In the field "Alsa audio driver" we indicate "plughw:1.0" if it is an external (USB) sound card or "hw:0.0" for built-in.
Alsa

You need to check the box Half duplex- turn on.

In the field "PTT driver" insert Ctrl+V port name /dev/ttyUSB0

In the field "Hamlib model" indicate the number. For Yaesu FT-857 this number is 1022- a new, up-to-date HamLib model identifier FT-857 (the old number 122 is no longer suitable). A complete list of models is available on the page
Supported-Radios.

In the field "Rig configuration parameters" I entered "serial_speed=38400" - corresponds to the speed of the transceiver's serial port in menu 019:38400bps.

Note: CAT control can operate at any speed you specify - 4800, 9600 or 38400 bps. The main requirement is that the speed of transmission of commands from the radio station and the serial COM interface of the computer match. Then, you need to set the speed in the transceiver menu as in the program so that they are equal.


Create a channel: menu item "File" - "New" - "New channel"
Select a new channel "Channel 0", specify the modulation type AFSK, speed 1200, frequencies 0 - 1200 Hz, 1 - 2200 Hz.

  • Mode -AFSK
  • Bits/s -1200
  • Frequency 0 -1200
  • Frequency 1 -2200
  • Differential encoding - checkbox installed(included)
    afsk modulator

On the tab "Demodulator" we indicate the same as on the bookmark "Modulator".
afsk demodulator

On the tab "Packet I/O" we indicate the type -KISS
Set the file name:
/dev/soundmodem0
afsk modem
Check mark against "unlink file" must be installed.

You cannot check the boxes for "init KISS on startup" and "full duplex" - uncheck them.


We perform sound diagnostics.

  1. We connect the cable from the DATA connector of the radio station to the sound card, the CT-62 control cable to the CAT connector.
  2. Select channel Channel0 in SoundmodemConfig
  3. Turn on the receiver in PKT (FM) mode, open the noise suppressor (Squelch).
  4. In the menu, execute the item "Diagnostics" - "Scope"
    If the modem is configured correctly, no errors will occur. A white noise spectrum with a good level will be output.
    diagnostics

If an error occurs "Cannot start audio I/O"(which often happens when running a program that already uses sound):

  1. Close the browser and other programs that use sound.
  2. Quit soundmodem (Ctrl+C).
  3. Stop the PulseAudio server under a user account (not root) using a terminal command "pulseaudio -k".

Ultimately, you need to ensure that there are no errors and correct operation of the signal spectrum diagnostics: KISS - Channel 0 - Display - Scope

After setting up soundmodem, be sure to save its settings: File - Quit.

If errors occur during testing, check that the field named plughw:1.0 of the sound card is filled in correctly, and also use the recommendation to restart pulseaudio -k.

If the input signal level is weak, check the wire connections (to the external or internal sound card) and the corresponding sound card name.


In the terminal, launch soundmodem under the administrator account su - this is more reliable:

su -
soundmodem

Diagnostic messages must not contain errors:

read_block(): RX 1 bytes

0000 f0

ft857: ack received (-16)

rig_force_cache_timeout called

ALSA: Using sample rate 9600, sample format 2, significant bits 16, buffer size 4800, period size 144

ALSA: Using sample rate 9600, sample format 2, significant bits 16, buffer size 4800, period size 144

Fixing configuration errors

If there are errors, we look into the CAT port name /dev/ttyUSB0 or /dev/ttyUSB1, using the dmesg command, and correct the soundmodemconfig configuration (on behalf of su).

  1. If the error "sm[1570]: cannot start PTT output"
  • This error means that soundmodem was unable to send control commands to the transceiver.
  • Checking CAT RATE
  • Checking the transceiver model:

    su
    soundmdemconfig

On the KISS - ISO tab, change the parameter for ttyUSB0:

serial_speed=38400

see picture.

io

Also,need to check the model number according to the table Supported Radios

After changing the COM port speed, save the soundmodem configuration: File-Quit.

run soundmodem again, only under the user:

sudo soundmodem
  1. If the error "alsa: Error opening PCM device plughw:1.0"
  • ДThis alsa error means that soundmodem cannot connect to the plughw:1.0 device. You need to close the browser and other programs that work with sound and run the command:

    pulseaudio -k


!!!Execute xastir: "Start" - "Amateur Radio" - xastir

In the Interface - Interface control menu we configure:

*Add
*Serial Kiss TNC
Add
TNC Port-/dev/soundmodem0*
4800
Allow transmitting
Disable all IGate traffic**
WIDE 2-2
OK

In the "Comment" field you can enter a short explanation (it is not broadcast). For example, "LOCAL" - for 144.800.

Interface menu

Close the interface parameters form. Select the newly created interface in the "Interfaces" list and press the "Start"
After which the interface will be transferred from the DOWN state to the operating mode U.P..

If the interface has not entered the UP state, it means that the transceiver is not turned on, soundmodem is not running, or the wrong name is specified in the interface properties: check the value /dev/soundmodem0 .


The program setup is complete!

Transceiver setup

Frequency - 144.800, use the "Lock" button to block its change with the encoder.
Using the buttons on the front panel of the transceiver, I switched the mode to "PKT" (meaning PACKET).
Menu "071 PKT 1200" - the gain value is left default value 50, because at low levels of PKT 1200 = 1-2 on WebSDR it can be seen that the transmit power is lower.

Execute the main command:
!!Interface - Transmit Now!

A packet was transmitted, the digital repeater received it and responded (a similar short sound on the air).

I check the success of the APRS transmission on the website https://aprs.fi
.

Improving the quality of reception and transmission

The quality of communication in PACKET mode is affected by the volume or gain of the sound card, but not as much as in SSB.

  1. Launched on the computer alsamixer(on behalf of su -), selecting the sound card in it (F6), set the playback volume to 20%, recording level value at 7%, since the sound through the USB card was too loud.
  2. Left from alsamixer using the ESC key.
  3. Saved the value in the configuration file alsactl store also on behalf of su -.
  4. Launched soundmodem.
  5. Start - Amateur Radio - Xastir.
  6. In "interface" - Start.
  7. I picked up a portable radio station tuned to 144.800.
  8. Performed an APRS "Transmit now" transfer in Xastir,
  9. I observed my signal in WebSDR and heard the response from the digital repeater over the speaker.
    10.As for reception, you can check it in the Scope mode of the soundmodemconfig utility under the superuser su.
    Or in the "View" - "All Stations" menu, where after receiving packets from the air, new stations should appear.

Frequency of transmission

The packet transmission period is specified in the menu "File" - "Configure" - "Timing", for a stationary object it is set to 30 minutes.

Continued

The second article will talk about working through the ISS 145.825 MHz and other satellites at 145.825 MHz and briefly about APRS on short waves 10.1 and 14.1 MHz.

It is also possible to replace the "soundmodem" modem with a more advanced, sensitive modem "Direwolf".



Related publications