Enabling wlan0 and rmnet on Android

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

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?

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”

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

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)

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

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@:confused: # ndc network create 10
200 0 success
shell@:confused: # ndc network interface add 10 usb0
200 0 success
shell@:confused: # ndc network route add 10 usb0 0.0.0.0/0 192.168.2.3
200 0 success
shell@:confused: # ndc network default set 10
200 0 success
shell@:confused: # ifconfig usb0
usb0: ip 192.168.2.3 mask 255.255.255.0 flags [up broadcast running multicast]
shell@:confused: # ifconfig wwan0
wwan0: Cannot assign requested address
255|shell@:confused: # ping www.google.com
ping: unknown host 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
PING 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 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:~#

see if you can share the data from rmnet_data0 interface to ecm0 interface on WP76 module:

iptables -F && iptables -I INPUT -j ACCEPT
iptables -t nat -A POSTROUTING --out-interface rmnet_data0 -j MASQUERADE
iptables -A FORWARD -o ecm0 -i rmnet_data0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ecm0 -o rmnet_data0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

On android side, you can try “ping 8.8.8.8”

i am able to ping from adb shell but i guess, the browser needs soemthing more.

you might also need to setup DNS information.
e.g.
on module side:
cat /etc/resolv.conf
nameserver 10.144.148.1
nameserver 10.145.148.133

On Android side:
ndc resolver setnetdns 10 “” 10.144.148.1

No luck!!

Did the same on module,

round-trip min/avg/max = 12.365/15.667/18.969 ms
root@swi-mdm9x28-wp:~# cat /etc/resolv.conf
domain wifi.local
nameserver 8.8.8.8
root@swi-mdm9x28-wp:~#

Android :

25 ip route add default via 192.168.2.2 dev usb0
26 ip route list
27 /system/bin/ndc resolver setnetdns usb0 1.1.1.1 8.8.8.8
28 /system/bin/ndc network default set usb0

so now your adb shell can ping google server, and your Android application can ping 192.168.2.2, right?

Yes. Able to ping, but browser does not work.

can android application ping 8.8.8.8

From android adb shell able to ping 8.8.8.8

3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 22.531/24.288/25.246/1.257 ms
shell@:confused: # ping www.google.com
PING www.google.com (172.217.163.36) 56(84) bytes of data.
64 bytes from maa05s01-in-f4.1e100.net (172.217.163.36): icmp_seq=1 ttl=115 time=33.1 ms
64 bytes from maa05s01-in-f4.1e100.net (172.217.163.36): icmp_seq=2 ttl=115 time=26.2 ms
64 bytes from maa05s01-in-f4.1e100.net (172.217.163.36): icmp_seq=3 ttl=115 time=28.3 ms
^C
www.google.com ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 26.270/29.283/33.194/2.903 ms
shell@:confused: # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=28.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=22.7 ms
^C
— 8.8.8.8 ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 22.739/25.746/28.754/3.011 ms

How about android app? Can it go to some real ip address?
You need to isolate if this is dns issue

From the Android browser - firefox, not able to connect any where.
google.com / 8.8.8.8 Not able to get browse.

Then can browser access 192.168.2.2 ?
E.g. setup a http server in module

Cannot browse 192.168.2.2
Able to only ping.

did you set up the http server?
or you can set up a TCP server on port 80 and see if you receive the HTTP request from browser