# How can I start session mdc?

**URL:** <https://forum.legato.io/t/how-can-i-start-session-mdc/5616>\
**Category:** Legato Application Framework\
**Created:** [February 17, 2021, 5:56pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616 "2021-02-17T17:56:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anderson](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anderson](https://forum.legato.io/u/anderson)\
**Post date:** [February 17, 2021, 5:56pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/1 "2021-02-17T17:56:43Z")

</div>

I want to start the data connection by my legato app.  
On documentation, I found the function: **le\_mdc\_StartSession**

```
#define NB_PROFILE 1
static le_mdc_ProfileRef_t ProfileRef[NB_PROFILE];
COMPONENT_INIT
{
	LE_INFO("begin app");
	le_mdc_StartSession(ProfileRef[0]);

```

But when I build the app, the following error occurs:

```
    /home/victor/ftsmartmind/modem-fx30s/conversor-mqtt/vscode/fx30s/components/fx30sSerialMqttComponent/fx30sSerialMqttComponent.c:23:8: error: unknown type name ‘le_mdc_ProfileRef_t’
     static le_mdc_ProfileRef_t ProfileRef[NB_PROFILE];
            ^ ~~~~~~~~~~~~~~~~~~
    /home/victor/ftsmartmind/modem-fx30s/conversor-mqtt/vscode/fx30s/components/fx30sSerialMqttComponent/fx30sSerialMqttComponent.c: In function ‘_fx30sSerialMqttComponent_COMPONENT_INIT’:
    /home/victor/ftsmartmind/modem-fx30s/conversor-mqtt/vscode/fx30s/components/fx30sSerialMqttComponent/fx30sSerialMqttComponent.c:29:2: error: implicit declaration of function ‘le_mdc_StartSession’; did you mean ‘le_msg_GetSession’? [-Werror=implicit-function-declaration]
      le_mdc_StartSession(ProfileRef[0]);

```

Is it necessary to include some lib on the project to use this function? I found some examples but nothing works.

---

<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:** [February 18, 2021, 1:58am UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/2 "2021-02-18T01:58:33Z")

</div>

I don’t see problem, you can use my application and put your code in demo.c  
[modemDemo1.rar](https://forum.legato.io/uploads/short-url/5nHOeZMn9USN3VAyaE0j0HwME7a.rar) (2.0 MB)

I compiled in VSCode with swi-fx30-catm\_2.0.0 package:

1. leaf shell
2. cd apps/Demo/modemDemo1
3. make

---

<div class="post-metadata">

**Author:** ![anderson](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anderson](https://forum.legato.io/u/anderson)\
**Post date:** [February 22, 2021, 3:04pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/3 "2021-02-22T15:04:56Z")

</div>

Running your example, I see that the le\_mdc\_StartSession function is successfully executed

```
root@fx30s:~# cm data
Index: 1
APN: allcom.swir
PDP Type: IPV4V6
Connected: yes
Auth type: PAP
User name: allcom
Password: allcom
Interface: rmnet_data0
Family[IPv4]: inet
IP[IPv4]: 10.110.47.74
Gateway[IPv4]: 10.110.47.73
Dns1[IPv4]: 8.8.8.8
Dns2[IPv4]: 4.2.2.2

```

It looks like it starts the network interface but I don’t have internet connectivity

```
root@fx30s:~# ping google.com
ping: bad address 'google.com'
root@fx30s:~# 

```

I can only connect to the internet when I execute the command in the terminal:

```
root@fx30s:~# cm data connect
Checking if device 'rmnet_data0' is up ... ok
Routing inet ... ok
Updating /etc/resolv.conf ... ok
Updating /etc/resolv.conf ... ok

root@fx30s:~# ping google.com
PING google.com (172.217.1.46): 56 data bytes
64 bytes from 172.217.1.46: seq=0 ttl=116 time=1258.533 ms

```

How do I start an internet connection through my legato application?

---

<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:** [February 22, 2021, 11:12pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/4 "2021-02-22T23:12:04Z")

</div>

Is it ok to ping 8.8.8.8?

Btw, you can call “cm data connect” within unsandboxed legato app with systen() api.

Fyi, it should work fine:

> [@Command line connection works, but le\_data does not in application](https://forum.legato.io/t/command-line-connection-works-but-le-data-does-not-in-application/5256/13):
>
> I don’t see problem with my module here: root@swi-mdm9x28-wp:~# app runProc modemDemo1 send --exe=send – 1234567 “Sim” root@swi-mdm9x28-wp:~# root@swi-mdm9x28-wp:~# cat /legato/systems/current/appsWriteable/modemDemo1/smsC hat.txt SIM 1 is inserted and unlocked. ICCID=8985200012741552068 IMSI=454003074155206 root@swi-mdm9x28-wp:~# root@swi-mdm9x28-wp:~# app runProc modemDemo1 send --exe=send – 1234567 "Online " root@swi-mdm9x28-wp:~# root@swi-mdm9x28-wp:~# cat /legato/systems/current/a…

---

<div class="post-metadata">

**Author:** ![anderson](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anderson](https://forum.legato.io/u/anderson)\
**Post date:** [February 23, 2021, 11:40am UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/5 "2021-02-23T11:40:24Z")

</div>

Using le\_mdc\_StartSession I get the following ping return

```
root@fx30s:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network is unreachable

```

I changed one implementation per system (“cm data connect”); disabling the sandbox, but the cm command was not recognized:

`Feb 23 08:35:05 fx30s user.err Legato: =ERR= | mqttPublisher[2788] | cm: not found`

But it worked out using the full path to the cm.

` system("/legato/systems/current/bin/cm data connect");`

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 9:22am UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/6 "2023-09-11T09:22:57Z")

</div>

hi i need help with mangOH yellow board  
iam totally new to this board and i need some instruction if anyone can help me please send any contact media  
thank you

---

<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 11, 2023, 11:18am UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/7 "2023-09-11T11:18:56Z")

</div>

You can see here

[https://mangoh.io/mangoh-yellow-resources-getting-started](https://mangoh.io/mangoh-yellow-resources-getting-started)

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 11:39am UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/8 "2023-09-11T11:39:11Z")

</div>

i can’t login into [mangoh.io](http://mangoh.io) website it is showing some error  
but i need to work in linux with this board and i have set legato platform but i can’t connect board to  
internet

---

<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 11, 2023, 12:37pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/9 "2023-09-11T12:37:43Z")

</div>

i don’t see problem to download the document:

[mangOH\_Yellow\_GSG.pdf](https://forum.legato.io/uploads/short-url/kloFBggUPoLrX7Z0yfq3og4PqzJ.pdf) (5.8 MB)

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 1:40pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/10 "2023-09-11T13:40:55Z")

</div>

sir, iam not able to ping the board,i am getting unreachable,and i am not able to connect to internet  
they have not shown in document how to connect to internet,

---

<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 11, 2023, 1:49pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/11 "2023-09-11T13:49:01Z")

</div>

did you try with linux?

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 1:50pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/12 "2023-09-11T13:50:09Z")

</div>

yes sir, i have also inserted sim , and tried connect wifi also

---

<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 11, 2023, 1:54pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/13 "2023-09-11T13:54:19Z")

</div>

then have you set the IP address of the usb interface on linux PC side?

e.g.  
sudo ifconfig usb0 192.168.2.3

after that you can try to ping 192.168.2.2 which is the IP address of module’s ECM interface

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 1:56pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/14 "2023-09-11T13:56:08Z")

</div>

ok sir, i will try ,but my module is wp7608 it is not a problem wright

---

<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 11, 2023, 1:56pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/15 "2023-09-11T13:56:59Z")

</div>

WP7608 should be OK for the ping test of USB ECM interface

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 1:58pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/16 "2023-09-11T13:58:17Z")

</div>

nayan@nayan:~$ sudo ifconfig USB1 192.168.2.3  
SIOCSIFADDR: No such device  
USB1: ERROR while getting interface flags: No such device

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 1:59pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/17 "2023-09-11T13:59:16Z")

</div>

I am getting like this

---

<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 11, 2023, 1:59pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/18 "2023-09-11T13:59:56Z")

</div>

did you check “ifconfig -a” to see what interface do you have?

you can also check in dmesg

---

<div class="post-metadata">

**Author:** ![nayannick2000](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@nayannick2000](https://forum.legato.io/u/nayannick2000)\
**Post date:** [September 11, 2023, 2:05pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/19 "2023-09-11T14:05:53Z")

</div>

i tried for all interface it is showing same

---

<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 11, 2023, 2:07pm UTC](https://forum.legato.io/t/how-can-i-start-session-mdc/5616/20 "2023-09-11T14:07:00Z")

</div>

what network interface is created?

[Next page](https://forum.legato.io/t/how-can-i-start-session-mdc/5616.md?page=2)
