×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    GPS not started or fix impossible with QtMobility

    Hi all!
    i am working with QtMobility 1.1.3, Qt 4.7.3. Target is Symbian (both 3 and S60v5).

    This is my code:
    Code:
    void GpsManager::startGps()
    {
            // Create the GPS object...
            gps_location_source = QGeoPositionInfoSource::createDefaultSource(this);
            // If created properly...
            if ( gps_location_source != NULL )
            {
                // Create the GPS satellite info source:
                gps_satellites_source = QGeoSatelliteInfoSource::createDefaultSource( this );
                // If there a default source?
                if ( gps_satellites_source != NULL )
                {
                    // Connect signals...
                    connect( gps_satellites_source, SIGNAL(satellitesInUseUpdated(QList<QGeoSatelliteInfo>)),
                             this, SLOT(satelliteUpdateUse(QList<QGeoSatelliteInfo>)) );
                    connect( gps_satellites_source, SIGNAL(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)),
                             this, SLOT(satelliteUpdateAll(QList<QGeoSatelliteInfo>)) );
    
                    connect( gps_satellites_source, SIGNAL(satellitesInUseUpdated(QList<QGeoSatelliteInfo>)),
                             satellite_map, SLOT(satelliteUpdateUse(QList<QGeoSatelliteInfo>)));
                    connect( gps_satellites_source, SIGNAL(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)),
                             satellite_map, SLOT(satelliteUpdateView(QList<QGeoSatelliteInfo>)));
                    // Setup call for calculating DOP values
                    gps_satellites_source->startUpdates();
                }
                // Lets get limited to satellites...
                if ( configuration->useSatellitesOnly() )
                    gps_location_source->setPreferredPositioningMethods( QGeoPositionInfoSource::SatellitePositioningMethods );
                else
                    gps_location_source->setPreferredPositioningMethods( QGeoPositionInfoSource::AllPositioningMethods );
                // we want an update as soon as it is available (we will filter ourselves)
                gps_location_source->setUpdateInterval( qMax( gps_location_source->minimumUpdateInterval(), 10000) );
                // Receive updates...
                connect(gps_location_source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                              this, SLOT(gpsUpdateMe(QGeoPositionInfo)) );
                // React to GPS timeouts
                connect(gps_location_source, SIGNAL(updateTimeout()),
                              this, SLOT(gpsTimeout()));
                // Immediately start updating the GPS (try to fix position)
                gps_location_source->startUpdates();
            }
    }
    This code works but with two quite major issues:

    Symbian^3
    As reported by main users (i do not have a Symbian^3 device to test myself) the GPS is never turned on unless the user opens OVI Maps or some other phone app which uses GPS. After that, the GPS starts, the fix is acquired and it works.

    S60v5
    This i can report first hand on my test devices... the GPS device is started, i can see the GPS icon in the notification area, but the FIX is never acquired. I can leave it on for hours, and no fix. As soon as i open OVI Maps or any other phone app which use GPS, the fix is almost imeediate, and my app can then start receiving position updates.

    Am i doing something wrong here?

    thanks for any help.

  2. #2
    Registered User
    Join Date
    Jan 2012
    Posts
    4

    Re: GPS not started or fix impossible with QtMobility

    I have had similar experience with S60v5.

    The solution for satellite info, which worked for me, is to continue to request updates. If a timeout is signal, then you request a new update. When you get your update signal, then you connect your slots and start updating.

    The problem seems to have something to do with a internal timeout when connecting slots to signals. If the signals aren't emitted reasonably quickly, you will never get them.

    So, in short:

    Start receiving gps position. When you see them arrive, request for satellite info.
    When satellite info arrive, connect your signals and slots and invoke startUpdates()

    If a similar scheme would work on Symbian^3 regarding gps position, I don't know.

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: GPS not started or fix impossible with QtMobility

    Hi,

    Have you tried to use gps_satellites_source->startUpdates(); after calling setPreferredPositioningMethods(...)

    if ( configuration->useSatellitesOnly() )
    {
    gps_location_source->setPreferredPositioningMethods( QGeoPositionInfoSource::SatellitePositioningMethods );
    gps_satellites_source->startUpdates();
    }

  4. #4
    Registered User
    Join Date
    Jan 2012
    Posts
    4

    Re: GPS not started or fix impossible with QtMobility

    I assume that your suggestion is directed towards gardiol, but could you share your thoughts behind your suggestion?

    Are you suggesting to use QGeoPositionInfoSource::SatellitePositioningMethods to ensure, that the gps is turned on? Or does it have an impact on the problem of getting satellite info?

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: GPS not started or fix impossible with QtMobility

    Quote Originally Posted by axjensen View Post
    I assume that your suggestion is directed towards gardiol, but could you share your thoughts behind your suggestion?

    Are you suggesting to use QGeoPositionInfoSource::SatellitePositioningMethods to ensure, that the gps is turned on? Or does it have an impact on the problem of getting satellite info?
    I guess in startUpdates(), it collect the location information based on your preffered method (that is set by setPreferredPositioningMethods() ). So if you want to get position based on your desired method you need to use startUpdates() later than earlier. If we use SatellitePositioningMethods that will use the GPS for getting position.

Similar Threads

  1. Error with QtMobility 1.0 after succesfully intall QtMobility tp2
    By Estel in forum [Archived] Qt Mobility Project
    Replies: 0
    Last Post: 2010-06-21, 21:21
  2. Is it impossible?
    By K.John in forum Open C/C++
    Replies: 1
    Last Post: 2009-08-11, 07:23
  3. The impossible bug?!?
    By cassioli in forum Symbian
    Replies: 2
    Last Post: 2008-08-10, 22:05
  4. Impossible to set GMT -2
    By marciano in forum General Development Questions
    Replies: 1
    Last Post: 2006-11-27, 01:28
  5. Streaming impossible
    By nokiaboskov in forum Streaming and Video
    Replies: 6
    Last Post: 2006-04-27, 05:18

Posting Permissions

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