# le\_mdc\_startSession() Get Connection failure

**URL:** <https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417>\
**Category:** Legato Application Framework\
**Created:** [September 24, 2020, 12:09am UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417 "2020-09-24T00:09:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [September 24, 2020, 12:09am UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/1 "2020-09-24T00:09:51Z")

</div>

Hi,  
I’m having an issue with ATT (WP7603 R10) device where it’s good the first time I call le\_mdc\_startSession() and it connects just fine. But if/when I lose connection, I try to reconnect and it does, but then immediately (or very quickly) disconnects. In the logs I see disconnect reason 2D, which is CALL\_END\_CAUSE\_USER\_CALL\_ORIG\_DURING\_GPS. I currently am not using GPS. Additionally, all subsequent calls fail with the same error. Is there a way to shut off GPS, or is that the real problem? I don’t see this problem with the WP7601. In this version, I can only use le\_mdc\_GetPlatformSpecificDisconnectionCode(), the Ext versions apparently are not available in R10 and R12…

Evets

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 24, 2020, 1:31am UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/2 "2020-09-24T01:31:12Z")

</div>

you can try if cm tool has the same problem:  
connect: cm data connect &  
disconnect: cm data connect -1

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [September 24, 2020, 4:27am UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/3 "2020-09-24T04:27:54Z")

</div>

Oh, forgot to mention that. It does not have the same problem. Is there something that needs to be done that clears something?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 24, 2020, 5:47am UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/4 "2020-09-24T05:47:37Z")

</div>

The api used is not the same.  
You can see the code of cm tool here:

> **[legato-af/apps/tools/cm at master · legatoproject/legato-af](https://github.com/legatoproject/legato-af/tree/master/apps/tools/cm)**
>
> master/apps/tools/cm

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [September 24, 2020, 2:35pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/5 "2020-09-24T14:35:02Z")

</div>

I remember looking at this a long time ago. I don’t think this is R10 code though.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 24, 2020, 2:45pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/6 "2020-09-24T14:45:56Z")

</div>

This is the latest code, you can download the r10 code in here:  
[https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-10,-d-,1-components/#sthash.d8ZLsKhu.dpbs](https://source.sierrawireless.com/resources/airprime/software/wp76xx/wp76xx-firmware-release-10,-d-,1-components/#sthash.d8ZLsKhu.dpbs)

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [September 24, 2020, 3:22pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/7 "2020-09-24T15:22:27Z")

</div>

So, looking at the code for R10, it’s using the same le\_mdc\_startSession() call that I am.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 24, 2020, 4:01pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/8 "2020-09-24T16:01:57Z")

</div>

If you don’t see problem in cm tool, probably the problem is come from your code.

Btw, you can also try the modemdemo sample applicaton which using le\_data API and see if you still see the issue.

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [September 29, 2020, 3:25pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/9 "2020-09-29T15:25:54Z")

</div>

cm call is actually a large script that is being run before, then calls the binary cm (which only calls the le\_mdc\_startSession()) and then adds routing and other things after the modem call.

Just to be clear, this ONLY happens with AT&T. It works fine with Verizon (WP7601) and T-Mobile (WP7603).

The cm case isn’t the same since the binary is called via a script. If I restart my app, it works fine as well, so it’s not apples to apples comparison. Just the act of calling the le\_mdc\_startSession() a second time within the same application, does this. If I start the session outside the app using the cm, it works fine when I call it a second time while my app is running, since it comes back as already started. I’m simulating a failure by turning off the radio using the cm app, but it works the same way if it’s lost connection from no signal.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 29, 2020, 3:41pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/10 "2020-09-29T15:41:08Z")

</div>

you can also try the modemdemo sample applicaton which using le\_data API and see if you still see the issue

---

<div class="post-metadata">

**Author:** ![EvetsMostel](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@EvetsMostel](https://forum.legato.io/u/EvetsMostel)\
**Post date:** [October 2, 2020, 5:05pm UTC](https://forum.legato.io/t/le-mdc-startsession-get-connection-failure/5417/11 "2020-10-02T17:05:21Z")

</div>

OK, I discovered what the problem was. If you re-set the APN, it will disconnect, even if it’s the correct APN. As I said, it connects and then disconnects as soon as it leaves the state change handler for the connection and only after the first initial connection which works fine. Don’t re-set the APN, and it doesn’t do this. Again, this is only on ATT.
