Code Monkey home page Code Monkey logo

rhymeswithmogul / aprs-weather-submit Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 10.0 369 KB

Manually submit weather station information to the APRS-IS network.

Home Page: https://launchpad.net/~signofzeta/+archive/ubuntu/aprs-weather-submit

License: GNU Affero General Public License v3.0

C 79.39% Makefile 1.46% M4 10.10% Shell 2.42% Batchfile 6.63%
ham-radio weather-station weather-information weather-data weather-conditions temperature rainfall amateur-radio amateurradio cwop noaa noaa-weather noaa-data hamradio c aprs aprs-is wind-speed wind-data weather

aprs-weather-submit's Introduction

aprs-weather-submit

Codacy Badge

Not everyone has a fancy weather station with APRS connectivity built in. Maybe you're like me, and have an old-school thermometer and CoCoRaHS-approved rain gauge. This command-line app, written in C99, can compile on most Linux toolchains (Windows support is in the works) and will manually submit APRS 1.2.1-compliant weather information to the APRS-IS network.

Help

Anyone can use this app to create an APRS packet. However, to send it to the APRS-IS network, you must have an account on an APRS-IS IGate server, as well as an amateur radio license or CWOP identifier (more on that below).

Examples

At the bare minimum, you can submit your weather station's position with a command line like this:

$ ./aprs-weather-submit --callsign W1AW-13 --latitude 41.714692 --longitude -72.728514 --altitude 240 --server example-igate-server.foo --port 12345 --username hiram --password percymaxim

If you'd like to report a temperature of 68°F, you can use a command like this:

$ ./aprs-weather-submit -k W1AW-13 -n 41.714692 -e -72.728514 -I example-igate-server.foo -o 12345 -u hiram -d percymaxim -t 68

Or, if you just want the raw packet for your own use, don't specify server information:

$ ./aprs-weather-submit -k W1AW-13 -n 41.714692 -e -72.728514 -t 68
W1AW-13>APRS,TCPIP*:@090247z4142.88N/07243.71W_.../...t068aprs-weather-submit/1.5.2

This app supports all of the weather data parameters defined in APRS versions up to and including version 1.2.1:

  • Altitude (-A, --altitude)
  • Barometric pressure (-b, --pressure) in mbar/hPa
  • Luminosity (-L, --luminosity)
  • Radiation (-X, --radiation)
  • Rainfall in the past 24 hours (-p, --rainfall-last-24-hours) in inches
  • Rainfall since midnight (-P, --rainfall-since-midnight) in inches
  • Rainfall in the past hour (-r, --rainfall-last-hour) in inches
  • Relative humidity (-h, --humidity)
  • Snowfall in the past 24 hours (-s, --snowfall-last-24-hours)
  • Temperature (°F) (-t, --temperature)
  • Temperature (°C) (-T, --temperature-celsius)
  • Water level above flood stage or mean tide (-F, --water-level-above-stage)
  • Weather station battery voltage (-V, --voltage)
  • Wind direction (-c, --wind-direction)
  • Wind speed, peak in the last five minutes (-g, --gust) in mph
  • Wind speed, sustained over the last minute (-S, --wind-speed) in mph

Installing

Ubuntu Linux and Debian-based distributions

If your distribution supports PPAs, I just learned how to make a PPA! You can install this with APT:

sudo add-apt-repository ppa:signofzeta/aprs-weather-submit
sudo apt update
sudo apt install aprs-weather-submit

If not, follow the instructions in INSTALL.md to configure it normally:

./autogen.sh
./configure
make

Legal Notices

To use this app, you must be either:

  1. a licensed amateur radio operator, or
  2. a member of the Citizen Weather Observer Program in good standing.

Getting your ham radio license is easy, and joining CWOP is even easier.

Like it says in the license: this app is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 3.0 for more details. As such, you and you alone are solely responsible for using this app to submit complete and correct weather and/or location data. Please do not use this app for evil. Don't make me regret writing this app.

QTH. 73, W1DNS (formerly KC1HBK)

aprs-weather-submit's People

Contributors

codacy-badger avatar ploeffler avatar rhymeswithmogul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aprs-weather-submit's Issues

uncompressed positions - leading zero in decimaldegrees <10 missing

what a great tool!

but: as mentioned in the topic leading zero is missing if decimal minutes are smaller than 10

(file aprs-wx.c lines 195 and 202)

2022-10-23 15:19:24 CEST: OE6PLD-13>APRS,TCPIP*,qAC,OE6PLD-6:@231319z476.08N/01549.60E_000/0g032t072h50b10130/A=m X raspi-aprs-weather-submit/V1.5 [Invalid uncompressed location]
2022-10-23 15:21:28 CEST: OE6PLD-13>APRS,TCPIP*,qAC,OE6PLD-6:@231321z/6_@)RN"+_g032t072h50b10130/A=m X raspi-aprs-weather-submit/V1.5

regards
peter, OE6PLD

How to compile?!

root@orangepizero:/opt/aprs-weather-submit/src# gcc -c -o aprs-wx.o aprs-wx.c
aprs-wx.c: In function ‘printAPRSPacket’:
aprs-wx.c:273:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "g", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:279:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "r", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:285:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "p", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:291:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "P", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:297:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "h", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:303:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "b", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:315:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "X", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:322:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "F", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:328:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "V", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:338:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "s", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:344:3: warning: ‘strncat’ specified bound 3 equals source length [-Wstringop-overflow=]
   strncat(result, "/A=", 3);
   ^~~~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:350:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "X", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:351:3: warning: ‘strncat’ specified bound 19 equals source length [-Wstringop-overflow=]
   strncat(result, PACKAGE, strlen(PACKAGE));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:352:3: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
   strncat(result, "/", 1);
   ^~~~~~~~~~~~~~~~~~~~~~~
aprs-wx.c:353:3: warning: ‘strncat’ specified bound 3 equals source length [-Wstringop-overflow=]
   strncat(result, VERSION, strlen(VERSION));
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

an assembly with a parameter gcc -Wno-stringop-overflow -c -o aprs-wx.o aprs-wx.c does not improve the situation at the final stage:

root@orangepizero:/opt/aprs-weather-submit/src# gcc -o wx aprs-wx.o aprs-is.o main.o
/usr/bin/ld: aprs-wx.o: in function `compressedWindSpeed':
aprs-wx.c:(.text+0x14c): undefined reference to `log1p'
/usr/bin/ld: aprs-wx.c:(.text+0x160): undefined reference to `round'
/usr/bin/ld: aprs-wx.o: in function `compressedPosition':
aprs-wx.c:(.text+0x260): undefined reference to `pow'
/usr/bin/ld: aprs-wx.o: in function `uncompressedPosition':
aprs-wx.c:(.text+0x3a2): undefined reference to `floor'
/usr/bin/ld: main.o: in function `main':
main.c:(.text+0x42a): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x5ce): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x676): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x722): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0x7ee): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0xaba): undefined reference to `floor'
/usr/bin/ld: main.c:(.text+0xbc4): undefined reference to `round'
/usr/bin/ld: main.c:(.text+0xc9e): undefined reference to `round'
collect2: error: ld returned 1 exit status

My system:

root@orangepizero:/opt/aprs-weather-submit/src# uname -a
Linux orangepizero 5.10.60-sunxi #21.08.2 SMP Tue Sep 14 16:28:44 UTC 2021 armv7l GNU/Linux

root@orangepizero:/opt/aprs-weather-submit/src# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)

configure?

Instructions say to run "./configure", however there is no configure supplied in pull.

issue in order aprs string

look like there is an issue with the order to send to APRS-IS

PD9MWO-4>APRS,TCPIP*:@171407z5216.39N/00437.37E_110/004t049g012P000h83b10256L063Xaprs-weather-submit/1.4
but must be
PD9MWO-4>APRS,TCPIP*:@171407z5216.39N/00437.37E_110/004g012t049P000h83b10256L063Xaprs-weather-submit/1.4

the raw packets on aprs.fi
GOOD
2022-01-17 15:09:09 CET: PD9MWO-4>APRS,TCPIP*,qAC,T2EDM:@171408z5216.39N/00437.37E_049/004g012t049P000h83b10256L062Xaprs-weather-submit/1.4

ISSUE
2022-01-17 15:11:31 CET: PD9MWO-4>APRS,TCPIP*,qAC,T2EDM:@171411z5216.39N/00437.37E_084/007t049g002P000h83b10256L061Xaprs-weather-submit/1.4

the order is wrong here
can you please fix this ??

many thanks in advance
menno
pd9mwo

Compressed location packets sent to APRS.fi aren't processed as weather packets

Compressed packets without wind direction and speed that arrive at APRS.fi are not displayed as weather packets; they have the (WX) icon but no weather data is visible. I'm not sure if this is an issue with their web site or my code.

Given these examples, only the top one will show weather data.

$ ./aprs-weather-submit --callsign KC1HBK --temperature 69 --latitude 41.593794 --longitude -73.451529 --rainfall-last-24-hours 0 --rainfall-since-midnight 0  --uncompressed-position
KC1HBK>APRS,TCPIP*:@160413z4135.37N/07327.05W_.../...t069p000P000Xaprs-weather-submit/1.2.1-beta

$ ./aprs-weather-submit --callsign KC1HBK --temperature 69 --latitude 41.593794 --longitude -73.451529 --rainfall-last-24-hours 0 --rainfall-since-midnight 0 
KC1HBK>APRS,TCPIP*:@160413z/9K_C;uXw_  Ct069p000P000Xaprs-weather-submit/1.2.1-beta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.