# Use external SIM to connect to custom server

**URL:** <https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482>\
**Category:** mangOH Yellow\
**Created:** [May 20, 2020, 7:20pm UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482 "2020-05-20T19:20:07Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 20, 2020, 7:20pm UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/1 "2020-05-20T19:20:07Z")

</div>

Hi all,

As the title says… I’m trying to use an external SIM to establish a TCP connection to my server to send/receive dummy data.

I have verified that the external SIM card is enabled and got able to send text messages via cm sms send

when I check if the radio is connected to the LTE network it seems fine to me

root@swi-mdm9x28-wp:~# cm radio  
Power: ON  
Current Network Operator: TELCEL  
Current RAT: LTE network (LE\_MRC\_RAT\_LTE)  
Status: Registered, home network (LE\_MRC\_REG\_HOME)  
Signal: Strong signal strength (4)  
PS: Packet Switched Registered, home network (LE\_MRC\_REG\_HOME)

I have set the APN authentication parameters and verified those with the network provider.  
What I am missing here is where is the starting point to write a simple application in which I can indicate to which server send/received data, I’m not using Octave or airvantage.

I have seen this guide:

> **[mangOH/mangOH](https://github.com/mangOH/mangOH/wiki/Building-the-Legato-%22system%22-(apps)-for-mangOH-Yellow)**
>
> Primary mangOH git repository. Contribute to mangOH/mangOH development by creating an account on GitHub.

  
In which you disable Octave at build time, but then where does this connects to then?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 21, 2020, 12:36am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/2 "2020-05-21T00:36:56Z")

</div>

You can try “cm data connect &”  
If it succeeds, you will be able to ping your server

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 21, 2020, 5:10pm UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/3 "2020-05-21T17:10:59Z")

</div>

Hi jyijyi

I tried that and it failed… I did check the log but I am not sure what is happening there, I see some errors but don’t know how to address them… log is below as reference. Any help is appreciated.

root@swi-mdm9x28-wp:~# cm data connect &  
root@swi-mdm9x28-wp:~# Setting up profile 2  
Connecting … failed  
Thu May 21 10:04:48 -07 2020 - Connection Failure: LE\_FAULT

[1]+ Done(1) cm data connect  
root@swi-mdm9x28-wp:~#

root@swi-mdm9x28-wp:~# logread -f  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c app\_Create() 3258 | Creating app ‘tools’  
May 21 10:04:47 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[925]/supervisor T=main | proc.c GetWatchdogAction() 362 | cm@0 watchdogAction ‘’ in proc section  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c app\_Start() 3471 | Starting app ‘tools’  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_uartMode.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCom  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_secstore.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCom  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_cm.so’ to '/legato/systems/current/appsWriteable/tools/lib/libComponent  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_moduleLoad.so’ to '/legato/systems/current/appsWriteable/tools/lib/libC  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_fwupdate.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCom  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_pmtool.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCompo  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_le\_pa\_uartMode\_default.so’ to '/legato/systems/current/appsWriteable/to  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_swiQmi.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCompo  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_le\_pa\_uartMode.so’ to '/legato/systems/current/appsWriteable/tools/lib/  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/lib/libComponent\_gnss.so’ to '/legato/systems/current/appsWriteable/tools/lib/libCompone  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/cm’ to ‘/legato/systems/current/appsWriteable/tools/bin/cm’: Already exists  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/gnss’ to ‘/legato/systems/current/appsWriteable/tools/bin/gnss’: Already exists  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/kmod’ to ‘/legato/systems/current/appsWriteable/tools/bin/kmod’: Already exists  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/fwupdate’ to ‘/legato/systems/current/appsWriteable/tools/bin/fwupdate’: Already exi  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/secstore’ to ‘/legato/systems/current/appsWriteable/tools/bin/secstore’: Already exi  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/uartMode’ to ‘/legato/systems/current/appsWriteable/tools/bin/uartMode’: Already exi  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/bin/pmtool’ to ‘/legato/systems/current/appsWriteable/tools/bin/pmtool’: Already exists  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c CreateFileLink() 2084 | Skipping file link ‘/legato/systems/current/apps/tools/read-only/scripts/cm’ to ‘/legato/systems/current/appsWriteable/tools/scripts/cm’: Already exists  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | proc.c proc\_Start() 1403 | Starting process ‘cm@0’ with pid 12205  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | supervisor.c SigChildHandler() 899 | Reaping unconfigured child process 12201.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | proc.c proc\_Start() 1363 | Execing ‘scripts/cm’  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxCoreDumpFileBytes to value 8192.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileBytes to value 90112.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxLockedMemoryBytes to value 8192.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxFileDescriptors to value 256.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxMQueueBytes to value 512.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxThreads to value 20.  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | supervisor[12205]/supervisor T=main | resourceLimits.c SetRLimitValue() 301 | Setting resource limit maxQueuedSignals to value 100.  
May 21 10:04:47 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[12208]/framework T=main | safeRef.c le\_ref\_CreateRef() 547 | Safe reference map maximum exceeded for refFdMonitors, new size 42  
May 21 10:04:47 swi-mdm9x28-wp user.warn Legato: -WRN- | cellNetService[1520]/framework T=main | safeRef.c le\_ref\_CreateRef() 547 | Safe reference map maximum exceeded for refFdMonitors, new size 42  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | modemDaemon[1576]/modemDaemon T=main | le\_mdc.c CloseSessionEventHandler() 961 | SessionRef 0x7f5fcd48 has been closed  
May 21 10:04:47 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/modemDaemon T=main | le\_sms.c CloseSessionEventHandler() 2203 | SessionRef (0x7f5fd138) has been closed  
May 21 10:04:47 swi-mdm9x28-wp user.warn Legato: -WRN- | _UNKNOWN_[12221]/framework T=main | safeRef.c le\_ref\_CreateRef() 547 | Safe reference map maximum exceeded for refFdMonitors, new size 42  
May 21 10:04:47 swi-mdm9x28-wp user.info Legato: INFO | cm[12221]/cm T=main | cm\_data.c cm\_data\_ProcessDataCommand() 1164 | dataParam is NULL  
May 21 10:04:48 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/swiQmi T=main | swiQmi.c swiQmi\_CheckResponse() 799 | Sending QMI\_WDS\_START\_NETWORK\_INTERFACE\_REQ\_V01 failed: rc=0 (), resp.result=1.[0x01], resp.error=14.[0x0e]  
May 21 10:04:48 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/le\_pa T=main | pa\_mdc\_qmi.c StartSession() 1978 | Data connection failure Call End provided 45, Code 1  
May 21 10:04:48 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/le\_pa T=main | pa\_mdc\_qmi.c StartSession() 1989 | Data connection failure Verbose Call End provided Type 6, Verbose 55  
May 21 10:04:48 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/modemDaemon T=main | le\_mdc.c le\_mdc\_StartSession() 1270 | Get Async Connection failure 45, 1, 6, 55  
May 21 10:04:48 swi-mdm9x28-wp user.info Legato: INFO | modemDaemon[1576]/modemDaemon T=main | le\_mdc.c CloseSessionEventHandler() 961 | SessionRef 0x7f5fd728 has been closed  
May 21 10:04:48 swi-mdm9x28-wp user.err Legato: =ERR= | modemDaemon[1576]/modemDaemon T=main | le\_sms.c CloseSessionEventHandler() 2203 | SessionRef (0x7f5fd4c8) has been closed  
May 21 10:04:48 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | proc.c proc\_SigChildHandler() 2079 | Process ‘cm@0’ (PID: 12205) has exited with exit code 1.  
May 21 10:04:48 swi-mdm9x28-wp user.warn Legato: -WRN- | supervisor[925]/supervisor T=main | app.c app\_SigChildHandler() 4066 | Process ‘cm@0’ in app ‘tools’ faulted: Ignored.  
May 21 10:04:48 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | app.c app\_StopComplete() 4753 | app ‘tools’ has stopped.  
May 21 10:04:48 swi-mdm9x28-wp user.info Legato: INFO | supervisor[925]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘tools’ has stopped.

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 21, 2020, 10:54pm UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/4 "2020-05-21T22:54:50Z")

</div>

Ok, so I changed the APN of my network provider to be in profile 1 (instead of being in profile 2) and tried to connect, which was successful…  
After that I though that it might be profile 1 that works and 2 just does not for any reason?  
So I tried setting a random typed APN in profile 1 and after connect, it just worked… so, my conclusions are that connection supports only one profile (the index 1) and that it does not matter what APN you have configured neither if security has been set…

I have check the sim card info and it says it is using the external sim

root@swi-mdm9x28-wp:~# cm sim info  
Type: EXTERNAL\_SLOT\_1  
ICCID: xxxxxxxxx  
Home Network Operator: TELCEL  
EID:  
IMSI: xxxxxxxxx  
Phone Number: +xxxxxx

I really do not understand what is happening here, can someone clarify this?  
I just need to know that that I am using the external sim card and that I can interface directly to my server without passing through octave/sierra.

Thanks!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 22, 2020, 12:12am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/5 "2020-05-22T00:12:29Z")

</div>

Why do you need to use profile 2?  
Did you set the apn for profile 2?

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 22, 2020, 2:42am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/6 "2020-05-22T02:42:01Z")

</div>

I don’t need the second profile… probably I ended setting it by mistake. Right now I am only using profile 1, which seems to connect as I have ping google and other pages.  
I have set the APN in profile 1 to be my networks provided and works, but if I set it to something else it still works, so what is the APN setting for?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 22, 2020, 3:39am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/7 "2020-05-22T03:39:03Z")

</div>

maybe your network provider did not have a restriction on other APN.

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 23, 2020, 1:11am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/8 "2020-05-23T01:11:34Z")

</div>

I have contacted my network provider and they have confirmed that I have been using the data from the SIM card they provided, so as you say, it seems the APN configuration does not matter…  
I am now struggling creating an app that can do the same as cm data connect, I have configured the modem as follows:

```
profileRef = le_mdc_GetProfile(1);
LE_ASSERT_OK(le_mdc_GetSessionState(profileRef,&connectionStatePtr));
printConnectionState(connectionStatePtr);
if(connectionStatePtr != LE_MDC_DISCONNECTED)
{
    LE_ASSERT_OK(le_mdc_StopSession(profileRef));
}

LE_ASSERT_OK(le_mdc_SetAPN(profileRef,TELCEL_APN));
LE_ASSERT_OK(le_mdc_SetPDP(profileRef,TELCEL_PDP));
LE_ASSERT_OK(le_mdc_SetAuthentication(profileRef,TELCEL_AUTH_PROTOCOL,TELCEL_AUTH_USER,TELCEL_AUTH_PASSWORD));

le_data_SetCellularProfileIndex(1);

le_data_AddConnectionStateHandler(&ConnectionStateHandler, NULL);

LE_INFO("Requesting connection...");

ConnectionRef = le_data_Request();

```

If I run this app, and check the connection status, it seems connected, but I cannot ping any server… I have to use command line to disconnect and then to connect again and then I can ping, as shown below… am I missing something ?

root@swi-mdm9x28-wp:~# cm data  
Index: 1  
APN: [internet.itelcel.com](http://internet.itelcel.com)  
PDP Type: IPV4V6  
Connected: yes  
Auth type: PAP  
User name: webgpr  
Password: webgprs2002  
Interface: rmnet\_data0  
Family[IPv4]: inet  
IP[IPv4]: 10.18.81.121  
Gateway[IPv4]: 10.18.81.122  
Dns1[IPv4]: 10.233.16.4  
Dns2[IPv4]: 10.182.35.36  
root@swi-mdm9x28-wp:~# ping [google.com](http://google.com)  
ping: bad address ‘[google.com](http://google.com)’  
root@swi-mdm9x28-wp:~# cm disconnect  
Service ‘disconnect’ does not exist.  
root@swi-mdm9x28-wp:~# cm data disconnect  
Disconnecting … ok  
root@swi-mdm9x28-wp:~# cm data connect  
Checking if device ‘rmnet\_data0’ is up … ok  
Routing inet … ok  
Updating /etc/resolv.conf … ok  
Updating /etc/resolv.conf … ok  
Testing connection … root@swi-mdm9x28-wp:~# cm data  
Index: 1  
APN: [internet.itelcel.com](http://internet.itelcel.com)  
PDP Type: IPV4V6  
Connected: yes  
Auth type: PAP  
User name: webgpr  
Password: webgprs2002  
Interface: rmnet\_data0  
Family[IPv4]: inet  
IP[IPv4]: 10.18.81.121  
Gateway[IPv4]: 10.18.81.122  
Dns1[IPv4]: 10.233.16.4  
Dns2[IPv4]: 10.182.35.36  
root@swi-mdm9x28-wp:~# ping [google.com](http://google.com)  
PING [google.com](http://google.com) (172.217.5.78): 56 data bytes  
64 bytes from 172.217.5.78: seq=0 ttl=55 time=80.150 ms  
^C  
— [google.com](http://google.com) ping statistics —  
1 packets transmitted, 1 packets received, 0% packet loss  
round-trip min/avg/max = 80.150/80.150/80.150 ms  
root@swi-mdm9x28-wp:~#

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 23, 2020, 1:15am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/9 "2020-05-23T01:15:53Z")

</div>

Can you try ping 8.8.8.8?

root@swi-mdm9x28-wp:~# ping [google.com](http://google.com/)  
ping: bad address ‘[google.com](http://google.com/)’

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 23, 2020, 4:24am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/10 "2020-05-23T04:24:04Z")

</div>

root@swi-mdm9x28-wp:~# ping 8.8.8.8  
PING 8.8.8.8 (8.8.8.8): 56 data bytes  
ping: sendto: Network is unreachable  
root@swi-mdm9x28-wp:~#

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 23, 2020, 5:21am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/11 "2020-05-23T05:21:54Z")

</div>

Can you try with modemdemo sample app?

root@swi-mdm9x15:~# cat /legato/systems/current/appsWriteable/modemDemo\_wp85/sms  
Chat.txt

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# app runProc modemDemo\_wp85 send --exe=send – 1234567 “Onlin  
e”  
root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# [67.735510] NOHZ: local\_softirq\_pending 08  
[67.815656] NOHZ: local\_softirq\_pending 08

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# ifconfig  
eth0 Link encap:Ethernet HWaddr E2:37:AB:42:35:72  
UP BROADCAST MULTICAST MTU:1500 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:1000  
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback  
inet addr:127.0.0.1 Mask:255.0.0.0  
inet6 addr: ::1/128 Scope:Host  
UP LOOPBACK RUNNING MTU:65536 Metric:1  
RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:0  
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

rmnet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
inet addr:10.73.199.134 Mask:255.255.255.252  
inet6 addr: fe80::cf1b:86b2:984f:2a56/64 Scope:Link  
UP RUNNING MTU:1430 Metric:1  
RX packets:2 errors:0 dropped:0 overruns:0 frame:0  
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:1000  
RX bytes:612 (612.0 B) TX bytes:1192 (1.1 KiB)

usb0 Link encap:Ethernet HWaddr 06:98:B6:83:86:8A  
inet addr:192.168.2.2 Bcast:192.168.2.255 Mask:255.255.255.0  
inet6 addr: fe80::498:b6ff:fe83:868a/64 Scope:Link  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:197 errors:0 dropped:4 overruns:0 frame:0  
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:1000  
RX bytes:29026 (28.3 KiB) TX bytes:1839 (1.7 KiB)

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# cat /legato/systems/current/appsWriteable/modemDemo\_wp85/sms  
Chat.txt

## Requesting data connection.

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# cm data  
Index: 1  
APN: hkcsl  
PDP Type: IPV4V6  
Connected: yes

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# ping 8.8.8.8  
PING 8.8.8.8 (8.8.8.8): 56 data bytes  
[87.542682] NOHZ: local\_softirq\_pending 08  
64 bytes from 8.8.8.8: seq=0 ttl=56 time=161.086 ms  
^C  
— 8.8.8.8 ping statistics —  
4 packets transmitted, 1 packets received, 75% packet loss  
round-trip min/avg/max = 161.086/161.086/161.086 ms  
root@swi-mdm9x15:~# [90.685304] NOHZ: local\_softirq\_pending 08  
root@swi-mdm9x15:~# ping 8.8.8.8  
PING 8.8.8.8 (8.8.8.8): 56 data bytes  
[93.445780] NOHZ: local\_softirq\_pending 08  
64 bytes from 8.8.8.8: seq=0 ttl=56 time=181.657 ms  
[94.424202] NOHZ: local\_softirq\_pending 08  
64 bytes from 8.8.8.8: seq=1 ttl=56 time=159.530 ms  
^C  
— 8.8.8.8 ping statistics —  
2 packets transmitted, 2 packets received, 0% packet loss  
round-trip min/avg/max = 159.530/170.593/181.657 ms  
root@swi-mdm9x15:~# app runProc modemDemo\_wp85 send --exe=send – 1234567 “Offli  
ne”  
root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# cm data  
^C  
root@swi-mdm9x15:~# cm data  
Index: 1  
APN: hkcsl  
PDP Type: IPV4V6  
Connected: no

root@swi-mdm9x15:~#  
root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# legato version  
16.10.1\_a6a25fbda05738774857dccb9fd76a99\_modified  
root@swi-mdm9x15:~#  
root@swi-mdm9x15:~# cm info  
Device: WP8548  
IMEI: 359377060004735  
FSN: LL537500110203  
Firmware: SWI9X15Y\_07.11.22.00 r33729 CARMD-EV-FRMWR1 2017/01/11 18:04:06  
Bootloader: SWI9X15Y\_07.11.22.00 r33729 CARMD-EV-FRMWR1 2017/01/11 18:04:06  
priIdPn: 9904889  
priIdRev: 01.11  
skuId: 1102621  
root@swi-mdm9x15:~#

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 25, 2020, 2:35am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/12 "2020-05-25T02:35:52Z")

</div>

no problem is found on my side:

root@swi-mdm9x28-wp:~# app runProc modemDemo1 send --exe=send – 1234567 "Online  
"  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# cm data  
Index: 1  
APN: hkcsl  
PDP Type: IPV4V6  
Connected: yes  
Interface: rmnet\_data0  
Family[IPv4]: inet  
IP[IPv4]: 10.129.157.82  
Gateway[IPv4]: 10.129.157.81  
Dns1[IPv4]: 10.145.148.1  
Dns2[IPv4]: 10.144.148.133  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# ping 8.8.8.8  
PING 8.8.8.8 (8.8.8.8): 56 data bytes  
64 bytes from 8.8.8.8: seq=0 ttl=54 time=67.974 ms  
64 bytes from 8.8.8.8: seq=1 ttl=54 time=109.576 ms  
^C  
— 8.8.8.8 ping statistics —  
2 packets transmitted, 2 packets received, 0% packet loss  
round-trip min/avg/max = 67.974/88.775/109.576 ms  
root@swi-mdm9x28-wp:~# cm info  
Device: WP7607  
IMEI: 359779081234565  
IMEISV: 6  
FSN: [1289.755299] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv\_addr:0x3a MSTR\_STS:0x0c1300c8 OPER:0x00000090  
VN730485080103  
Firmware Version: SWI9X07Y\_02.28[1289.773684] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv\_addr:0x3a MSTR\_STS:0x0c1300c8 OPER:0x00000090  
.03.03 000000 jenkins 2019/05/21 03:33:04  
Bootloader Version: SWI9X07Y\_02.28.03.03 000000 jenkins 2019/05/21 03:33:04  
MCU Version: 002.011  
PRI Part Number (PN): 9908958  
PRI Revision: 001.000  
Carrier PRI Name: GENERIC  
Carrier PRI Revision: 002.068\_000  
SKU: 1104301  
Last Reset Cause: Power Down  
Resets Count: Expected: 144 Unexpected: 11  
root@swi-mdm9x28-wp:~# legato version  
19.02.0\_cf7c704124f14adfeb3f8595be4b0772\_modified

---

<div class="post-metadata">

**Author:** ![luisalbertoespinosa](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@luisalbertoespinosa](https://mangoh.discourse.group/u/luisalbertoespinosa)\
**Post date:** [May 26, 2020, 12:06am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/13 "2020-05-26T00:06:53Z")

</div>

I tried running the demo with the same results…  
I think it would help me more to know what exactly “cm data connect” does…  
where can I see the application that parses the terminal input to know what cm data connect does?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [May 26, 2020, 12:13am UTC](https://mangoh.discourse.group/t/use-external-sim-to-connect-to-custom-server/4482/14 "2020-05-26T00:13:42Z")

</div>

Please see here:

> <https://github.com/legatoproject/legato-af/blob/master/apps/tools/cm/cm_data.c>
