Failed to activate positioning service in Legato app

Hi, I’m writing a program to get GPS coordinate on WP7702. However, the program failed to activate Positiong Service:

Jun 14 17:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1215]/posDaemon T=main | le_gnss.c le_gnss_SetAcquisitionRate() 4195 | Bad state for that request [2]

Jun 14 17:52:45 swi-mdm9x28-wp user.warn Legato: -WRN- | posDaemon[1215]/posDaemon T=main | le_pos.c le_posCtrl_Request() 1322 | Failed to set GNSS’s acquisition rate (1000)

Jun 14 17:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1215]/posDaemon T=main | le_gnss.c le_gnss_Start() 3643 | Bad state for that request [2]

Jun 15 00:52:45 swi-mdm9x28-wp user.err Legato: =ERR= | sms[1280]/smsComponent T=main | smsReceiver.c GetCurrentLocation() 62 | Can’t activate Positiong Service

Jun 15 00:52:45 swi-mdm9x28-wp user.info Legato: INFO | sms[1280]/smsComponent T=main | smsReceiver.c GpsTimer() 132 | Couldn’t get GPS location. Publishing default location: 4928790, -123120900

I tried with

gnss get loc2d

which actually worked as follows:

root@swi-mdm9x28-wp:~# gnss get loc2d
Latitude(positive->north) : 48.467516
Longitude(positive->east) : -123.345192
hAccuracy : 10.00m

here is my code:

int32_t latitude;

int32_t longitude;

int32_t horizontalAccuracy;

int len; 

memset(content, 0,400);


const le_result_t result = GetCurrentLocation(

    &latitude, &longitude, &horizontalAccuracy, GPSTIMEOUT *60);

if (result == LE_OK)

{

    LE_INFO("Loc:%f,%f", (float)latitude/1000000.0, (float)longitude/1000000.0);

    sprintf((char*)content, "loc: %f, %f", (float)latitude/1000000.0, (float)longitude/1000000.0);

    printf("%d %s\n", strlen((const char*)content), content);

}

else

{

    latitude = DefaultLatitude;

    longitude = DefaultLongitude;

    LE_INFO(

        "Couldn't get GPS location.  Publishing default location: %d, %d",

        latitude,

        longitude);

}

Can anyone help?
(NOTE: the app actually worked once upon a time, but it just started failing for the time being for some reason)

gnss watch returns as follows:

TTFF not calculated (Position not fixed)
Position state: No Fix
Location invalid [50000002, -97000002, 2147483647]
Altitude invalid [31000, 2147483647]
AltitudeOnWgs84 : 0.000m
GPS time invalid [0, 0]
Time invalid 00:00:00.000
Time invalid 0 ms
GPS time accuracy invalid [65535]
Date invalid 0000-00-00
Position dilution of precision (PDOP) invalid 65535
Horizontal dilution of precision (HDOP) invalid 65535
Vertical dilution of precision (VDOP) invalid 65535
Geometric dilution of precision (GDOP) invalid 65535
Time dilution of precision (TDOP) invalid 65535
hSpeed invalid [4294967295, 4294967295]
vSpeed invalid [2147483647, 2147483647]

does gnss command work?
Have you tried the AT!GPSFIX first to make sure the GPS is working?

at!gpsfix returns error

root@swi-mdm9x28-wp:~# microcom /dev/ttyAT
at!gpsfix
ERROR

at!gpsfix=?
!GPSFIX: ,,
: 1-Standalone, 2-MS-Based, 3-MS-Assisted
: 1-255 seconds
: 1-4294967280 meters

OK

I think you cannot just type AT!GPSFIX, you need to add paramter

what parameter do I need to add to check if the GPS is working>

you can see here

I think its working, isnt it?

root@swi-mdm9x28-wp:~# microcom /dev/ttyAT
at!gpsend=0
OK
at!gpsfix=1,60,60
OK
ati3
Manufacturer: Sierra Wireless, Incorporated
Model: WP7702
Revision: SWI9X06Y_02.35.02.00 5208b3 jenkins 2020/06/10 00:30:12
IMEI: 352653090137381
IMEI SV:  5
FSN: VU838385211510
+GCAP: +CGSM,+DS

OK

then you can try those gnss command

this was what I got:

root@swi-mdm9x28-wp:~# gnss get posInfo

TTFF not calculated (Position not fixed)

Position state: No Fix

Location invalid [50000002, -97000002, 2147483647]

Altitude invalid [31000, 2147483647]

AltitudeOnWgs84 : 0.000m

GPS time invalid [0, 0]

Time invalid 00:00:00.000

Time invalid 0 ms

GPS time accuracy invalid [65535]

Date invalid 0000-00-00

Position dilution of precision (PDOP) invalid 65535

Horizontal dilution of precision (HDOP) invalid 65535

Vertical dilution of precision (VDOP) invalid 65535

Geometric dilution of precision (GDOP) invalid 65535

Time dilution of precision (TDOP) invalid 65535

hSpeed invalid [4294967295, 4294967295]

vSpeed invalid [2147483647, 2147483647]

Direction invalid [4294967295, 4294967295]

root@swi-mdm9x28-wp:~# gnss get loc2d

Location invalid [50000002, -97000002, 2147483647]

root@swi-mdm9x28-wp:~# gnss get loc2d
Latitude(positive->north) : 48.467400
Longitude(positive->east) : -123.345304
hAccuracy                 : 9.00m

then can you get the position fix by AT command? (AT!GPSLOC?)

at!gpsloc?

Not Available

OK

can the module see any satellite ?(AT!GPSSATINFO?)

it returns NO SAT INFO

at!gpssatinfo?

NO SAT INFO

OK

but gnss get loc2d could return my current location…

root@swi-mdm9x28-wp:~# gnss get loc2d
Latitude(positive->north) : 48.467472
Longitude(positive->east) : -123.345296
hAccuracy                 : 9.00m

OK, then you can use it

but the app printing “Can’t activate Positiong Service”

Jun 14 22:49:53 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1220]/posDaemon T=main | le_gnss.c le_gnss_SetAcquisitionRate() 4195 | Bad state for that request [2]

Jun 14 22:49:53 swi-mdm9x28-wp user.warn Legato: -WRN- | posDaemon[1220]/posDaemon T=main | le_pos.c le_posCtrl_Request() 1322 | Failed to set GNSS's acquisition rate (1000)

Jun 14 22:49:53 swi-mdm9x28-wp user.err Legato: =ERR= | posDaemon[1220]/posDaemon T=main | le_gnss.c le_gnss_Start() 3643 | Bad state for that request [2]

Jun 15 05:49:53 swi-mdm9x28-wp user.err Legato: =ERR= | sms[1289]/smsComponent T=main | smsReceiver.c GetCurrentLocation() 62 | Can't activate Positiong Service

Jun 15 05:49:53 swi-mdm9x28-wp user.info Legato: INFO | sms[1289]/smsComponent T=main | smsReceiver.c GpsTimer() 133 | Couldn't get GPS location. Publishing default location: 4928790, -123120900

then you need to figure out why the GNSS tool is working fine but not for your app:

I suspect the issue is caused by the deficiency of the GPS antenna. Where can I buy this antenna?
image

We use Taoglas antennas. Take a look here:

regards