Nov 172022

You can built your own weather station using Argent ADS-WS1 or any other devices that capable submiting to aprs-is or cwop network, but it was too expensive for me.
i began my research how to craft APRS WX packet using python and bash script on direwolf. that
was not easy for newbie amateur like me, LOL. Luckily i’ve found aprs-weather-submit created by KC1HBK.
it makes my research easier.

first of all, we need some hardwares Raspi Zero, BME280 sensorand some jumper wires.
Conect all wires from pi zero to bme280 using i2c pin. you can find pinout configuration here:

or type pinout in ssh shell

don’t forget to activate i2c pin, go ssh shell. issue command sudo raspi-config and go to interface options to activate i2c


  1. BME280 VIN pin connects to GPIO pin 1 (3.3V)
  2. BME280 GND pin connects to GPIO pin 6 (GND)
  3. BME280 SCL pin connects to GPIO pin 5 (SCL)
  4. BME280 SDA pin connects to GPIO pin 3 (SDA)

i’m using python and bme280 library from
there’s some example script there, i silghtly modify the script to obtain bme280 values

building aprs-weather-submit.

git clone

cd aprs-weather-submit

follow the instructions at build scripts section here:

./ ./configure [--disable-aprs-is] [--enable-debug] 
sudo make install

when i first compiled, i got this error:

modify main.c

vi src/main.c

at line 588

i changed this line from:

(note at %lu)

fprintf(stderr, “Your comment was %lu characters long, but APRS allows %u characters. Your comment was truncated.\n”, strlen(optarg), MAX_COMMENT_LENGTH);

i changed it to %ul

than it compiled propperly.

here is my script to generate wx format:


Temp=$(echo $STR | cut -f 1 -d" ")
Hum=$(echo $STR | cut -f 3 -d" ")
Bar=$(echo $STR | cut -f 2 -d" ")
Alt=$(echo $STR | cut -f 4 -d" ")
#aprs-weather-submit -k YD0BCX-13 -n -06.714692S -e 106.728514 -t $Temp -A $Alt -h $Hum -b $Bar -V 9
STR2=$(aprs-weather-submit -k YD0BCX-13 -n -6.198611 -e 106.87000E -T $Temp -h $Hum -b $Bar -M " WX on Pi Zero + BME280 + DW 1.7")

echo "${STR2:22}"
#echo "$Temp $Hum $Bar $Alt"


chmod 755

#!/usr/bin/env python
#Import modules for time and to access sensor
import time
from smbus import SMBus
from bme280 import BME280
#Initialise the BME280
bus = SMBus(1)
bme280 = BME280(i2c_dev=bus)
#Get data and discard to avoid garbage first reading
temperature = bme280.get_temperature()
pressure = bme280.get_pressure()
humidity = bme280.get_humidity()
altitude = bme280.get_altitude()
#while True:
temperature = bme280.get_temperature()
pressure = bme280.get_pressure()
humidity = bme280.get_humidity()
altitude = bme280.get_altitude()
if ( temperature and pressure and humidity and altitude ):
print('{:05.2f} {:05.2f} {:05.2f}'.format(temperature, pressure, humidity), round(altitude),  end="")

in, there’s command part
echo “${STR2:22}”

this command will remove leading 22 characters(based on my lat long value)
in this case when i’m executing aprs-weather-submit -k YD0BCX-13 -n -6.198611 -e 106.87000E
the result will be:

we need to remove “YD0BCX-13>APRS,TCPIP:” part, that’s what “echo “${STR2:22}”” is for.

if it’s not removed direwolf will also submit those part and make it position beacon failed to aprs-is(YD0BCX-13>APRS,TCPIP*: submit 2 times)

direwolf configuration:

ADEVICE plughw:1,0
MODEM 1200

CBEACON sendto=IG delay=1 every=05:00 infocmd="echo '>WX Station' $(date)"

CBEACON sendto=IG delay=01:10 every=10:00 infocmd=" YD0BCX-13 Temperature Pressure Humidity Altitude"
CBEACON sendto=IG delay=01:11 every=10:00 infocmd=" YD0BCX-13 deg.C hPa % masl"
CBEACON sendto=IG delay=01:11 every=10:00 infocmd=" YD0BCX-13 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0"
CBEACON sendto=IG delay=01:15 every=10:00 infocmd=" /home/pi/"

CBEACON sendto=IG delay=1 every=05:00 infocmd="/home/pi/"

IBEACON sendto=IG delay=30 every=30 via=WIDE1-1

LOGDIR /var/log/direwolf

note on direwolf configuration, i also submiting telemetries data, you can ommit it if you want.
i think that’s it. i’m not good at talking or writing.

if there’s something to ask just drop me a message 😀