[aprssig] APRS activity triggering a text or email notification via internet push

Lee Bengston lee.bengston at gmail.com
Wed Feb 16 21:17:43 EST 2011


Wow, I had no idea that Ham::APRS::LastPacket existed.  Interestingly
enough, it's available via the perl package manager in ActivePerl making it
usable in Windows, but I'm not finding it in the Ubuntu repositories.  It's
two dependencies are, however, available, so it looks like it would be a
simple matter of installing those and then grabbing the LastPacket source
code from CPAN.

Before seeing this I was also thinking of using a perl script, but it would
grab the needed info from http://aprs.fi/info/a/$callsign.  Perhaps use
WWW::Mechanize or just curl or wget.

Lee - K5DAT


On Wed, Feb 16, 2011 at 11:09 AM, Rich Mulvey <aprs at mulveyfamily.com> wrote:

> I hadn't followed this topic before, but if you have a machine you can run
> perl on, this is trivially easy.  I just whipped up this script and tested
> it.  Replace the callsign, recipient, and sender addresses, and run it
> periodically.
>
> It will store the last position found for the callsign, then, then next
> time it runs, if the lat/long differ, it will send an email.  Most cell
> providers provide an email gateway to allow you to email SMS messages to
> someone.
>
> Obviously you'd want to surpress position changes within some window (
> i.e., less than 100 feet ).  Plus probably some more error checking.  ;-)
>
> ---
> #!/usr/bin/perl
>
> use strict;
> use Ham::APRS::LastPacket;
> use Storable;
> use Email::Sender::Simple qw(sendmail);
> use Email::Simple;
> use Email::Simple::Creator;
>
>
> my $callsign = "MYCALLSIGN";
> my $recipient = "blah\@blah.com";
> my $sender = "myposition\@blah.com";
> my %lastPosition;
>
> my $aprs = Ham::APRS::LastPacket->new;
> $aprs->set_callsign($callsign);
>
> # Load the last position, if we've stored it
> if( -r $callsign ) {
>    %lastPosition = %{retrieve $callsign};
> }
>
>
> my $packet = $aprs->get_data;
> die $aprs->error_message if $aprs->is_error;
>
> # get the position report
> print "$callsign is at
> $packet->{position}->{latitude}->{degrees},$packet->{position}->{longitude}->{degrees}\n";
>
> # If the position has changed, send out an email
> if( ( $lastPosition{latitude} != $packet->{position}->{latitude}->{degrees}
> ) ||
>     ( $lastPosition{'longitude'} !=
> $packet->{position}->{longitude}->{degrees} ) ) {
>    sendEmail();
> }
>
> # Save the position
> $lastPosition{'latitude'} = $packet->{position}->{latitude}->{degrees};
> $lastPosition{'longitude'} = $packet->{position}->{longitude}->{degrees};
> store \%lastPosition, $callsign;
>
>
> sub sendEmail {
>    print "Sending a movement report\n";
>
>    my $email = Email::Simple->create(
>     header => [
>     To      => $recipient,
>     From    => $sender,
>     Subject => "$callsign position report",
>     ],
>     body => "$callsign has moved",
>    );
>
> sendmail($email);
> }
>
>
> On Wed, Feb 16, 2011 at 12:19 AM, Steve Hanis <dmesteve at gmail.com> wrote:
>
>> On Tue, Feb 15, 2011 at 10:22 PM, John Gorkos <jgorkos at gmail.com> wrote:
>> >
>> > On Friday, February 11, 2011 09:51:24 AM Steve Hanis wrote:
>> > > Hi John,
>> > >
>> > > I have no intention of irritating anyone one the list, and apologize
>> > > if I have done so. I haven't written any programs since college back
>> > > in the early 90's and don't consider myself programmer, I use Linux
>> > > occasionally. I was made aware of this list after I posed this same
>> > > question on the APRS Yahoo group.
>> > >
>> > > What I am looking for is something like what is described on
>> > > http://www.aprs.org/aprs-messaging.html:
>> > >
>> > > "APRS Messages to Your Cellphone: . N3FLR Frank Rossi reports that he
>> > > uses "YahooAlert" to send all of his APRS messages to his cell phone.
>> > > First, Find-U has RSS output capability so he has his computer RSS
>> > > Feed Reader watching his Feed From FindU, and YahooAlert also
>> > > watching. After setting up Yahoo Alert for a pager, he uses his
>> > > phone's text e-mail address such as xxxxxxxxxx at txt.att.net . Then you
>> > > just need to know what your phone's "e-mail address" to "text address"
>> > > is. You don't need mobile internet to do it this way, just text
>> > > ability. That will work with a text pager also. . When FINDU sees a
>> > > message to him on APRS it generates an RSS Feed that now Yahoo-Alerts
>> > > is watching. YahooAlerts then forwards the RSS Message as Text to his
>> > > cell phone. Although this is only one way communications, it still
>> > > lets him receive his APRS messages. He also says that you can set up
>> > > RSS feeds from FindU for weather alerts, or APRS users X amount of
>> > > miles from you. You can make the miles anything you want. He has not
>> > > tried that function yet."
>> > >
>> > > I've tried this to no avail, but was wondering if anyone else had come
>> > > up with a different way to accomplish the same goal. I have no
>> > > commercial interest in this, I just want to be pinged on my cell phone
>> > > (SMS, Email, IM) when my friend goes mobile, or for special cases like
>> > > a high altitude balloon with a known call sign goes active on APRS.
>> > >
>> > > Kind Regards,
>> > > Steve
>> > >
>> > > On Fri, Feb 11, 2011 at 7:35 AM, John Gorkos <jgorkos at gmail.com>
>> wrote:
>> > > > It "can" be done.  It hasn't yet.  What you're asking for is 4-6
>> hours of
>> > > > custom coding (mostly for the web interface).  Do you have a web
>> server
>> > > > that can host something like this?  I've got a few hours this
>> weekend I
>> > > > can use to code this.
>> > > > Let me make sure I've got the requirements right:
>> > > > You want a web interface that allows you to enter a "monitored" call
>> > > > sign, and an email address to send a message to when that position
>> > > > report from that monitored callsign indicates movement.  You want
>> one
>> > > > message only.  Then, time passes and the monitored station stops
>> moving.
>> > > >  Once the station starts moving again, you want another text
>> message.
>> > > > The SMS messages will have to be sent via email (i.e.
>> > > > 2125551212 at sms.verizon.com), since a direct SMS interface is spendy
>> and
>> > > > less standard.
>> > > >
>> > > > Do you have any programming skills you could apply to this?  Web
>> design,
>> > > > maybe?  I hate web design, but the back-end portion isn't too
>> difficult.
>> > > >  This request will probably irritate some people on this list, FWIW.
>> > > >  Everyone has an imaginary line they draw between "ham radio" and
>> > > > "commercial radio and internet."  Using your cellphone/commercial
>> radio
>> > > > to get updates about APRS happenings on ham radio is probably on the
>> far
>> > > > side of some peoples' lines.
>> > > >
>> > > > John Gorkos
>> > > > AB0OO
>> > > >
>> > > > On Thursday, February 10, 2011 18:48:04 Steve Hanis wrote:
>> > > > > Thank you for your reply. I am looking for a way to trigger an
>> email,
>> > > > > IM or SMS using existing web interfaces. A way to "push" an alert
>> to
>> > > > > me when I am working or relaxing at home. Can this be done?
>> > > > > Kind Regards,
>> > > > > Steve
>> > > > >
>> > > > >
>> > > > >
>> > > > > On Tue, Feb 8, 2011 at 10:41 AM, Guido Trentalancia
>> > > > > <iz6rdb at trentalancia.com
>> > > > >
>> > > > > > wrote:
>> > > > > >
>> > > > > > Hello Steve !
>> > > > > >
>> > > > > > On Mon, 07/02/2011 at 22.19 -0600, Steve Hanis wrote:
>> > > > > > > A friend and I just starting using APRS.  Is there way to
>> trigger a
>> > > > > > > SMS
>> > > > > >
>> > > > > > text
>> > > > > >
>> > > > > > > message or email via Internet monitoring when his APRS goes
>> active
>> > > > > > > or
>> > > > > >
>> > > > > > moving?
>> > > > > >
>> > > > > > > This would let me know he is mobile and available to chat or
>> view
>> > > > > > > his
>> > > > > >
>> > > > > > location
>> > > > > >
>> > > > > > > on a map. My apologies if the question is too simplistic for
>> this
>> > > > > > > list, I am a newbie.
>> > > > > > >
>> > > > > > > Thanks,
>> > > > > > > Steve
>> > > > > > > AB5ID
>> > > > > >
>> > > > > > Suppose your friend has call AB4HB, then you could use something
>> > > > > > like:
>> > > > > >
>> > > > > > FROMEMAILADDRESS=dmesteve at gmail.com
>> > > > > > MYEMAILADDRESS=dmesteve at gmail.com
>> > > > > > APRSCALLSIGN=AB4HB
>> > > > > > SMTP_SERVER=smtp.ab5id.org
>> > > > > > axlisten -a | grep -q " fm $APRSCALLSIGN to " && echo "An APRS
>> packet
>> > > > > > from $APRSCALLSIGN has been heard" > /tmp/aprs_message.txt &&
>> env
>> > > > > > MAILRC=/dev/null from=$FROMEMAILADDRESS smtp=$SMTP_SERVER mailx
>> -v -n
>> > > > > > -s "Mail from APRS" $MYEMAILADDRESS < /tmp/aprs_message.txt &&
>> rm -f
>> > > > > > /tmp/aprs_message.txt
>> > > > > >
>> > > > > > Note that APRSCALLSIGN is case sensitive (unless you pass the -i
>> > > > > > option to grep). Note that SMTP_SERVER needs to be defined
>> according
>> > > > > > to your actual smtp server.
>> > > > > > Most importantly note that the above will send out an email
>> message
>> > > > > > for every packet that is received from APRSCALLSIGN and this
>> might
>> > > > > > not be desirable as there might be a lot of packets coming
>> > > > > > continuously (so you might do things better with some extra code
>> > > > > > that checks whether a message has already been sent recently,
>> for
>> > > > > > example by creating a temporary file each time a message is sent
>> and
>> > > > > > then checking that the timestamp of such file is not too recent
>> > > > > > before sending a new email message).
>> > > > > >
>> > > > > > Or otherwise you can download a tiny program that I wrote
>> > > > > > (ax_emergency_listen) which is generally used to monitor APRS
>> > > > > > emergency packets and adapt it to your needs (by modifying the C
>> > > > > > source code):
>> > > > > >
>> > > > > > http://iz6rdb.trentalancia.com/en/aprs_igate.html
>> > > > > >
>> > > > > > 73,
>> > > > > >
>> > > > > > Guido IZ6RDB
>> >
>> > Believe it or not, I've not forgotten about this.  I've spent about 10
>> hours
>> > so far doing design and outline work on the code.  I've also had to hunt
>> down
>> > some extremely nasty off-by-one bugs in the Java AVRS position parsers.
>>  Now
>> > that I'm getting reliable, accurate positions from all 4 types of
>> position
>> > packets (compressed, uncompressed, MICe, and raw NMEA) I can move on to
>> > alarms.
>> > In the AVRS sourceforge repo, there is a new package called Wedjet
>> > (net.ab0oo.aprs.wedjet) that contains some rudimentary code for
>> monitoring
>> > positions.  The alerting portion will come later.  I'm using a
>> Spring-injected
>> > Jetty container as a base web-server, so the whole thing can be self-
>> > contained.
>> > Give me another few days and I'll have something you can play with.
>>  Once we
>> > reach a stable beta point, we'll look for hosting options.
>> >
>> > John Gorkos
>> > AB0OO
>>
>> John,
>>
>> A sincere thank you. I had no idea how much work would be involved.
>>
>> Kind Regards,
>> Steve
>> AB5ID
>>
>> _______________________________________________
>> aprssig mailing list
>> aprssig at tapr.org
>> https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig
>>
>
>
>
> --
> rich at mulveyfamily.com
>
> _______________________________________________
> aprssig mailing list
> aprssig at tapr.org
> https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/aprssig_lists.tapr.org/attachments/20110216/3909e7ec/attachment.html>


More information about the aprssig mailing list