×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    2

    Reading in bluetooth GPS data

    I'm new to Java programming but I'm giving it a go!

    My hobby geochaching and I'd like to write a program to read in GPS data from my bluetooth GPS unit and compare that with manually entered co-ordinates and give distance and heading information back.

    I appreciate that there are 'apps' out there already for the Nokia, but I want to use this as the basis for my first program.

    I've seen an article of Java code on this site to read in the data from the GPS unit, but my question is how often does the phone get the data from the GPS, i.e. refresh rate? Is it once a second or 100 times per second??

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Reading in bluetooth GPS data

    Well I guess that is configurable, as in you have control on when the data (NMEA String) should be read from the GPS device...
    Personally the speed will also be limited by the used GPS chip within the GPS receiver... I don't have any specs, but certainly the position doesn't get updated hunreds of times per second... I guess that with geocaching once every second should be more than enough, even less than that...
    Also another limiting factor would be the communication speed over Bluetooth and also the speed of your device in actually reading the data and afterwards interpreting/cutting up NMEA Strings...
    So there are several factors which might (or might not) have an impact on the frequency...

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    2

    Re: Reading in bluetooth GPS data

    Many thanks for the help Tiger79.

    My phone is a 5800 XM, so the goal would be to make the data processing as efficient as possible, but yes a position refresh of one per second would be adequate.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Reading in bluetooth GPS data

    aha,
    if you are only interested in targetting your own device (S60 with integrated GPS) then you might just use the JSR-179 api (also called Location API)...
    There is loads to find on it on the net (just google it) and also this wiki article might help :
    http://wiki.forum.nokia.com/index.ph...aining_GPS_fix

  5. #5
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Sri Lanka, Colombo
    Posts
    204

    Smile Re: Reading in bluetooth GPS data

    hi ajones12,

    i have done a application similar to this. most of the time the data is coming trough GPS device. but some times those are not accurate data.

    and GPS data depends on the no of satellites it can see. if the no of satellites are high you'll get the accurate data.

    refer this section

    $GPRMC

    Recommended minimum specific GPS/Transit data

    eg1. $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62
    eg2. $GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68


    225446 Time of fix 22:54:46 UTC
    A Navigation receiver warning A = OK, V = warning
    4916.45,N Latitude 49 deg. 16.45 min North
    12311.12,W Longitude 123 deg. 11.12 min West
    000.5 Speed over ground, Knots
    054.7 Course Made Good, True
    191194 Date of fix 19 November 1994
    020.3,E Magnetic variation 20.3 deg East
    *68 mandatory checksum


    eg3. $GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
    1 2 3 4 5 6 7 8 9 10 11 12


    1 220516 Time Stamp
    2 A validity - A-ok, V-invalid
    3 5133.82 current Latitude
    4 N North/South
    5 00042.24 current Longitude
    6 W East/West
    7 173.8 Speed in knots
    8 231.8 True course
    9 130694 Date Stamp
    10 004.2 Variation
    11 W East/West
    12 *70 checksum


    eg4. $GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a*hh
    1 = UTC of position fix
    2 = Data status (V=navigation receiver warning)
    3 = Latitude of fix
    4 = N or S
    5 = Longitude of fix
    6 = E or W
    7 = Speed over ground in knots
    8 = Track made good in degrees True
    9 = UT date
    10 = Magnetic variation degrees (Easterly var. subtracts from true course)
    11 = E or W
    12 = Checksum
    in order to find out the distance you can use this method


    private double calDistance(double lat1, double lon1, double lat2, double lon2) {
    // This Will Return Distance By Kms
    double theta, dist, distance;
    theta = lon1 - lon2;
    dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2)) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.cos(Math.toRadians(theta));
    dist = MobileMath.acos(dist);
    dist = Math.toDegrees(dist);
    distance = dist * 60 * 1.1515;
    distance = distance * 1.609344;
    return distance;
    }
    i have test this in nokia NFC 6131 phone and it works fine

    cheers,
    Randika

Similar Threads

  1. Nokia JSR179 - implementation for Bluetooth GPS'
    By gullet in forum Mobile Java General
    Replies: 0
    Last Post: 2008-10-24, 08:46
  2. Closing bluetooth socket AFTER all data has been sent
    By tumppi in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-07-09, 13:28
  3. GPS data over bluetooth
    By lucca99 in forum Bluetooth Technology
    Replies: 7
    Last Post: 2007-06-16, 05:12
  4. Reading Position from a Bluetooth GPS
    By t43562 in forum Symbian
    Replies: 0
    Last Post: 2005-11-26, 11:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×