Announcement

Collapse
No announcement yet.

APRS to MQTT bridge

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • APRS to MQTT bridge

    I did some tinkering this weekend, and came up with a simple APRS to MQTT bridge. Right now it's receiving from APRS-IS only, but could be relatively easily modified to transmit to APRS-IS (assuming you're a legal amateur operator):

    https://github.com/mloebl/mqtt-aprs

    Uses aprslib from python to parse to custom topics/values:
    Code:
    /raw/mike/aprs/KC1BOS-2/raw KC1BOS-2>T3PR5X,KC1BOS-10,WIDE1,AB1OC-10,WIDE2*,qAO,N1MJL:`c,Lr"V>/"5H}TinyTrak4 Mobile
    /raw/mike/aprs/KC1BOS-2/path [u'KC1BOS-10', u'WIDE1', u'AB1OC-10', u'WIDE2*', u'qAO', u'N1MJL']
    /raw/mike/aprs/KC1BOS-2/format mic-e
    /raw/mike/aprs/KC1BOS-2/icon />
    /raw/mike/aprs/KC1BOS-2/latitude 43.043
    /raw/mike/aprs/KC1BOS-2/longitude -71.2747
    /raw/mike/aprs/KC1BOS-2/distance 30.13
    /raw/mike/aprs/KC1BOS-2/altitude 459.317585302
    /raw/mike/aprs/KC1BOS-2/comment TinyTrak4 Mobile
    or can pump on the raw JSON from aprslib:
    Code:
    /raw/mike/aprs {'comment': u'WX Station of KD1KE {UIV32N}', 'via': u'T2MAINE', 'posambiguity': 0, 'format': 'uncompressed', 'timestamp': 1521403200, 'symbol': u'_', 'raw': u'KD1KE>APU25N,TCPIP*,qAC,T2MAINE:@182000z4428.85N/06920.58W_188/004g018t026r000p000P000h39b10045WX Station of KD1KE {UIV32N}', 'weather': {'wind_speed': 1.78816, 'wind_gust': 8.04672, 'wind_direction': 188, 'humidity': 39, 'pressure': 1004.5, 'rain_24h': 0.0, 'rain_1h': 0.0, 'rain_since_midnight': 0.0, 'temperature': -3.333333333333333}, 'symbol_table': u'/', 'path': [u'TCPIP*', u'qAC', u'T2MAINE'], 'from': u'KD1KE', 'messagecapable': True, 'longitude': -69.343, 'to': u'APU25N', 'latitude': 44.48083333333334, 'raw_timestamp': u'182000z'}
    /raw/mike/aprs {'comment': u'iGate Digi Brunswick, NY', 'via': u'T2FEJER', 'posambiguity': 0, 'format': 'uncompressed', 'timestamp': 1521403359, 'symbol': u'#', 'phg': u'8230', 'raw': u'N2JNT-2>APWW10,TCPIP*,qAC,T2FEJER:@200239h4244.58N/07339.32W#PHG8230 iGate Digi Brunswick, NY', 'symbol_table': u'/', 'path': [u'TCPIP*', u'qAC', u'T2FEJER'], 'from': u'N2JNT-2', 'messagecapable': True, 'longitude': -73.65533333333333, 'to': u'APWW10', 'latitude': 42.743, 'raw_timestamp': u'200239h'}
    Feel free to play/fork/comment. Still not 100% perfect, but enough to experiment with for sure. I've been running it all day connected to my local javAPRServer, but no reason since using aprslib, it couldn't connect to an Internet based APRS-IS server.

    -Mike

  • #2
    Could you provide some example use cases for those of us who are not familiar with actual use of APRS. I remember in mcsTemperature (HS1 & HS2) that I did some APRS decoding for a user, but don't remember anything about it.

    Comment


    • #3
      I parse out the distance so could run events based on location. I also parse out the comments so could in theory run an event based on incoming SSID and a comment. I haven't implemented it yet, but can also get local weather station(s) data.

      I used to have an APRS Plugin I wrote for HS2. I used to use it primarily for location based events.

      Comment


      • #4
        In your case what do you used the data for?

        Comment


        • #5
          Originally posted by Michael McSharry View Post
          In your case what do you used the data for?
          I could run events based on proximity to home. The plugin at the time also had the ability to specify N number of locations, so could create "work" for example and run events if near there, etc.

          I also used it for local weather reporting before I had my own weather station (free local weather data)

          Comment


          • #6
            What device are you using to transmit position so distance from home can be determined? How is APRS network different than WeatherUnderground or WeatherBug networks for local weather station reporting? How would I know what APRS weather stations are near me?

            Comment


            • #7
              Originally posted by Michael McSharry View Post
              What device are you using to transmit position so distance from home can be determined? How is APRS network different than WeatherUnderground or WeatherBug networks for local weather station reporting? How would I know what APRS weather stations are near me?
              APRS has many features; automatic position reporting of stations, weather reporting, two way messaging (both terrestrial and via satellites), emergency reporting, telemetry (I've seen river monitors for example) etc. It's over VHF mostly, and accessible to anyone with the lowest amateur radio license in the US for transmitting (and anyone can receive). It was an network of things years before "IoT" was a thing.

              I used to have a ham radio in my car that transmitted via APRS as I drove, so would get the position that way. It was around decades before solutions like Automatic and their cellular based devices. There are APRS beacon devices (radio/APRS device built in), that you can attach to vehicles, balloons, etc that are all in one; just set your callsign and add power more or less.

              In a nutshell, when a station transmits via RF, if it's within range of an APRS IGate (an Internet connected gateway that receives RF traffic and sends it to the Internet), or a digipeater (which can repeat it's RF traffic to hopefully reach an IGate), it will show up on the APRS-IS network. Anyone (including non-hams) can receive the APRS-is traffic (http://www.aprs-is.net/aprsservers.aspx). There's enough concentration of APRS IGates and digipeaters that the majority of stations over RF are received.

              Not just ham radio devices are on APRS, things like CWOP weather stations are also transmitted. Being on APRS doesn't mean RF, many things are Internet connected only. It's also a global standard, so any station around the world can connect to APRS-IS (though frequencies differ a little around the world for RF.)

              RF stations typically beacon at intervals as to not cause interference/DoS and allow other stations to transmit (being 1200 baud, it can only handle so much in an area.) However I don't believe APRS-IS Internet only stations are limited as much.

              Check out https://aprs.fi/ , if you see a weather station near you, (blue WX), then in theory you can parse it out from ARPS-IS.

              I have an IGate running in my attic with a Raspberry PI, a TNC-Pi, and a radio, so I can receive and gate location stations. My Davis weather station is connected to a BeagleBone running WeeWx, so sends raw weather data both to my private MQTT network, as well as direct to APRS-IS.

              Comment

              Working...
              X