# Enabling wlan0 and rmnet on Android

**URL:** <https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733>\
**Category:** mangOH Red\
**Created:** [November 27, 2020, 9:37am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733 "2020-11-27T09:37:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 9:37am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/1 "2020-11-27T09:37:12Z")

</div>

Hi,

Regret for the long post.

On the MangoH red board, have connected sim and able to make a call and use data connection. Also to the same board, connected talon Wifi module and able to get the wlan0 up.  
This whole setup is connected to Android based hardware which will be accessing sim and well as wifi. The Android is the master which will initiate all the commands for enabling and disabling cellular nw as well as wifi.

For the Cellular network, Android Ril Integration Guide 4117325 was followed. And able to successfully get cellular connectivity. So all the mangoh usb ports enumerate as USB modem ports.

For the Wifi, wrote a atServer app at the MangoH board side which will receive at cmds from Android and perform Wifi operations. For this used raw port, enabled using USBcomp=9014D. Able to get this port up on PC and run custom at commands.  
Used GobiSerial.c on Android platform and able to get this port working

Below are the issues currently facing.

1. When GobiSerial.c file is used for the raw Port, the USB modem ports for cellular communication is broken. For cellular communication sierra.c file is used. How to enable both serial and usb modem ports on Android like it happens on PC(Ubuntu PC).

2. Both rmnet and wlan0 are accessed using usb0 interface from Android. Will there be any dhcpc issues ? How to resolve this? If dhcpcd\_usb0 is up and running then, the cellular network data is not comming up.

Any inputs will really help.

---

<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:** [November 27, 2020, 9:53am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/2 "2020-11-27T09:53:37Z")

</div>

1. the RIL is hardcoded to use particular /dev/ttyUSB port, if you enable raw port, of course the RIL will not work. You need to shut down NMEA port in this case.
2. "Both rmnet and wlan0 are accessed using usb0 interface from Android. " -\> don’t quite understand this one.  
If you use RIL driver, only one interface will be used to be data connection. From \AndroidFS\system\vendor\bin\init.dhcpcd, I believe this interface should be wwan0.  
Is the usb0 here meaning ECM interface?

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 11:16am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/3 "2020-11-27T11:16:18Z")

</div>

For

1. If i disable NMEA port, enable raw Port, without any driver changes, RIL and raw port will work ? Will check, bcoz if i disabled NMEA the ril libs had issues. Will recheck once.

2. With RIL driver which interface is used for data connection ? in the init.dhcpcd the interface is wwan0.  
usb0 on Android is the ecm interface of MangoH red board.

---

<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:** [November 27, 2020, 11:24am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/4 "2020-11-27T11:24:36Z")

</div>

1.Ril lib should not know about nmea  
2.then what is the problem? Wwan0 and usb0 are two different interface

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 1:07pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/5 "2020-11-27T13:07:56Z")

</div>

1. Currently, usbcomp=9014D. What is the value for disabling NMEA. I gave 90149. It gve error

2. when the usb0 has dhcpcd running on the android, the wwan0 inteface is facing issues and not enabling data connection.

---

<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:** [November 27, 2020, 2:06pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/6 "2020-11-27T14:06:25Z")

</div>

1. You can check by  
at!entercnd=“A710”  
At!usbcomp=?

2. Maybe you use static ip for usb0

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 2:47pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/7 "2020-11-27T14:47:22Z")

</div>

is the value 90109 correct ?  
Disabling the NMEA, the Android board is not able to get the radio signals.  
I get only interface #0 and #3. Can you let me know what these interfaces are ?

Logs :  
4\>[25.925945] usb 1-1.3: config 1 has no interface number 7  
\<6\>[25.938591] usb 1-1.3: New USB device found, idVendor=1199, idProduct=68c0  
\<6\>[25.938602] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3  
\<6\>[25.938609] usb 1-1.3: Product: Sierra Wireless WP7608  
\<6\>[25.938615] usb 1-1.3: Manufacturer: Sierra Wireless, Incorporated  
\<6\>[25.938622] usb 1-1.3: SerialNumber: XG81428546071017  
\<7\>[25.953582] usb 1-1.3: sierra\_probe  
\<7\>[25.953592] usb 1-1.3: Ignoring blacklisted interface #16  
\<7\>[25.983012] usb 1-1.3: sierra\_probe  
\<7\>[25.983024] usb 1-1.3: sierra\_calc\_num\_ports  
\<6\>[25.983032] sierra 1-1.3:1.0: Sierra USB modem converter detected  
\<7\>[25.983047] usb 1-1.3: sierra\_startup  
\<7\>[25.983056] usb 1-1.3: Memory usage (urbs) interface #0, in=4, out=4  
\<6\>[25.983063] usb 1-1.3: APM supported, enabling autosuspend.  
\<6\>[25.984037] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB0  
\<7\>[25.984618] usb 1-1.3: sierra\_probe  
\<7\>[25.984627] usb 1-1.3: sierra\_calc\_num\_ports  
\<6\>[25.984634] sierra 1-1.3:1.3: Sierra USB modem converter detected  
\<7\>[25.984650] usb 1-1.3: sierra\_startup  
\<7\>[25.984659] usb 1-1.3: Memory usage (urbs) interface #3, in=8, out=64  
\<6\>[25.984685] usb 1-1.3: APM supported, enabling autosuspend.  
\<6\>[25.985618] usb 1-1.3: Sierra USB modem converter now attached to ttyUSB1  
\<6\>[25.998543] GobiNet 1-1.3:1.8 wwan0: register ‘GobiNet’ at usb-msm\_hsusb\_host-1.3, GobiNet Ethernet Device, a6:95:cb:09:10:1b  
\<6\>[25.998860] USB Speed : USB 2.0  
\<6\>[26.006245] cdc\_ether 1-1.3:1.19 usb0: register

---

<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:** [November 27, 2020, 3:06pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/8 "2020-11-27T15:06:48Z")

</div>

How about at!usbcomp=1,1,90149

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 3:16pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/9 "2020-11-27T15:16:25Z")

</div>

Interface 16 and 5 are ignored. 16 is audio while 5 is raw port. Which are blacklisted in the driver.

the Android board is not able to get the radio signals still.

Logs :  
\<6\>[32.247959] usb 1-1.4: New USB device found, idVendor=1199, idProduct=68c0  
\<6\>[32.247971] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3  
\<6\>[32.247978] usb 1-1.4: Product: Sierra Wireless WP7608  
\<6\>[32.247985] usb 1-1.4: Manufacturer: Sierra Wireless, Incorporated  
\<6\>[32.247992] usb 1-1.4: SerialNumber: XG81428546071017  
\<7\>[32.261608] usb 1-1.4: sierra\_probe  
\<7\>[32.261619] usb 1-1.4: Ignoring blacklisted interface #16  
\<7\>[32.286864] usb 1-1.4: sierra\_probe  
\<7\>[32.286877] usb 1-1.4: sierra\_calc\_num\_ports  
\<6\>[32.286885] sierra 1-1.4:1.0: Sierra USB modem converter detected  
\<7\>[32.286904] usb 1-1.4: sierra\_startup  
\<7\>[32.286914] usb 1-1.4: Memory usage (urbs) interface #0, in=4, out=4  
\<6\>[32.286921] usb 1-1.4: APM supported, enabling autosuspend.  
\<6\>[32.287318] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB0  
\<7\>[32.287704] usb 1-1.4: sierra\_probe  
\<7\>[32.287712] usb 1-1.4: sierra\_calc\_num\_ports  
\<6\>[32.287719] sierra 1-1.4:1.3: Sierra USB modem converter detected  
\<7\>[32.287734] usb 1-1.4: sierra\_startup  
\<7\>[32.287744] usb 1-1.4: Memory usage (urbs) interface #3, in=8, out=64  
\<6\>[32.287751] usb 1-1.4: APM supported, enabling autosuspend.  
\<6\>[32.288093] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB1  
\<7\>[32.288484] usb 1-1.4: sierra\_probe  
\<7\>[32.288492] usb 1-1.4: Ignoring blacklisted interface #5  
\<6\>[32.292616] GobiNet 1-1.4:1.8 wwan0: register ‘GobiNet’ at usb-msm\_hsusb\_host-1.4, GobiNet Ethernet Device, 2a:9c:00:7c:3a:2a  
\<6\>[32.296366] USB Speed : USB 2.0  
\<6\>[32.308404] cdc\_ether 1-1.4:1.19 usb0: register ‘cdc\_ether’ at usb-msm\_hsusb\_host-1.4, CDC Ethernet Device, 52:2b:f7:f5:1c:91  
\<6\>[33.906180] u8Type:0x02, TID:0x00 ,MSGID:0x27

---

<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:** [November 27, 2020, 3:27pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/10 "2020-11-27T15:27:55Z")

</div>

Why raw port is ignored?  
If you cannot make raw port replace nmea port, then ril will not work

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [November 27, 2020, 3:34pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/11 "2020-11-27T15:34:18Z")

</div>

If i m not wrong, the driver code, has interface numbers which are blacklisted.  
I am not sure what are the interface numbers. Raw port is ignored.

Can you let me know what interface number is what ? Are the below correct ?  
16 - audio,  
5 - raw port.  
0 - Diag  
3 - Modem  
2 - NMEA

Attaching the driver file. Please see line 445.  
[sierra.c](https://mangoh.discourse.group/uploads/short-url/s4lG1ZvfNAg911HLIynpQFw2IcT.c) (53.2 KB)  
static const signed char qmi\_9x15\_non\_serial\_ifaces = {1,4,5,8,10,11,16,19,20};  
static const struct sierra\_iface\_info qmi\_9x15\_interface\_blacklist = {  
.infolen = ARRAY\_SIZE( qmi\_9x15\_non\_serial\_ifaces ),  
.ifaceinfo = qmi\_9x15\_non\_serial\_ifaces,  
};

---

<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:** [November 27, 2020, 4:19pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/12 "2020-11-27T16:19:50Z")

</div>

Never tried this before, you can enable those two interfaces and give a try

---

<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:** [November 30, 2020, 2:10am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/13 "2020-11-30T02:10:01Z")

</div>

FYI, I remember I tried on Android 8 with  
at!usbcomp=1,1,80149

I can start the RIL driver.

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [December 1, 2020, 1:24am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/14 "2020-12-01T01:24:26Z")

</div>

But the RawIP port is up in the Android device ? the sierra.c file has blacklisted it.

If i remove the #5 from the list, then the ril driver is not up.

Can you pls confirm so that i can know where i am going wrong

---

<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:** [December 1, 2020, 1:48am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/15 "2020-12-01T01:48:11Z")

</div>

can you try this setting first?  
at!usbcomp=1,1,80149

At that time I don’t enable the audio port.

what /dev/ttyUSB port can you see?

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [December 1, 2020, 2:35am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/16 "2020-12-01T02:35:25Z")

</div>

There are 3 ports, /dev/ttyUSB0, 1 and 2. NMEA is disabled.

Alternatively, i also tried to disable rawIP port and use sockets for communicating with atServer app on the MangoH red board side.  
Was able to successfuly communicate with sockets from the Android side with usb0(whcih is ecm0 on MangoH Red board) enabled on boot up.

in the init.qcom.rc file,  
service dhcpcd\_usb0 /system/bin/dhcpcd -ABKLG  
class late\_start  
disabled  
oneshot

enables the usb0 at bootup. So the sockets work.

This disables the wwan0 enabling.

Is there some settings on Android for using the wwan0 first and then when enable usb0 when required ?

In the init.dhcpcd the interface is wwan0. Should i do something there ?

Basically, the question, “Is there some setting similar to ril integration on Android with MangoH Red +Wifi”

---

<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:** [December 1, 2020, 2:59am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/17 "2020-12-01T02:59:53Z")

</div>

as said before, you can use static IP for usb0:  
ifconfig usb0 192.168.2.3

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [December 1, 2020, 3:10am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/18 "2020-12-01T03:10:15Z")

</div>

Yes, as per suggestion, did assign usb0, but the dhcpc is still on the wwan0 and hence, when i try sockets from my Anroid application(apk), the default routing is through wwan0 and not the usb0.

Tried setting the ip tables defualt to usb0, but that also did not work.

So wanted to know if there are settings for usb0 routing ? (I know its a general Android stuff, but that did not work, so wanted to check if this was done)

---

<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:** [December 1, 2020, 3:23am UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/19 "2020-12-01T03:23:32Z")

</div>

seems need to use some “ndc” command.  
In the past, I have tried not using the RIL but using AT!SCACT command to establish data connection.  
I need to type the following in the Android console in order to make the browser in android to connect to network, you might give a try to change the wwan0 to usb0 and see what happens:

```
ifconfig
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:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1184 TX bytes:1184

wwan0 Link encap:Ethernet HWaddr ce:6a:d4:fb:9b:08 Driver GobiNet
          inet addr:10.105.171.186 Bcast:10.105.171.187 Mask:255.255.255.252
          inet6 addr: fe80::cc6a:d4ff:fefb:9b08/64 Scope: Link
          UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10511 TX bytes:7216

ndc network create 10
ndc network interface add 10 wwan0
ndc network route add 10 wwan0 0.0.0.0/0 10.105.171.186
ndc network default set 10
```

---

<div class="post-metadata">

**Author:** ![tejaswisj](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@tejaswisj](https://mangoh.discourse.group/u/tejaswisj)\
**Post date:** [December 1, 2020, 1:28pm UTC](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733/20 "2020-12-01T13:28:27Z")

</div>

Thanks jyijyi.

I did that setting, while i was able to communicate with the atServer Socket app on the WP from Android, i was not able to ping or browse.

Android :  
shell@😕 # ndc network create 10  
200 0 success  
shell@😕 # ndc network interface add 10 usb0  
200 0 success  
shell@😕 # ndc network route add 10 usb0 0.0.0.0/0 192.168.2.3  
200 0 success  
shell@😕 # ndc network default set 10  
200 0 success  
shell@😕 # ifconfig usb0  
usb0: ip 192.168.2.3 mask 255.255.255.0 flags [up broadcast running multicast]  
shell@😕 # ifconfig wwan0  
wwan0: Cannot assign requested address  
255|shell@😕 # ping [www.google.com](http://www.google.com)  
ping: unknown host [www.google.com](http://www.google.com)

WP:

wlan0 Link encap:Ethernet HWaddr F4:E1:1E:37:81:2E  
inet addr:192.168.43.217 Bcast:192.168.43.255 Mask:255.255.255.0  
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1  
RX packets:4 errors:0 dropped:0 overruns:0 frame:0  
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0  
collisions:0 txqueuelen:1000  
RX bytes:986 (986.0 B) TX bytes:1330 (1.2 KiB)

root@swi-mdm9x28-wp:~# ping [www.google.com](http://www.google.com)  
PING [www.google.com](http://www.google.com) (142.250.76.36): 56 data bytes  
64 bytes from 142.250.76.36: seq=0 ttl=115 time=91.126 ms  
64 bytes from 142.250.76.36: seq=1 ttl=115 time=18.203 ms  
^C  
— [www.google.com](http://www.google.com) ping statistics —  
2 packets transmitted, 2 packets received, 0% packet loss  
round-trip min/avg/max = 18.203/54.664/91.126 ms  
root@swi-mdm9x28-wp:~#

[Next page](https://mangoh.discourse.group/t/enabling-wlan0-and-rmnet-on-android/5733.md?page=2)
