Coder Social home page Coder Social logo

mpad's Introduction

mpad

License: GPL v3 Code style: black CodeQL

Multi-Purpose APRS Daemon (Gollum might also call it My Precious APRS Daemon)

Python implementation of a multi-purpose APRS daemon (WX/METAR/TAF/CWOP reports, satellite & other celestial data, find the nearest repeater to my position, user coordinates & distance etc. ...)

Supported features

  • Worldwide daily/hourly weather forecast for address / zip code / lat,lon / maidenhead / ...
  • METAR/TAF data for IATA/ICAO codes or the nearest airport to a user's position
  • CWOP data for a given CWOP station (or the nearest one)
  • Sunrise/sunset and moonrise/sunset for a given callsign (or the station's callsign)
  • Extensive position data for your own callsign or a different callsign (human readable address, MGRS, Maidenhead, UTM, DMS, distance between the two users, altitude)
  • Satellite transit data (provides e.g. the next transit of the ISS, based on the callsign position of the transmitter). Can distinguish between visible and non-visible passes.
  • Finds the nearest repeater to your position with optional query parameters on band and mode, e.g. 2m/70cm, c4fm/dstar
  • Provides uplink/downlink frequencies for a specific satellite
  • Find a place of interest nearby, e.g. fuel station, supermarket
  • Send a message to a DAPNET user
  • Magic 8 Ball predictions
  • Send an extensive APRS position report for your call sign's location to an email address via SMTP
  • Radiosonde landing predictions
  • Deutscher Wetterdienst WX warning broadcasts (for German users)
  • Can be easily extended with additional functions and keywords

Program specifics

  • Very low cpu/traffic footprint thanks to APRS filters and local data caches.
  • Pretty printing of APRS messages. Rather than splitting up the content after a max message len of 67 bytes, the program tries to split the text in a readable way which will keep the logical context of the message intact.
  • Human-friendly parser that supports both keyword and also non-keyword commands
  • Auto-detection of the user's system of units. Callsigns from the USA, Liberia and Myanmar will receive their data in imperial format (Miles, Fahrenheit, Feet etc), while for the rest of the world the metric system is preset. This auto-setting can be overriden with a separate keyword.
  • Supports APRS msg acknowledgments, beacons, etc.
  • Automatic detection of incoming duplicate / delayed APRS message requests
  • Full UTF-8 support for incoming messages. For outgoing APRS messages, the configuration can be set to either 'plain ASCII' (default) or UTF-8. Email messages are not affected by this restriction

MPAD on YouTube

Thank you Jason/KM4ACK for your kind video review! MPAD on YouTube

Sample dialogue with MPAD

Screencast

Usage and command syntax

Usage information and the command keywords:

Example requests and responses

see EXAMPLES

Dependencies and external data sources

see DEPENDENCIES

Install your own MPAD instance

see INSTALLATION

Add your own keywords

see EXTENSIONS

Technical Details and known issues

see TECHNICAL_DETAILS

MPAD Live Instance

(also known as 'I just want to use the damn thing')

My MPAD instance runs on a Raspberry Pi 4 which also hosts my Pi-Hole server. I have tested MPAD on other less-performant Linux-/Mac-based hardware. If you are a tad patient, you can even run MPAD on a Raspberry Pi Zero W.

The fine print

  • If you intend to host an instance of this program, you must be a licensed radio amateur. BYOP: Bring your own (APRS-IS) passcode. If you don't know what this is, then this program is not for you.
  • Some program routines borrow logic from KI6WJP's WxBot, whose source code was immensely helpful in getting a better understanding of how to process an APRS message. If the code works, give Martin kudos. If it doesn't work, I'm the one who screwed up.
  • APRS is a registered trademark of APRS Software and Bob Bruninga, WB4APR.

mpad's People

Contributors

joergschultzelutter avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpad's Issues

Bug with make_pretty_aprs_messages

Function fails if the very first element that is to be inserted into the list has a length of exactly 67 chars. In this case, the list will contain two elements (first element = '', second is the inserted string)

METAR request causes crash

I started up an instance on a Raspbery Pi (named mpad2 in case you see the traffic) and a buddy was helping me test it. He requested METARs and the script died. I fired it up again, and was able to replicate the issue with a different METAR request.

2024-04-09 20:34:42,236 aprs_listener -INFO- {'latitude': 32.42417, 'longitude': -97.35533, 'altitude': 0.0, 'lasttime': datetime.datetime(2024, 3, 2, 15, 33), 'comment': None, 'when': 'today', 'when_daytime': 'day', 'what': 'metar', 'units': 'imperial', 'message_callsign': 'S', 'users_callsign': 'KI7JOM-10', 'language': 'en', 'icao': None, 'human_readable_message': None, 'date_offset': 0, 'hour_offset': -1, 'satellite': None, 'repeater_band': None, 'repeater_mode': None, 'city': None, 'state': None, 'country': None, 'country_code': None, 'county': None, 'district': None, 'address': None, 'zipcode': None, 'cwop_id': None, 'street': None, 'street_number': None, 'users_latitude': 0.0, 'users_longitude': 0.0, 'number_of_results': 1, 'osm_special_phrase': None, 'dapnet_message': None, 'mail_recipient': None, 'force_outgoing_unicode_messages': False}
2024-04-09 20:34:42,236 output_generator -INFO- Running output worker generate_output_message_metar()
2024-04-09 20:34:42,848 inet -ERROR- APRS Packet: b'KI7JOM-10>APSAR,WIDE2-2,qAO,WWU::MPAD2    :metars bli{06'
Traceback (most recent call last):
  File "/home/chris/mpad/src/./aprs_listener.py", line 584, in <module>
    AIS.consumer(mycallback, blocking=True, immortal=True, raw=False)
  File "/home/chris/.local/lib/python3.11/site-packages/aprslib/inet.py", line 185, in consumer
    callback(self._parse(line))
  File "/home/chris/mpad/src/./aprs_listener.py", line 306, in mycallback
    success, output_message = generate_output_message(
                              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/mpad/src/output_generator.py", line 107, in generate_output_message
    success, output_list = generate_output_message_metar(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chris/mpad/src/output_generator.py", line 322, in generate_output_message_metar
    success, metar_response = get_metar_data(
                              ^^^^^^^^^^^^^^^
  File "/home/chris/mpad/src/airport_data_modules.py", line 198, in get_metar_data
    pos = meintext.find(icao_code)
          ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: must be str, not NoneType

Did I break it, or was it broken when I pulled it?

Add email support

Send APRS message to EMAIL-2.
Message content: http://aprs.fi/<users_callsign>

IGNORE message responses from EMAIL-2. We will receive (and acknowledge!) them but won't do anything else here and need to ignore them as MAPD would interpret these as commands.

Once the initial message has been sent to EMAIL-2, we will void any positive or negative responses from EMAIL-2; meaning that the ACK/NAK mail from EMAIL-2 will not trigger an additional message to the user.

Message examples:

Outgoing:

[email protected] http://aprs.fi/DF1JSL-3{19

Incoming:

Email sent to [email protected]{832

Enhance METAR / TAF logic

  • By default, reduce the METAR keyword's output to METAR data only
  • Introduce a new keyword (e.g. FULL) which enhances the output with TAF data and/or create a separate TAF keyword

APRS Foundation Discord for Software Devs

Hi Joerg,

I develop another Python APRS bot backend and found your code during my development. It was very helpful to have an example to look at, and I learned a lot about APRS messaging by looking at your code.

The APRS foundation has created a discord, and on it, there's a section for APRS Software devs to collaborate. I wanted to invite you because I think we could collaborate on APRS software in the future!

The discord link is https://discord.gg/8E3ftmwP

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.