LaptopGPS Project

Test Notes
Home  
Questions or comments tbirchmire@usa.net

June - August 17, 2009Android developemnt. Tried various versions of packages. http://Phonegap.com provides a app framework to connect a web application to an Android phone (and they claim Iphone, Blackberry as well). After a number of false starts, I finally got a proof of concept working in the android emulator. gpsmancerA.apk. Applications can be developed with the Eclipse platform and exported to the Android emulator for testing. After debug mode, the application can be exported as a signed app that can be imported into the emulator or an Android phone like any other application. The gpsmancerA.apk starts in the Android and connects to the webpage at http://gpsmancer.com/android/phonegap . Once things are started in the Android the application links to the webpage and brings in the webpage. Interactions to web page are via AJAX. This avoids cross domain security issues because everything is coming from the android app. The initial header information doesn't using AJAX so communications to the Android functions are maintained. If the application didn't use AJAX, the various native functions linkage would be broken after the first off application URL request. If you want to test the proof of concept app you can download it at http://gpsmancer.com/android/phonegap/gpsmancerA.apk
Quirks in Android emulator:
Needed to comment out some code so things will complile:
open up AccelListener class and comment out //sensorManager = (SensorManager) mCtx.getSystemService(Context.SENSOR_SERVICE);
When you want to create a signed app rather than a debug signed app, delete the old app using the Emulator's Manage Applications or you can get into all sorts of install conflicts. Remember to set the application to debug = false.
The Eclipse package provides an easy way to sign an application.
Use the emulator's adb install function to install the now signed app.

May 3 - June 6 2009 Changed the way the browser gets GPS readings from the localhost to a Json request. This removes the cross domain restriction found in the browsers and greatly simpifies the logic as the need for a httprequest is removed from the browser and the local host logic.

Browser logic:


function newLocation(){
           //shamelessly hard code the url of the request
            var request = "http://localhost/gpslocation/getloc.php?callback=showLatLon";

            //Construct script node and add it to the document, causing the Get request
            //to the PHP script
            
            //Check for the existing script node
            var oScript = document.getElementById("dynamic_script_injection_node");

          // Get the script tag, if it exists
              var head = document.getElementsByTagName("head").item(0);
           // Remove the tag, if it exists to avoid the increase in size
          if (oScript) {
                
                head.removeChild(oScript);
          }

            script = document.createElement("script");
            script.setAttribute("id", "dynamic_script_injection_node");
            script.setAttribute("type", "text/javascript");
            script.setAttribute("src", request);
            // all set, add the script
            head.appendChild(script);
      }
 
 /*
       * THis function is called when the JSON string is returned from Getloc
       */

 function showLatLon(Pos) {

document.getElementById("p1N_dd").value = Pos.Ndd
document.getElementById("p1N_mm").value = Pos.Nmm

document.getElementById("p1W_dd").value = Pos.Wdd
document.getElementById("p1W_mm").value = Pos.Wmm 


}
 


Local Host Logic

  include ("./includes/function_global_variables.php");
    include ("./includes/gps_location.php");
   function where_am_I($call){
   include ("./includes/function_global_variables.php");
       global $coordinates;
 //     DebugBreak();  // incase Nusphere is needed for debug
  
	  $newgetposition = new getposition ;
		 $newgetposition->fetchgps();
		 $newgetposition->latlon();	 
	 }
	 // begin main logic
	 $callback = $_GET["callback"];
	 $Pos = null;
     where_am_I("M1");

    //encode output in JSON array
	
	$Pos =  array ('Ndd'=> $p1N_dd  ,  // 41
                  'Nmm'=> $p1N_mm  ,   // 17.123
				  'Wdd'=> $p1W_dd ,   // 071
				  'Wmm'=> $p1W_mm ,    // 22.405
				  );

				  

 $output = json_encode($Pos);
// 
print ($callback."(".$output.");");
//   

May 1-2, 2009 Added logic to OurTown-B to remember the last latitude/longitude entered so that the user doesn't have to keep keying the entire sequence on each refresh. Internally, decided that one global variable include was enough. The Global variable include provides access to various variables the functions need. (Global because they are in functions.)
April 30, 2009 Android development eclipse/emulator starting giving strange errors and finally wouldn't start at all. Downloaded a fresh copy of eclipse and android. Reading the installation procedure, I found that I had not done a few things for the setup. After I carefully redid things, the applications compiled and installed into the emulator correctly. The javascript test program can be called from the android emulator as a regular app. The program attatchs/connects to the server at gpsmancer.com. When the browser html loads it uses javascript to return a simulated lat/lon. The next process is to add the lat/lon code now that the other stuff is working.
Source Code Some sample android html/javasccript/android-java code.
April 22, 2009 Andriod development continues after downloading Eclipse and Android extension. It's all done in a unique to Android flavor of java where only the jave syntax is used. All the classes are unique to android. The results are displayed in the emulator. Internally, the logic is similar to the Our Town sequence in that the the application is started on the device which makes an internet request device. This is done so the browser HTML/Javascript can request an internal android function. I've gotten the android logic to go out via the emulator and display the Our Town game sequence. The latitude/longitude part does not work as yet.
March 24 - April 04 2009 Revised programs (marco-B/ourtown-B) uses a combination of browser AJAX and localhost HTTPrequest to overcome smae host browser AJAX limitation. Browser AJAX requests are sent from the browser to the local server where they are relayed to the server. Used a bit of javascript to change variables in the browser and a bit more to process the routing of the browser request when there is no gps attached.
March 16-23 2009 Decided to change design of Marco/Polo into an AJAX javascript talking to the localhost server. Marco logic will then be simplified to providing lat/lon upon request. This change should allow a more flexible logic on the server such that there can be one program providing the game logic. Wrote a revised marco that runs on the localhost server, reads the GPS, formats the data, and returns a data string with lat/lon in the proper format. Put together a small html form to test the Marco logic using javascript. Much to my surprise, things worked correctly and the javascript was able to retrieve the lat/lon data and return it to the browser. AJAX does indeed work.
March 14-15 2009 Field test of outtownMP. This series checked the lat/lon positions. All were in a resonable distance from where they were supposed to be. Maybe a few could be moved a little to the east. The main test was for mid-test recovery. Logged on with memorable id and worked a couple of zones. At this point the ASUS was powered down. After completing shopping, I turned the ASUS back on and was able to resume at the point I had left.
March 11-12 2009 Uploaded ourtownMP to gpsmancer.com/ourtownMP and transfered the marco portion to the USB flash drive> Every thing is packaged in a xampplite distro without MySQL so as to reduce the number of megabytes on the flash drive. It's slightly more than 130 meg. Plugged the flash drive into one of the ASUS usb ports. Ran the setup_xampp.bat so that things could be found. Started the apache server via start_apache.bat. Plugged the USB GPS into a usb port that thinks its com4 as gps devices all seem to run on a serial prot even when they are plugged into a USB port. Started the viaualGPS.exe to check reception. All was well. Started IE explorer and went to localhost://marco/marco.php?game_id=ourtownMP. All went well as I was immediately presented with the game signon screen from the server at http://gpsmancer.com . I proceeded through the game. At some point in the game, I inerrupted the browser to check the resume game function. I was able to resume the game where I left off. Tested the game menu at http://gpsmancer.com . Things went correctly from there as well.
March 1-10 2009 Marco/Polo game - added recovery mode so that if game is interrupted, the player can enter their user ID and pick up where they left off. "Our Town" is being revised to use the new logic. Working name is "ourtownMP" so as to distinguish it from the current version.
Month of Feb 2009 Worked on Marco/Polo concept over the month. Added http://gpsmancer.com/ourtown and posted on geocaching.com A number of people have played. Continued development on the laptop version that reads the lat/lon location, attaches it to the form return and sends it back to the server. This version uses MySQL on the server to remember at what stage the player is at. Ordered a usb-wireless modem for the laptop so as to play the game in the field. We also use the wireless modem to connect to the internet for email, cache info at geocaching.com, and to google for stuff.
Jan 30, 2009Decided the laptop/cellphone internet combination needed a cuter name: Marco Polo where Marco is the part that is in the laptop and Polo is the part that lives in the remote server. Marco connects to the internet via a local server which relays the request to Polo. The first game application will be called Rover. It will duplicate a GPS in that the Marco Panel will have a target waypoint and Polo will process the location data and return a panel with distance, bearing, and a ladybug compass graphic giving one of eight points (N, NE, E, SE, S, SW, W, NW)
Jan 25-28, 2009Added another cellphone/Iphone/laptop with Wireless internet game to http://gpsmancer.com site. "Our Town" is a tour of Needham. The game demonstrates an IPhone/Cellphone/Laptop with callphone internet capability can play a geocache game (along with a GPS Unit). The laptop portion continues apace to have the GPS provide location data to the local server which in turn connects to the server via the HTTP_Request where the actual processing takes place.
Jan 18, 2009 Field Test Took the Highland Fling program out into the snowstorm to test the roaming feature. Worked ok until I got out ot the car to get closer to the zone. At zone 4 the location stopped updating; perhaps the ASUS EEE does not like snow on the keyboard. Could not continue as the road to zone four was blocked by large snow drift too large for the AWD Tribute to go over. The cure for the roam update program not updating was to reinitialize the server. I do not know why it stopped updating the program. I'll return when the road has been plowed in a day or so. Secondary roads in a cemetery have a low priority.
Jan 12-17, 2009 gosM Developemnt The rewrite of the gpsM-1-0.php program continues. The logic became so convoluted I had to buy a copy of NuSphere PhpED so as to debug. It turns out the statelessness of html caused me to forget about saving some variables. After adding the direction and true course to the session save, things worked much better.
Dec 2008 - Jan 2009 Iphone Madness. Worked on Highland Fling logic. Lots of rewrites but eventually settled on current logic. Highland Fling .php cache sequence flow works the same as the Colorado version. As an aside I put the logic out as a Iphone web site at http://gpsmancer.com The panel sequence and answers are the same as the wherigo version. Added <meta name="viewport" content="width=320" /> to the panel headers so that everything would display on an Iphone with having to resize on each display. The task words and screens are the same as HighlandFling.
Nov 26 - Nov 30 2008. Thanksgiving in Fla Went to Fla over Thanksgiving and took ASUS EEE to work on game. After a number of starts and stops decided the game logic to be finite state and the gameengine logic could load a game via one or more include statements. Started "Highland Fling" theme from the wherigo cartridge game. The cartridge logic is compiled into one large file and is not easily followed. I went back to the original writeup - script. The emulator is useful to see how the script flows in an actual program.
Oct 31 - Nov 1 2008. Wednesday Took laptopGPS ASUS EEE to Geomeet where it found the dash waypoint to within 5 or 6 feet. Need add a Mark function to project.
Oct 23, 2008. Thursday Uploaded revised programs to thomasofneedham.com and to ASUs EEE. Enlarged header graphic to 160px so menu text will display correctly.
Oct 18-20, 2008. Wednesday Added Database program to mix so that the user can select a waypoint from any of several in a database of waypoints (linux/unix does not know what an .exe program is so the read Navibe has no meaning when the program is demoed in the on-line environment and it can't read the Navibe attached to the USB bus etc.)
Oct 4, 2008. Saturday After several days of really bad signals at home in the test area (The glass enclosed spa room), we went to Water Edge cache in Danvers/Topsfield for field test. I found that the signals were soon detected and if I moved the Navibe away from the eeePC the signals improved. Putting the receiver near the back of the laptop reduced the signal strength. Eventually, the unit got me to within 9.23 feet of the cache. Noticed that what is needed is a baby carrier for supporting the laptop in the front so I can walk around hands free. Came and tested the signal strength both in the spa room and with the receiver near the laptop and at a small distance. Outside with the receiver away from the laptop the signals were quite good. With the receiver near the laptop display the signals were reduced. Carrying the eeePC inside immediately reduced the signal strength. Putting the receiver near the display reduced the signal strength to unusable. Lesson - I must get a better test area.
Sept 25-28, 2008. Tuesday Added gpsdata database to MySQLto store waypoint data. flywithme_C.php has the ability to lookup a waypoint and load into the waypoint name and destination lat, lon via a url (http://localhost/laptopGPS/flywithme_C.pgp?waypoint=nnn ) Ported new program and database to the ASUS eee mini notebook. One useful note MySQL does not like a "-" dash in a field name. I had to change the names from wp-inum to wp_inum before MySQL could find anything. After that the database worked as expected.
Sept 16, 2008. Tuesday Took Gateway laptop over to Sawmill Steeplechase cache in Medfield. Navibe 720 would not acquire and Garmin 76csx was very very slow to acquire. Finished multi=cache loop though using Garmin.
Sept 11-14, 2008. Incorporated Navibe driver into flywithmeB.php. There were difficulties getting the Navibe 720 to acquire GPS data. Viewing reception with the SiRFDemo program revealed weak broken up signals. Both 720s had the same symptoms. Then in a mysterous manner, they decided to receive again. I sent screen shots of working and notworking to the Navibe people
Sept 8, 2008. Put together a Navibe driver using MGC4 GPGGA c program. Modified it to read 4 Lat/lon positions and exit. The test .php program displays the readings on the browser. Took test progam to win2000 toshiba laptop. It ran ok there as well.
Sept 1-7, 2008. Download evaluation package MGC4C -- MarshallSoft GPS Component for C/C+. It evaluated so I ordered the developers package. It has all sorts of GPS/USB c/c++ programs that can create .exes that can be installed on any Win2000/XP/Vista machine.
August 27, 2008. Loaded USB to COM software. Began compiling Navibe 270 .exe file. It's to read the Navibe and send the location to laptopGPS. This will replace the GPSbable to text file interface.
August 25, 2008. Went through Visual C++ tutorial and created a helloworld.exe which I placed in the test directory. Wrote a .php wrapper to see if the output would be displayed Hello World php wrapper Actually, it only works with in a win environment; it chokes in the Linux server environment as Linux doesn't know what to do with an .exe file.
August 24, 2008. Downloaded Microsoft C++ for compiling GPS receiver interface
August 23 Bought Dell inspiron 530 from Microcenter - Cambridge MA
Received Navibe GPS receivers (2) Model GM720 with usb connection. Begin looking for some c++ routines that can read the usb interface.
Aug 16, 2008. Saturday Took Toshiba laptop into field for trail trial at cache "HomeStead" at Homestead Farm. The cache was just off the parking lot down the trail. While walking down the trail, the laptop battery ran down about 75 feet from cache. The readings and compass pointed in the correct direction and distance. The program needs a toggle.
Other cache done was called "Pondering the Sky." GPS readings wonder around but in general pointed to the correct location.
Later that evening, I added a toggle so that flywithme has two modes. Mode "Auto" reads the GPS location very 15 seconds and recalcs the distance and location. Mode "Manual" uses the process button to recalc coordinates from the screen and does not read the GPS location. If in mode "Auto" and the Process button is pressed, the new location is read from the GPS and distance-location are recalculated.

Aug 15 2008 Friday. Added GPS read routines to form.php so that user could use laptop in field to locate a geocache. Called new program "flywithme.php" because of ladybug compass readout.
Form Program  Waypoint calculation between two points no GPS
Read GPS Unit   Hard to do without a GPS unit connected to com1 or the usb.
Use GPSbabel to Garmin 76 to text file for location data.
Late 2007 into 2008. Write a Garmin Colorado "Where I Go" game "HighlandFling" .
Begin looking into formuals for determining distance and Truecourse caalculations and generally program GPS function into a laptop computer.