Friday, May 29, 2009

ideacampdavao!












ideacampdavao is set for tomorrow, 1:30pm @Kublai's Cafe (Ponce Suites) so see you there guys and hope to share ideas with the rest of you! :)

Friday, May 22, 2009

riding.the.city

I was tinkering with the GPStogo unit (loaned to Marloue by OSM) the other day and made a simple Delphi app to fetch GPS data from the device and plot the location to an OSM map of Davao. The idea is to create a DIY real-time GPS tracking system suitable for mapping (and for the upcoming mapping party), using only stuff in the office. However, I have not figured out a way to effectively render downloaded OSM tiles in my app (no offline-support yet) and my application is currently making use of Cloudmade's powerful API to request and render the tiles for me online. So unless I use WeRoam or Visibility it won't be as useful for mobile mapping (using the telco's 3G service for mobile mapping isn't as practical either). The next day I decided to install tangoGPS on my notebook and saw that it practically has what I wanted in the first place (plus its free and supports offline maps). Since Marloue and I are scheduled to meet a client after lunch, we figured that it would be the best time to try out this DIY setup and start logging POIs (Point of Interest) as we travel along the road.

Here's what you need:
1. GPS device...we used the GT-31 but any GPS device that outputs NMEA sentences will do
2. A notebook with Ubuntu 9.04 (or any distro you want) installed
3. tangoGPS

You can install tangoGPS via synaptic:

sudo aptitude install tangogps

Ensure that gpsd and gpsd-clients is installed as well:

sudo aptitude install gpsd gpsd-clients

Gpsd is a service daemon that monitors one or more GPS devices attached to a host computer through serial or USB ports. It then serves this information via port 2947 and allow multiple client application to access the to GPS devices without contention or data loss. You can actually use one GPS device for navigation, wardriving, mapping or whatnot all at the same time!

tangoGPS does not interface directly with a GPS device, however it accesses GPS data by listening to a gpsd service. So before you can actually use Tango you'll have to make sure gpsd is running. You also have to check what particular USB port the GT-31 or any (GPS device for that matter) is connected.

dmesg | grep ttyUSB

Normally it should give you /dev/ttyUSB0 but it could be any other number depending on which port is available. Next, run the gpsd service:

gpsd -N -n -D 2 /dev/ttyUSB0

Once the service is running, fire-up tangoGPS and proceed to configuration. The default setup should work (IP: 127.0.0.1 port 2947) as it uses a loopback address, change the IP if you're accessing the service from another machine. Thats about it, once the GPS gets a satellite fix tangoGPS will draw a marker that shows your current position and bearing. Righ-clicking on the map allows you to add POIs, which was exactly what Marloue was doing during the trip. I managed to discover a better driving route while doing this experiment and I hope something similar happens to you as well, have fun riding the city!