1 2 3 Previous Next 72 Replies Latest reply on Feb 6, 2014 5:36 PM by gwallis

    Ways to send GPS Info to remote Computer

    gwallis

      I have a FMGo solution that allows me to capture the iPhone/iPad's current Lat/Long and I want to explore the different ways of 'sending' that info to a remote computer. I now that you can email the info but what other options are there? Can FMGo send SMS messages? And can those messages be automatically sent to a computer running FM Pro? I do not want to maintain a constant connection to the remote comuputer... just every five minutes or so.

       

      Thanks for your help in this matter.

        • 1. Re: Ways to send GPS Info to remote Computer
          LyndsayHowarth

          Hi gwallis,

           

          This will depend what version of FIleMaker you are running as your server or host... and I note that you said FM Pro.

           

          Using your Go solution, it will also depend on what features have been built into the solution. If you have built this solution, then obviously you can make changes as required to the file... if not, you may be dependent on the built-in features like send email.

           

          The FM Go file can be modified to add or update the FM Pro file.

          To do this it must be able to connect through your firewall & router with the appropriate ports opened. Port Forwarding is usually also required. It also must have either a static IP address for the router or use a service like No-IP to direct to the updating address. The database would have to remain open and available.

          Then, probably, one of the simplest method would be to have a relationship from the Go (Client) file to the hosted FM Pro (Server) file which allows a portal to show on a Go layout from the related table. This needs to be set up with fully qualified paths to the Server file in FIle Reference. A simple script can then set the field relatedtable::Lat to the value of Lat in the local table then the same with the Long. The specifics then vary according to whether you are creating a new record or editing an existing record.

          There are a few other variations and alternative methods... including plugins to manage 'synching'. I think ODBC is also an option with FM Pro.

           

          If you were to use FIleMaker Server or Server Advanced as the Server to host the files... a number of other options become available... that don't require a permanent relationship and constant connection.

          I might, for eg, have a little web viewer which refreshes a php page every time you exit either field... with the role of the page being to check for an existing matching value for the location or such and creating a matching record if no record is found or updating the new values if a match is found.

          If you were tracking current Lat/Long of say a car... without retaining any history... you might just edit the same record over and over... But if you are logging each new location of say a taxi... you would be creating new records...

           

          HTH

          - Lyndsay

          • 2. Re: Ways to send GPS Info to remote Computer
            PSI

            Hi gwallis,

             

             

             

            If your in house fmp system is hosted by fms you could setup a php web page that can receive a url string and create the required records. The string would be something like…

             

             

             

            "http://ipofserver/processgps.php?Action=C&Date=" & Datevalue & "&Time="& TimeValue & "&Lat=" & LatValue &"&Long=" & LongValue & "&UserAccount=php&Code=xxYYxx"

             

             

             

            You can add any additional data to the string. The code at the end is a way to validate that the request is valid.

             

             

             

            John Morina

             

            Pueblo System, Inc.

             

            CCQ-FM Inc.

             

            O: 631.549.0969

             

            C: 516.443.0966

             

            john@pueblo-systems.com

            • 3. Re: Ways to send GPS Info to remote Computer
              stevecaya

              Could you share how your FM go solution caputures the Lat / long location?

               

              Thanks

               

              Steve

              • 4. Re: Ways to send GPS Info to remote Computer
                gwallis

                John,

                 

                I am trying to send the lat/long from the remote device (iPad using FMGo... I already have figured out how to accomplish this) to Filemaker running at my customers location.  I am very conversant with FMP and know all about port forwarding, etc.

                 

                That being said... are you saying that I should have the iPad send its current lat/long to a PHP Website and have the office computer logon to the same website and extract the lat/long... using the PHP Website as an intermediary?  Am I following you correctly?

                 

                BTW, I do appreciate everyones help in this mater.

                 

                Gary Wallis

                Hendrix Wireless

                • 5. Re: Ways to send GPS Info to remote Computer
                  gwallis

                  Steve,

                   

                  I 'set' a webviewer field with the following html code:

                   

                   

                  <!DOCTYPE HTML>

                  <html>

                      <head>

                   

                          <script type="text/javascript">

                   

                              function handler(location) {

                                  var message = document.getElementById("messageArea");

                                  messageArea.innerHTML="<p>Latitude: " + location.coords.latitude + "</p>";

                                  messageArea.innerHTML+="<p>Longitude: " + location.coords.longitude + "</p>";

                                  messageArea.innerHTML+="<p>Accuracy: " + location.coords.accuracy + "</p>";

                              }

                         

                              function getLocation() {

                                  navigator.geolocation.getCurrentPosition(handler);

                              }

                             

                          </script>

                   

                      </head>

                   

                      <body onload="getLocation();">

                          <div id="messageArea">

                              Location unknown

                          </div>

                      </body>

                   

                  </html>

                   

                   

                  If run on a device such as an iPad or iPhone running FMGo the code returns the devices current Lat/Long.  I am just trying to find out the best way to send this info back to the office computer.  I know that FMGo can send PDF's and Emails that have this info contained within the document.... is it possible to send this info directly to a specific address using UDP or TCP.

                   

                  I have a functioning application now that does this using a cellular modem from Sierra Wireless.  I would like to use the iPad and FMGo to accomplish the same thing.

                   

                  Gary Wallis

                  Hendrix Wireless

                  • 6. Re: Ways to send GPS Info to remote Computer
                    gwallis

                    Lyndsay,

                     

                    See my reply to John... I beleive that you are both saying the same thing.  Am I correct in this?

                     

                    Gary

                    • 7. Re: Ways to send GPS Info to remote Computer
                      gwallis

                      To All...

                       

                      In re-reading the title of my Post... I should have framed it 'Ways to get GPS Info from a remote computer'... sorry for any confusion that this may have caused.

                       

                       

                      GW

                      • 8. Re: Ways to send GPS Info to remote Computer
                        PSI

                        Gary,

                         

                        Obviously there are a lot of unknowns about your process. I have been using this method like so...

                         

                        I have client runtime systems that are given to referring physicians to recieve reports. We wanted a way to know when the reports are downloaded, viewed/printed or exported. so we used the method i described. I was thinking you would have this page hosted at your client. It could be setup to post the data directly to their system. Where it's posted, either to a temporary table or ? depends upon the actual details.

                         

                        It is very easy to setup FMS to host a simple page like this and it doesn't require much bandwidth.

                         

                        John Morina

                        Pueblo Systems, Inc.

                         

                        gwallis wrote:

                         

                        John,

                         

                        I am trying to send the lat/long from the remote device (iPad using FMGo... I already have figured out how to accomplish this) to Filemaker running at my customers location.  I am very conversant with FMP and know all about port forwarding, etc.

                         

                        That being said... are you saying that I should have the iPad send its current lat/long to a PHP Website and have the office computer logon to the same website and extract the lat/long... using the PHP Website as an intermediary?  Am I following you correctly?

                         

                        BTW, I do appreciate everyones help in this mater.

                         

                        Gary Wallis

                        Hendrix Wireless

                        • 9. Re: Ways to send GPS Info to remote Computer
                          gwallis

                          John,

                           

                          Forgive me for being a little 'Thick' today... I am not very educated on PHP.

                           

                          Are you stating that it is possible to send a structured PHP URL directly into the fields of the 'Hosted' FMP file?  Let me know if this is what I am hearing....

                           

                          "I host a Custom PHP website from filemaker server at my office.  I then can have my GeoLocation file, running in FMGo on an iPad, collect the Lat/Long and structure a URL that sends the Lat/Long to the Hosted PHP Website... and the Lat/Long is entered into the hosted file... in the appropriate fields."

                           

                          Have I got any of this correct... am I missing something?  Because it sounds exactly what I am looking for!

                           

                          Now all I have to do is figure out how to structure the PHP URL. 

                           

                          Gary Wallis

                          Hendrix Wireless

                          • 10. Re: Ways to send GPS Info to remote Computer
                            PSI

                            The PHP page that you host at the client will do all the heavy lifting. It can either update an existing record, if you know the primary key, or create a new record. The URL string is the data you want to post.  My PHP programmer built the page. But all the logic lives on that page on the server. If you like to contact me directly we could create the page for you.

                             

                             

                             

                            John Morina

                             

                            CCQ-FM Inc.

                             

                            O: 631.549.0969

                             

                            C: 516.443.0966

                             

                            John.morina@ccq-fm.com

                            • 11. Re: Ways to send GPS Info to remote Computer
                              LyndsayHowarth

                              Hi Gary,

                               

                              That same page... if given a PHP extension could have a little PHP script in it that updated the file on the server... as long as the server is running FM Server not just plain old FM Pro.

                               

                              - Lyndsay

                              • 12. Re: Ways to send GPS Info to remote Computer
                                LyndsayHowarth

                                Hi Gary,

                                 

                                John was proposing to send a url... whereas my approach was to have an embedded script in a php page...

                                 

                                there are many ways to do the same thing...

                                 

                                I write a lot of PHP code which does these kinds of things... talking to the database and integrating with other sources of info or files. I used to have a geocoding demo online but I'm not sure it is live anymore. I'll check what state it is in...

                                 

                                - Lynday

                                • 13. Re: Ways to send GPS Info to remote Computer
                                  mdenyse

                                  Gary,

                                   

                                  Here's a short example. It'll either add or edit an existing record depending on whether you pass in a record ID. Use at your own risk - I didn't include any real error checking.

                                   

                                  <?php

                                  /*

                                     latlong.php

                                   

                                     Usage: http://www.example.com/latlong.php?lat=42.358107876056515&long=-71.0636579990387

                                            -or-

                                     Usage: http://www.example.com/latlong.php?lat=42.358107876056515&long=-71.0636579990387&id=1



                                  */

                                   

                                  ini_set('error_reporting', E_ALL & ~E_DEPRECATED);

                                  ini_set('display_errors', 'on');

                                   

                                  require_once('FileMaker.php');

                                   

                                  echo nl2br(print_r($_GET, true)); /* For debugging - see what was passed to us */

                                   

                                  $lat = array_key_exists('lat', $_GET) ? $_GET['lat'] : NULL;

                                  $long = array_key_exists('long', $_GET) ? $_GET['long'] : NULL;

                                  $recordID = array_key_exists('id', $_GET) ? $_GET['id'] : NULL;

                                   

                                  AddEditLocationRecord($lat, $long, $recordID);

                                   

                                  function AddEditLocationRecord($lat, $long, $recordID = NULL)

                                  {

                                     if (($lat != NULL) && ($long != NULL)) {

                                   

                                        $fm = new FileMaker('DATABASE_NAME', 'SERVER_URL', 'USER_NAME', 'PASSWORD');

                                   

                                        if ($recordID == NULL) {

                                           $addEditRecordRequest = $fm->newAddCommand('LAYOUT_NAME');

                                        }

                                        else {

                                           $addEditRecordRequest = $fm->newEditCommand('LAYOUT_NAME', $recordID);

                                        }

                                   

                                        $addEditRecordRequest->setField('LATITUDE_FIELD_NAME', $lat);

                                        $addEditRecordRequest->setField('LONGITUDE_FIELD_NAME', $long);

                                   

                                        $result = $addEditRecordRequest->execute();

                                   

                                        if (FileMaker::isError($result)) {

                                           echo 'Error! Error code: '. $result->getCode() .'. Message: '. $result->getMessage();

                                        }

                                     }

                                    return;

                                  }

                                  ?>

                                   

                                   

                                   

                                  --

                                  Mark DeNyse

                                  508-514-1010

                                  DriftwoodInteractive.com

                                  • 14. Re: Ways to send GPS Info to remote Computer
                                    gwallis

                                    Mark,

                                     

                                    Thanks so much for help in this matter!

                                     

                                    I assume that the PHP Web Page listed above can stand on its own without being embedded inside additional HTML Code.  I also assume that the two 'Usage' URL's listed above is the format of the URL to be 'sent' by the remote device (iPad).  One for just adding a new record and the other using an ID Key tied to a specific record.

                                     

                                    If this is not the case please advise.

                                     

                                    I am in the process of setting up the FMP Server as we speak and will let you and John know how it turned out.

                                     

                                    Once again, many Thanks for your assistance,

                                     

                                    Gary Wallis

                                    Hendrix Wireless

                                    Whitefish Bay, WI

                                    414-698-8537

                                    1 2 3 Previous Next