[Xastir] How to get CWOP weather on APRS network
Dj Merrill
xastir at deej.net
Sat Oct 31 17:30:18 PDT 2020
On 10/30/2020 1:07 AM, Steven Morrison wrote:
> I can configure the WeeWx program to generate a report and send it to
the xastir Pi, but how can i receive that report and transmit it in xastir?
I'm doing it as follows in Linux (Raspberry Pi) with both WeeWx and
Xastir running on the same RPi, but you could easily rsync the
/dev/shm/aprs.kpt file to a different computer if needed.
I have the APRS extension loaded into WeeWx
(https://github.com/cavedon/weewx-aprs).
In /etc/weewx/weewx.conf I have:
# Options for extension 'aprs'
[APRS]
comment = "RaspberryPi-Xastir-Wx-Topsham,ME"
include_position = 1
symbol_code = _
symbol_table = /
output_filename = /dev/shm/aprs.pkt
Then I have a crontab entry that does:
01,11,21,31,41,51 * * * * /home/xastir/scripts/send-weather-rf.sh >
/dev/null
and the send-weather-rf.sh script looks like (XXXX is my 4 digit APRS code):
#!/bin/bash
#
weatherpacket=`cat /dev/shm/aprs.pkt`
/usr/local/xastir/bin/xastir_udp_client localhost 2023 N1JOV XXXX -to_rf
$weatherpacket
I am using an older version of Xastar (2.1.1) compiled from source code,
and had to make the following change in main.c to make the
xastir_udp_client command work for the above. I do not know if this
still needs to be done in later versions.
main.c is my custom version, main.c.orig is the original.
$ diff main.c main.c.orig
12180,12183c12180,12183
< // char path[100+1];
< // char info[100+1];
< // char *path0 = NULL;
< // char *info0 = NULL;
---
> char path[100+1];
> char info[100+1];
> char *path0 = NULL;
> char *info0 = NULL;
12187,12188c12187,12188
< // path0 = strtok(line,":"); // Pointer
to start of path
< // info0 = strtok(NULL,""); // Pointer
to information field
---
> path0 = strtok(line,":"); // Pointer to
start of path
> info0 = strtok(NULL,""); // Pointer to
information field
12190,12197c12190,12196
< // xastir_snprintf(path, sizeof(path),
"%s", path0);
< // xastir_snprintf(info, sizeof(info),
"%s", info0);
< // //fprintf(stderr, "path: %s\n", path);
< // //fprintf(stderr, "info: %s\n", info);
< // //fprintf(stderr, "line: %s\n", line);
< // xastir_snprintf(line, sizeof(line),
"%s%s%s", path, ",NOGATE:", info);
< // xastir_snprintf(line, sizeof(line),
"%s%s%s", path);
< // //fprintf(stderr, "line: %s\n", line);
---
> xastir_snprintf(path, sizeof(path), "%s",
path0);
> xastir_snprintf(info, sizeof(info), "%s",
info0);
> //fprintf(stderr, "path: %s\n", path);
> //fprintf(stderr, "info: %s\n", info);
> //fprintf(stderr, "line: %s\n", line);
> xastir_snprintf(line, sizeof(line),
"%s%s%s", path, ",NOGATE:", info);
> //fprintf(stderr, "line: %s\n", line);
12239c12238
< // *(line + line_offset - 1) = '}';
---
> *(line + line_offset - 1) = '}';
12242,12243c12241
< // (char *)(line + line_offset - 1),
// Raw data line
< (char *)(line + line_offset), // Raw
data line
---
> (char *)(line + line_offset - 1), //
Raw data line
-Dj
--
Dj Merrill - N1JOV - EAA Chapter 87
Currently Flying: Glastar
Previously: Cessna 150 - Glasair 1 FT - Grumman AA1B
More information about the Xastir
mailing list