I hope it won't send me a txt every time a position happens within the bounding box??  Perhaps an 80 minute delay (to coincide with the min time to orbit the earth for LEOs).<br><br clear="all">Wes 
<div>---</div>
<div>"Language shapes the way we think, and determines what we can think about." -- B. L. Whorf</div><br>
<br><br><div class="gmail_quote">On Wed, Feb 16, 2011 at 17:54, John Gorkos <span dir="ltr"><<a href="mailto:jgorkos@gmail.com">jgorkos@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I agree the initial code effort is trivially easy, and this does indeed work.<br>
The goal I was shooting for was a little beyond this.  Here's the requirements<br>
doc for what I'm aiming for:<br>
<br>
*  work for multiple users, with multiple notification paths for each.<br>
Specifically, provide multiple email addresses and the option for an APRS<br>
message sent to a specific call sign.<br>
<br>
* allow for both point and area zones of interest, i.e. "within 500 meters of<br>
point x,y", or "incusion into zone defined by "x,y (NE) - x,y (SW)"<br>
<br>
* differentiate between "approaching" and "departing" (i.e. "AB0OO is<br>
approaching home" shouldn't trigger when I leave the house in the morning to<br>
go to work)<br>
<br>
* set up time windows for various notifications, and reset-times that prevent<br>
rapid-fire messaging (unfortunately, your Perl script will page me at 0200,<br>
when I really don't want to be woken up).<br>
<br>
The design of a set of business rules, a method for storing those rules, and<br>
the logic to execute those rules requires some framework and some support code<br>
to go with it.  On top of that, the user interface needs to be something more<br>
than "edit this script with your hardcoded information".  Something more along<br>
the lines of "go to this web page, register as a user, select call signs<br>
you're interested in, select the times and other business rules you want<br>
applied to those callsigns, send a test message, etc" is what I'm shooting<br>
for.  Finally, in the end, it needs to be documented (which your Perl is,<br>
kudos to you) and published in a source repository so people 5 years from now<br>
can find it, modify it, extend it, or whatever.  There's nothing more<br>
frustrating than having a new guy join the APRS sig 10 months from now and ask<br>
this same question, and someone shoot back "yeah, there was a Perl script<br>
posted a few months back that does that.  Search the archives."<br>
<br>
On the other hand, quick and dirty gets the job done.  It's just unfortunate<br>
that so many good ideas die at the "quick and dirty, I scratched my itch<br>
you're on your own for anything else" stage.<br>
<br>
Imagine the value of being part of a road race that is supported by APRS.  You<br>
can ask the race director for his cell phone number, and then set him up to<br>
recieve a text message whenever the LEAD, TRAIL, or SAG tracker passes any<br>
number of specific points on the course...<br>
<br>
Thanks for proving it can be done in less than 60 lines of Perl, though.  I<br>
think all 3 of Larry Wall's "Three Virtues of a Programmer" are well<br>
represented here.<br>
<font color="#888888"><br>
John Gorkos<br>
</font><div><div></div><div class="h5"><br>
On Wednesday, February 16, 2011 12:09:38 Rich Mulvey wrote:<br>
> I hadn't followed this topic before, but if you have a machine you can run<br>
> perl on, this is trivially easy.  I just whipped up this script and tested<br>
> it.  Replace the callsign, recipient, and sender addresses, and run it<br>
> periodically.<br>
><br>
> It will store the last position found for the callsign, then, then next<br>
> time it runs, if the lat/long differ, it will send an email.  Most cell<br>
> providers provide an email gateway to allow you to email SMS messages to<br>
> someone.<br>
><br>
> Obviously you'd want to surpress position changes within some window (<br>
> i.e., less than 100 feet ).  Plus probably some more error checking.  ;-)<br>
><br>
> ---<br>
> #!/usr/bin/perl<br>
><br>
> use strict;<br>
> use Ham::APRS::LastPacket;<br>
> use Storable;<br>
> use Email::Sender::Simple qw(sendmail);<br>
> use Email::Simple;<br>
> use Email::Simple::Creator;<br>
><br>
><br>
> my $callsign = "MYCALLSIGN";<br>
> my $recipient = "blah\@<a href="http://blah.com" target="_blank">blah.com</a>";<br>
> my $sender = "myposition\@<a href="http://blah.com" target="_blank">blah.com</a>";<br>
> my %lastPosition;<br>
><br>
> my $aprs = Ham::APRS::LastPacket->new;<br>
> $aprs->set_callsign($callsign);<br>
><br>
> # Load the last position, if we've stored it<br>
> if( -r $callsign ) {<br>
>    %lastPosition = %{retrieve $callsign};<br>
> }<br>
><br>
><br>
> my $packet = $aprs->get_data;<br>
> die $aprs->error_message if $aprs->is_error;<br>
><br>
> # get the position report<br>
> print "$callsign is at<br>
> $packet->{position}->{latitude}->{degrees},$packet->{position}->{longitude}<br>
> ->{degrees}\n";<br>
><br>
> # If the position has changed, send out an email<br>
> if( ( $lastPosition{latitude} != $packet->{position}->{latitude}->{degrees}<br>
> ) ||<br>
>     ( $lastPosition{'longitude'} !=<br>
> $packet->{position}->{longitude}->{degrees} ) ) {<br>
>    sendEmail();<br>
> }<br>
><br>
> # Save the position<br>
> $lastPosition{'latitude'} = $packet->{position}->{latitude}->{degrees};<br>
> $lastPosition{'longitude'} = $packet->{position}->{longitude}->{degrees};<br>
> store \%lastPosition, $callsign;<br>
><br>
><br>
> sub sendEmail {<br>
>    print "Sending a movement report\n";<br>
><br>
>    my $email = Email::Simple->create(<br>
>     header => [<br>
>     To      => $recipient,<br>
>     From    => $sender,<br>
>     Subject => "$callsign position report",<br>
>     ],<br>
>     body => "$callsign has moved",<br>
>    );<br>
><br>
> sendmail($email);<br>
> }<br>
><br>
> On Wed, Feb 16, 2011 at 12:19 AM, Steve Hanis <<a href="mailto:dmesteve@gmail.com">dmesteve@gmail.com</a>> wrote:<br>
> > On Tue, Feb 15, 2011 at 10:22 PM, John Gorkos <<a href="mailto:jgorkos@gmail.com">jgorkos@gmail.com</a>> wrote:<br>
> > > On Friday, February 11, 2011 09:51:24 AM Steve Hanis wrote:<br>
> > > > Hi John,<br>
> > > ><br>
> > > > I have no intention of irritating anyone one the list, and apologize<br>
> > > > if I have done so. I haven't written any programs since college back<br>
> > > > in the early 90's and don't consider myself programmer, I use Linux<br>
> > > > occasionally. I was made aware of this list after I posed this same<br>
> > > > question on the APRS Yahoo group.<br>
> > > ><br>
> > > > What I am looking for is something like what is described on<br>
> > > > <a href="http://www.aprs.org/aprs-messaging.html" target="_blank">http://www.aprs.org/aprs-messaging.html</a>:<br>
> > > ><br>
> > > > "APRS Messages to Your Cellphone: . N3FLR Frank Rossi reports that he<br>
> > > > uses "YahooAlert" to send all of his APRS messages to his cell phone.<br>
> > > > First, Find-U has RSS output capability so he has his computer RSS<br>
> > > > Feed Reader watching his Feed From FindU, and YahooAlert also<br>
> > > > watching. After setting up Yahoo Alert for a pager, he uses his<br>
> > > > phone's text e-mail address such as <a href="mailto:xxxxxxxxxx@txt.att.net">xxxxxxxxxx@txt.att.net</a> . Then you<br>
> > > > just need to know what your phone's "e-mail address" to "text<br>
> > > > address" is. You don't need mobile internet to do it this way, just<br>
> > > > text ability. That will work with a text pager also. . When FINDU<br>
> > > > sees a message to him on APRS it generates an RSS Feed that now<br>
> > > > Yahoo-Alerts is watching. YahooAlerts then forwards the RSS Message<br>
> > > > as Text to his cell phone. Although this is only one way<br>
> > > > communications, it still lets him receive his APRS messages. He also<br>
> > > > says that you can set up RSS feeds from FindU for weather alerts, or<br>
> > > > APRS users X amount of miles from you. You can make the miles<br>
> > > > anything you want. He has not tried that function yet."<br>
> > > ><br>
> > > > I've tried this to no avail, but was wondering if anyone else had<br>
> > > > come up with a different way to accomplish the same goal. I have no<br>
> > > > commercial interest in this, I just want to be pinged on my cell<br>
> > > > phone (SMS, Email, IM) when my friend goes mobile, or for special<br>
> > > > cases like a high altitude balloon with a known call sign goes<br>
> > > > active on APRS.<br>
> > > ><br>
> > > > Kind Regards,<br>
> > > > Steve<br>
> > > ><br>
> > > > On Fri, Feb 11, 2011 at 7:35 AM, John Gorkos <<a href="mailto:jgorkos@gmail.com">jgorkos@gmail.com</a>><br>
> ><br>
> > wrote:<br>
> > > > > It "can" be done.  It hasn't yet.  What you're asking for is 4-6<br>
> ><br>
> > hours of<br>
> ><br>
> > > > > custom coding (mostly for the web interface).  Do you have a web<br>
> ><br>
> > server<br>
> ><br>
> > > > > that can host something like this?  I've got a few hours this<br>
> > > > > weekend<br>
> ><br>
> > I<br>
> ><br>
> > > > > can use to code this.<br>
> > > > > Let me make sure I've got the requirements right:<br>
> > > > > You want a web interface that allows you to enter a "monitored"<br>
> > > > > call sign, and an email address to send a message to when that<br>
> > > > > position report from that monitored callsign indicates movement.<br>
> > > > > You want one message only.  Then, time passes and the monitored<br>
> > > > > station stops<br>
> ><br>
> > moving.<br>
> ><br>
> > > > >  Once the station starts moving again, you want another text<br>
> > > > >  message.<br>
> > > > ><br>
> > > > > The SMS messages will have to be sent via email (i.e.<br>
> > > > > <a href="mailto:2125551212@sms.verizon.com">2125551212@sms.verizon.com</a>), since a direct SMS interface is spendy<br>
> ><br>
> > and<br>
> ><br>
> > > > > less standard.<br>
> > > > ><br>
> > > > > Do you have any programming skills you could apply to this?  Web<br>
> ><br>
> > design,<br>
> ><br>
> > > > > maybe?  I hate web design, but the back-end portion isn't too<br>
> ><br>
> > difficult.<br>
> ><br>
> > > > >  This request will probably irritate some people on this list,<br>
> > > > >  FWIW. Everyone has an imaginary line they draw between "ham<br>
> > > > >  radio" and<br>
> > > > ><br>
> > > > > "commercial radio and internet."  Using your cellphone/commercial<br>
> ><br>
> > radio<br>
> ><br>
> > > > > to get updates about APRS happenings on ham radio is probably on<br>
> > > > > the<br>
> ><br>
> > far<br>
> ><br>
> > > > > side of some peoples' lines.<br>
> > > > ><br>
> > > > > John Gorkos<br>
> > > > > AB0OO<br>
> > > > ><br>
> > > > > On Thursday, February 10, 2011 18:48:04 Steve Hanis wrote:<br>
> > > > > > Thank you for your reply. I am looking for a way to trigger an<br>
> ><br>
> > email,<br>
> ><br>
> > > > > > IM or SMS using existing web interfaces. A way to "push" an alert<br>
> ><br>
> > to<br>
> ><br>
> > > > > > me when I am working or relaxing at home. Can this be done?<br>
> > > > > > Kind Regards,<br>
> > > > > > Steve<br>
> > > > > ><br>
> > > > > ><br>
> > > > > ><br>
> > > > > > On Tue, Feb 8, 2011 at 10:41 AM, Guido Trentalancia<br>
> > > > > > <<a href="mailto:iz6rdb@trentalancia.com">iz6rdb@trentalancia.com</a><br>
> > > > > ><br>
> > > > > > > wrote:<br>
> > > > > > ><br>
> > > > > > > Hello Steve !<br>
> > > > > > ><br>
> > > > > > > On Mon, 07/02/2011 at 22.19 -0600, Steve Hanis wrote:<br>
> > > > > > > > A friend and I just starting using APRS.  Is there way to<br>
> ><br>
> > trigger a<br>
> ><br>
> > > > > > > > SMS<br>
> > > > > > ><br>
> > > > > > > text<br>
> > > > > > ><br>
> > > > > > > > message or email via Internet monitoring when his APRS goes<br>
> ><br>
> > active<br>
> ><br>
> > > > > > > > or<br>
> > > > > > ><br>
> > > > > > > moving?<br>
> > > > > > ><br>
> > > > > > > > This would let me know he is mobile and available to chat or<br>
> ><br>
> > view<br>
> ><br>
> > > > > > > > his<br>
> > > > > > ><br>
> > > > > > > location<br>
> > > > > > ><br>
> > > > > > > > on a map. My apologies if the question is too simplistic for<br>
> ><br>
> > this<br>
> ><br>
> > > > > > > > list, I am a newbie.<br>
> > > > > > > ><br>
> > > > > > > > Thanks,<br>
> > > > > > > > Steve<br>
> > > > > > > > AB5ID<br>
> > > > > > ><br>
> > > > > > > Suppose your friend has call AB4HB, then you could use<br>
> > > > > > > something like:<br>
> > > > > > ><br>
> > > > > > > FROMEMAILADDRESS=<a href="mailto:dmesteve@gmail.com">dmesteve@gmail.com</a><br>
> > > > > > > MYEMAILADDRESS=<a href="mailto:dmesteve@gmail.com">dmesteve@gmail.com</a><br>
> > > > > > > APRSCALLSIGN=AB4HB<br>
> > > > > > > SMTP_SERVER=<a href="http://smtp.ab5id.org" target="_blank">smtp.ab5id.org</a><br>
> > > > > > > axlisten -a | grep -q " fm $APRSCALLSIGN to " && echo "An APRS<br>
> ><br>
> > packet<br>
> ><br>
> > > > > > > from $APRSCALLSIGN has been heard" > /tmp/aprs_message.txt &&<br>
> > > > > > > env MAILRC=/dev/null from=$FROMEMAILADDRESS smtp=$SMTP_SERVER<br>
> > > > > > > mailx<br>
> ><br>
> > -v -n<br>
> ><br>
> > > > > > > -s "Mail from APRS" $MYEMAILADDRESS < /tmp/aprs_message.txt &&<br>
> > > > > > > rm<br>
> ><br>
> > -f<br>
> ><br>
> > > > > > > /tmp/aprs_message.txt<br>
> > > > > > ><br>
> > > > > > > Note that APRSCALLSIGN is case sensitive (unless you pass the<br>
> > > > > > > -i option to grep). Note that SMTP_SERVER needs to be defined<br>
> ><br>
> > according<br>
> ><br>
> > > > > > > to your actual smtp server.<br>
> > > > > > > Most importantly note that the above will send out an email<br>
> ><br>
> > message<br>
> ><br>
> > > > > > > for every packet that is received from APRSCALLSIGN and this<br>
> ><br>
> > might<br>
> ><br>
> > > > > > > not be desirable as there might be a lot of packets coming<br>
> > > > > > > continuously (so you might do things better with some extra<br>
> > > > > > > code that checks whether a message has already been sent<br>
> > > > > > > recently, for example by creating a temporary file each time a<br>
> > > > > > > message is sent<br>
> ><br>
> > and<br>
> ><br>
> > > > > > > then checking that the timestamp of such file is not too recent<br>
> > > > > > > before sending a new email message).<br>
> > > > > > ><br>
> > > > > > > Or otherwise you can download a tiny program that I wrote<br>
> > > > > > > (ax_emergency_listen) which is generally used to monitor APRS<br>
> > > > > > > emergency packets and adapt it to your needs (by modifying the<br>
> > > > > > > C source code):<br>
> > > > > > ><br>
> > > > > > > <a href="http://iz6rdb.trentalancia.com/en/aprs_igate.html" target="_blank">http://iz6rdb.trentalancia.com/en/aprs_igate.html</a><br>
> > > > > > ><br>
> > > > > > > 73,<br>
> > > > > > ><br>
> > > > > > > Guido IZ6RDB<br>
> > ><br>
> > > Believe it or not, I've not forgotten about this.  I've spent about 10<br>
> ><br>
> > hours<br>
> ><br>
> > > so far doing design and outline work on the code.  I've also had to<br>
> > > hunt<br>
> ><br>
> > down<br>
> ><br>
> > > some extremely nasty off-by-one bugs in the Java AVRS position parsers.<br>
> ><br>
> >  Now<br>
> ><br>
> > > that I'm getting reliable, accurate positions from all 4 types of<br>
> ><br>
> > position<br>
> ><br>
> > > packets (compressed, uncompressed, MICe, and raw NMEA) I can move on to<br>
> > > alarms.<br>
> > > In the AVRS sourceforge repo, there is a new package called Wedjet<br>
> > > (net.ab0oo.aprs.wedjet) that contains some rudimentary code for<br>
> ><br>
> > monitoring<br>
> ><br>
> > > positions.  The alerting portion will come later.  I'm using a<br>
> ><br>
> > Spring-injected<br>
> ><br>
> > > Jetty container as a base web-server, so the whole thing can be self-<br>
> > > contained.<br>
> > > Give me another few days and I'll have something you can play with.<br>
> > > Once<br>
> ><br>
> > we<br>
> ><br>
> > > reach a stable beta point, we'll look for hosting options.<br>
> > ><br>
> > > John Gorkos<br>
> > > AB0OO<br>
> ><br>
> > John,<br>
> ><br>
> > A sincere thank you. I had no idea how much work would be involved.<br>
> ><br>
> > Kind Regards,<br>
> > Steve<br>
> > AB5ID<br>
> ><br>
> > _______________________________________________<br>
> > aprssig mailing list<br>
> > <a href="mailto:aprssig@tapr.org">aprssig@tapr.org</a><br>
> > <a href="https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig" target="_blank">https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig</a><br>
<br>
_______________________________________________<br>
aprssig mailing list<br>
<a href="mailto:aprssig@tapr.org">aprssig@tapr.org</a><br>
<a href="https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig" target="_blank">https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig</a><br>
</div></div></blockquote></div><br>