Wednesday, December 31, 2008

So I thought, ahead of new year, I should just prove end-to-end the components of the GPSd service.   What better way than to plot our current position on a map.

Using a converted version of the GPSd client, that we talked about previously,  I parse the NMEA data coming from the GPS and produce an XML file of the following -

<?xml version="1.0" encoding="utf-8" ?>
<movingmap>
  <latitude>51.267</latitude>
  <longitude>-1.108</longitude>
  <bearing>182</bearing>
  <speed>90</speed>
  <altitude>3000</altitude>
  <timestamp>0950</timestamp>
</movingmap>

This process runs continually only when we have a valid GPS position (this is important to avoid getting really lost).    I haven't quite finished this bit,  but will post it when complete.

 

Now the fun bit.   Using a very simple web page and a little bit of AJAX,  we plot a map using Virtual Earth.   Then using AJAX we poll our XML location file every 5 seconds.     We then parse the returned XML and draw an icon on the map.

image

The icon can of course be anything you like, I've chosen an executive jet :-)

The illusion is then complete, we have a continually updating map showing our current location from wherever the GPSd is running.

I guess, I was thinking that this would be a great web-page to available when you initially connected to the aircrafts/ships wireless network.

Full source 

 

NMEA parser to follow.

Please let me know if this application is of any use to you?

 

Happy New Year!

Wednesday, December 31, 2008 11:47:29 AM UTC  #    Comments [0]  | 
Tuesday, December 30, 2008

Just to prove that it can be done.   Here is a GPSd client running on a mobile device.

 

image

 

I'm just getting the raw stream of NMEA data out of the GPS (which is the whole point of GPSd).   Obviously the client can then use this data for its own purposes.

To make the example shown work,  I have laptop connected to home wireless network and in turn connected to GPS via BlueTooth.

The Windows Mobile device is also on my wireless network and picks up the GPSd server running on the laptop.

The fun part of the demo, is that for the GPS to work (I'm using a Holux Gr-230xx)  it has to have line of sight with the sky, so the GPS has to sit outside in garden. Brrrrr....

Tuesday, December 30, 2008 3:47:18 PM UTC  #    Comments [0]  | 
Monday, December 29, 2008

So a step further today.    I've got the GPSd service up and working with a Bluetooth GPS.     I've also got everything running nicely as a Windows service.

Finally,  I wrote a small client that connects to the GPSd service.   Full source available -

 

Next task is to perfect the auto-discovery of GPSd services, then onto writing some nice moving map applications.

Monday, December 29, 2008 11:22:52 PM UTC  #    Comments [0]  | 
Sunday, December 28, 2008

Just found this website,  which is prefect for getting rid of old mobile devices...

http://www.fonebank.com/

Sunday, December 28, 2008 12:22:07 PM UTC  #    Comments [0]  | 
Saturday, December 27, 2008

So back on the topic of GPSd,  I thought it was pretty wasteful to have the GPS device broadcasting to the world if no machines are connected to the service.

So today I implemented a feature that monitors the number of connections to the service and only starts the GPS connection when the first client connects.

New version

Saturday, December 27, 2008 8:16:03 PM UTC  #    Comments [0]  | 
Wednesday, December 24, 2008

Ok, last post I talked about the possibility of being able to subscribe to a published GPS.

Well I've only gone and done it.   

I've built a small GPS server that broadcasts the data from a connected GPS.  This is the server running -

image 

To attach type TELNET localhost 2947   at your favourite command prompt.

You'll see the GPS being broadcast like so -

image

(looks about the same doesn't it, which I guess is the whole point)

Full Visual Studio project  -

Let my know what you think?    Its a multi-threaded server, which isn't my strongest programming area.  Please feel free to shoot me down.    I haven't tried it with a real GPS so currently its just looping around a file to simulate a connection to a real device.    

Next to try building a client and a way of auto-discovering GPSd servers.   Anyone got a cruise ship I can install this on?

Happy Christmas All.

Wednesday, December 24, 2008 3:34:15 PM UTC  #    Comments [0]  | 
Monday, December 22, 2008

So I got thinking,   if your sitting as a passenger on a train, boat, plane, car etc.  Wouldn't it be cool to be able to pickup the position of the vehicle your sitting in on your laptop/PDA.    I was thinking along the lines as the mapping displays that you get in some passenger aircraft but available on your device.

So imagine the scenario, you open your laptop while on a cruise etc.  and your laptop auto discovers the location service and you can use this to display a realtime map, or use the location of the vessel you are on for GeoTagging photos etc...   GPSD is a well established LINUX project doing just this.    I found out some information here -

http://gpsd.berlios.de/

It operates on TCP and UDP port 2947.   Adding auto-discovery seems like a great logical extension to this, I'm sure that's been thought about too, but I haven't got to that bit of the documentation.

I guess the trick would be to make this all extremely easy for the end user to use.

Time for a Windows port, and a small ship to install it on... :-)

Monday, December 22, 2008 11:32:13 AM UTC  #    Comments [0]  | 
Tuesday, December 16, 2008

On iPhone.   The world is indeed a strange place.

Download from Apple Appstore here

Tuesday, December 16, 2008 1:13:06 PM UTC  #    Comments [0]  | 

This is nice.   Ever wanted to have a digital picture frame, picking up news, travel, weather oh and the odd photo.

Have a look at

http://frameit.live.com/

 

Mike Hall has also been building some nice applications in managed and non managed code to consume the feeds -

http://blogs.msdn.com/mikehall/archive/2008/10/09/which-api-should-i-use-using-the-net-compact-framework.aspx

 

Time for a nice mobile photo viewer I think...

Tuesday, December 16, 2008 12:36:22 PM UTC  #    Comments [0]  | 
Friday, December 05, 2008

(Blondie - Picture This)

This post has nothing todo with the title, but just thought it was funny...

Last week,   I began writing an AJAX calendar control within Visual Studio.   This is how far I got:

image

However,   I had an interesting problem.    I resumed my laptop from Hibernate (I was not in a hot bag situation that day).    I was staying in a hotel using a standard WIFI connection provided by the hotel.    Clicking a button on my calendar control caused  an AJAX event to pull back data.   However because I was in this hotel, I was pulling back the logon (and pay) to the hotels WIFI web-page rather than my XML data.     I think its time to bullet proof my AJAX code to redirect to a full page if  something untoward like this happens.

More on this story as it breaks :-)

Friday, December 05, 2008 11:04:51 PM UTC  #    Comments [0]  | 
Monday, December 01, 2008

 

This looks pretty cool.   

 

 

I wonder if they are using devices with GPS's?  

Monday, December 01, 2008 8:32:37 PM UTC  #    Comments [0]  | 

So, got the Motorola MC75 working with its inbuilt camera.   However during a demo the other day I inadvertently clicked my camera capture button on a device that doesn't have an inbuilt camera (doh).

Of course my application then blew up.

So here's the code that performs a camera capture but also detects (well catches) if the device doesn't have one...

 

try

            {

CameraCaptureDialog ccd = new CameraCaptureDialog();

                ccd.InitialDirectory = @"\";

                ccd.DefaultFileName = "test.jpg";

                ccd.Mode = CameraCaptureMode.Still;

                ccd.Resolution = new Size(640, 480);

DialogResult dr1 = ccd.ShowDialog();

if (dr1 == DialogResult.OK)

                {

                    Bitmap _Photo = new Bitmap(ccd.FileName);

// put your code in here todo something with the image

                }

                ccd.Dispose();

            }

catch

            {

MessageBox.Show("No Camera Attached", "No Camera", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);

            }

Monday, December 01, 2008 4:46:29 PM UTC  #    Comments [2]  | 

Ever had the issue, when you think you're laptop is powering down.  Place laptop in bag only to find a while later  laptop didn't power down and has done a nice job in warming up your bag?

This phenomenon has been happening more and more to me, as the graphics drivers are causing a crash when my machines attempts to hibernate.

I just thought we'd better give this syndrome a name.    I've called it 'Hot Bag Syndrome'

Monday, December 01, 2008 9:47:53 AM UTC  #    Comments [2]  | 

Theme design by Jelle Druyts

Pick a theme: