le_pos_Get2DLocation return LE_OUT_OF_RANGE


#1

I’m trying to make a little testprogram that will write location in the log. When started it only returns result = -3, which is LE_OUT_OF_RANGE. A thing to notice is when running AT!GPSSATINFO? if that is the right syntax, it returns NO SAT INFO.
I’m using the mangOH Red starter kit with the WP8548. I’ve heard some problems with the antenna that follows, is this the case?

The code looks like this:

le_result_t result;
int32_t latitude;
int32_t longitude;
int32_t horizontalAccuracy;

le_posCtrl_ActivationRef_t posCtrlRef = le_posCtrl_Request();
if (!posCtrlRef)
{
    LE_ERROR("Can't activate the Positioning service");
    exit(1);
}

LE_INFO("CHECKING 2D POSITION");
while(true){
    result = le_pos_Get2DLocation(&latitude, &longitude, &horizontalAccuracy);
    if (result == LE_OK){
        LE_INFO("OK");
        break;
    }
    else{
        LE_INFO("Somthing went wrong... Result = %d", result);
        sleep(3);
    }
}
LE_INFO("Lat = %d \tLong = %d \t HorizontalAccuracy = %d",latitude, longitude, horizontalAccuracy);

`


#2

It seems like it returns LE_OUT_OF_RANGE because of the horizontalAccuracy not going through. When checking if horizontalAccuracy == INT32_MAX it was true… so i just removed it, and then it worked with result = le_pos_Get2DLocation(&latitude, &longitude, NULL);


#3

I would like to point out that i still get NO SAT INFO when typing AT!GPSSATINFO? Someone know why?


#4

What antenna have you connected to the GPS port?


#5

The one that follows in the starter kit.


#6

we dont provide a GPS antenna with the kit. Some of the forum users used the following antenna:
Adafruit: https://www.adafruit.com/product/2461

The GPS ufl is next to the main antenna ufl. Just to try, you can stick the Taoglass cellular antenna in the GPS uFl slot.


#7

A thing i wonder about then, is how I am able to get lat, long from le_pos_Get2DLocation without an antenna connected to the GNSS Antenna port? Would like to mention that the lat long coordinates is wrong tho :stuck_out_tongue:


#8

Is it integrated in the module?


#9

Check post by @spmaurer. Best is to attach a good active antenna. Note if you are testing in your lab it might still not work as best is to test in the open.