Python APRS Terminal

A simple Python GUI program to view APRS data from radio via serial port or Bluetooth. Easy to send messages and update status. Serial port and Bluetooth settings is available in settings panel. Autoscrolling feature is included to program so latest messages are always visible.


  • Graphical user interface for those who not like text only mode.
  • Decodes KISS frame
  • Decodes ax.25 U frame
  • Decodes MIC-E format
  • Decodes APRS symbol and displays it on screen
  • Decodes APRS compressed data formats
  • Removes old items from the map
  • Removes traces of moving objects on the map

Supported and tested Hardware

  • Supports virtually any TNC which supports real or virtual serial port and KISS protocol.
  • Tested with Mobilinkd TNC2 through Bluetooth (with virtual serial port).

How does it work

Program decodes KISS frame and then ax.25 frame and lastly MIC-E data if available. Result is printed on window with colorful notation.

HELP – What to do if it does not work somehow?

Program should work on Python version 2.7.xx and onward. Run it with command “sudo python” without quotes. Contact me. I’m willing to help on any questions and can even add some features to program if necessary.

Source code is available from GitHub.

APRS Weather Station

Automatic Packet Reporting System (APRS) is amateur radio -based system for sending and receiving short telemetry data locally. Local APRS stations can be seen at

Picture of my station.

My hardware is based on Raspberry Pi computer and home made antenna with Baofeng UV-5R+Plus handheld transceiver. There is also a diy cable between Raspberry and radio. It is made from handsfree headset. There is a galvanic isolation between audio lines and opto-isolator on the PTT line. PTT is connected to Raspberrys GPIO pin 26.

Add this line to Dire Wolf config file:


Galvanic isolation and attenuation is made with following circuit:

DS18B20 temperature sensor is connected to Raspberrys GPIO pin 4 with parasitic power supply.

You must also activate parasitic power supply by adding following lines to associated files:

In /etc/modules

w1-gpio pullup=1

In /boot/config.txt


And then reboot.

On Raspberry Pi there is Xastir and Dire Wolf software installed. They are connected together with networked AGWPE. Temperature data is gathered with self made Python code. It talks with Xastir by emulating WX200 weather station. Code is here.

# wx200, wx-200 weather station emulation and server
# Author:	Juha-Pekka Varjonen
# License:	GNU General Public License, Version 3

version = '1.0'

import argparse, socket, sys, datetime, time

parser = argparse.ArgumentParser(prog='', description='WX200emu is a weather station emulator and server for client software. Listens for client connections and sends the 1-wire temperature data out to those clients.')
          help="host name or ip address, e.g. localhost")
          help="port number, e.g. 9753",
parser.add_argument("id", help="1-wire sensor 64-bit serial number")
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose",
          help="increase output verbosity",
group.add_argument("-q", "--quiet",
          help="do not display any message",
parser.add_argument('-V', '--version', 
          version='%(prog)s ' + version)
args = parser.parse_args()

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Bind the socket to the port
server_address = (, args.port)
if args.verbose:
  print('starting up on %s port %s' % server_address)
  if args.quiet is False:
    print('cannot bind socket')
    print('reason: ', sys.exc_info()[1])

# Listen for incoming connections

while True:
    # Wait for a connection
    if args.verbose:
      print('waiting for a connection')
    elif args.quiet is False:
      print('server is up and running')
    connection, client_address = sock.accept()
    if args.quiet is False:
      print('exception occurred')
      print('reason: ', sys.exc_info()[0])
    if args.verbose:
      print('connection from', client_address)
    while True:
      # current date and time
      i =
      second = int(str(i.second),16).to_bytes(1, byteorder='big')
      minute = int(str(i.minute),16).to_bytes(1, byteorder='big')
      hour = int(str(i.hour),16).to_bytes(1, byteorder='big')
      day = int(str(,16).to_bytes(1, byteorder='big')
      format_month = (0b00010000 + i.month).to_bytes(1, byteorder='big')

      # temperature to human readable format from 1-wire
      w1file = open('/sys/bus/w1/devices/' + + '/w1_slave', 'r')
      text =
      out_temp = float("%.1f" % float(float(text.split("t=")[1])/1000))
      # outdoor temperature to wx200 format
      out_temp_sign = 0
      if out_temp < 0:
        out_temp_sign = 8
      out_temp_a = int((abs(out_temp) / 10) + out_temp_sign).to_bytes(1, byteorder='big')
      t = str(int(abs(out_temp) * 10))
      out_temp_bc = int(t[-2:len(t)],16).to_bytes(1, byteorder='big')

      # weather data wx200 format
      wx200file = [b''.join([b'\x8f', second, minute, hour, day, format_month, b'\0\0\xee\0\0\0\0\0\0\0\0\0\0\0\xee\0\0\0\0\0\0\0\0\0\0\0\0\0']),
          b''.join([b'\x9f\xee\0\0\0\0\0\0\0\0\0\0\0\0\0\0', out_temp_bc, out_temp_a, b'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0']),

      if args.verbose:
        print('sending data to the client')

      # send data, normal range is 0,2 (first two lines)
      for i in range(1,2):
        Cksum = 0
        for ch in wx200file[i]:
            Cksum += ch
        connection.sendall(b''.join([wx200file[i],(Cksum & 0xff).to_bytes(1, byteorder='big')]))

  except FileNotFoundError:
    if args.quiet is False:
      print('cannot open 1-wire connection')
    if args.quiet is False:
      print('exception occurred')
      print('reason: ', sys.exc_info()[0])
    # Clean up the connection
    if args.verbose:
      print('closing connection')

Usage example. Reading command line help:

python3 -h

Using with temperature sensor installed:

python3 localhost 8008 10-000801b5a7a6

You can use any free port. Change sensor serial number according with your sensor.

Antenna is made according to these drawings:

I’m very happy with this antenna. I can receive station over a hundred kilometers.

I bought 3.5 inch touchscreen display and housing for Raspberry Pi, but display turned out to be too small and insensitive for anything useful use. So SSH and VNC connections came to good use. SSH works straight out of the box but VNC needs some fine-tuning.

First install RealVNC both to the host and client computers. Then setting up VNC server to Raspberry Pi is easy as pie with following command:

vncserver-virtual :1

Virtual display number can be any, but it must be the same as next command on client computer:


Use Raspberry Pi’s IP address here.

Update – forget Xastir

It is possible to send and receive packets with Dire Wolf alone. First here is custom config file for Dire Wolf:

# OH1FWW config file for Dire Wolf


MODEM 1200
PBEACON DELAY=0:30 EVERY=30 VIA=WIDE2-2 LAT=61^25.95N LONG=23^48.85E commentcmd="python ~/"

Use your own call sign, not mine! All commands must be on single line. commentcmd is undocumented feature. It makes it possible to run scripts from Dire Wolf and print results to APRS packet comment line.

Every=30 means that it is repeated every 30 minutes.

Run with custom config file:

direwolf -c custom-config.conf

Dont forget to save this file too:

import time
def readtemp():
        w1file = open('/sys/bus/w1/devices/28-0000021ebb20/w1_slave', 'r')
        text =
        return float("%.1f" % float(float(text.split("t=")[1])/1000))
        print('cannot read 1-wire sensor. E2')
while True:
    out_temp = readtemp()
    if out_temp == 85.0:
        i = i+1
        print('out temp: {} deg.C'.format(out_temp))
    if i == 10:
        print('cannot read 1-wire sensor. E1')

Change sensor ID to yours.

After that it is again useful to use 3.5 inch built in display because there is not any graphical interface.