# le\_pos\_Get2DLocation returns LE\_OUT\_OF\_RANGE

**URL:** https://mangoh.discourse.group/t/le-pos-get2dlocation-returns-le-out-of-range/929
**Category:** mangOH Red
**Created:** [November 24, 2017, 12:10pm UTC](https://mangoh.discourse.group/t/le-pos-get2dlocation-returns-le-out-of-range/929 "2017-11-24T12:10:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![larskarlsen](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/larskarlsen/32/307_2.png) [@larskarlsen](https://mangoh.discourse.group/u/larskarlsen)
#### Post date: [November 24, 2017, 12:10pm UTC](https://mangoh.discourse.group/t/le-pos-get2dlocation-returns-le-out-of-range/929/1 "2017-11-24T12:10:52Z")

</div>

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 0 satellites.  
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);

```

`

---

<div class="post-metadata">

### Author: ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)
#### Post date: [November 25, 2017, 11:54pm UTC](https://mangoh.discourse.group/t/le-pos-get2dlocation-returns-le-out-of-range/929/2 "2017-11-25T23:54:47Z")

</div>



---

<div class="post-metadata">

### Author: ![asyal](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/asyal/32/78_2.png) [@asyal](https://mangoh.discourse.group/u/asyal)
#### Post date: [November 25, 2017, 11:54pm UTC](https://mangoh.discourse.group/t/le-pos-get2dlocation-returns-le-out-of-range/929/3 "2017-11-25T23:54:49Z")

</div>

item closed as it is repeated.
