Setup ppp

2,335 views
Skip to first unread message

Adrien

unread,
May 31, 2011, 10:08:43 AM5/31/11
to android-porting
Hi,

I need to use ppp in Froyo. I need some pointers on how to do this.

What i know for now:

=== init.rc ===

Need to add
setprop ro.radio.use-ppp yes

service pppd_gprs /etc/ppp/init.gprs-pppd
user root
group radio cache inet misc
disabled

Thing is i don't have init.gprs-pppd. I searched a bit and found
several scripts but i don't know which one i should use.

Plus when i try to launch ppp using /system/bin/pppd, i have this nice
error :
FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

and when i use /dev/ppp as the device :

E/pppd ( 1269): no device specified and stdin is not a tty
E/pppd ( 1271): tcgetattr: Not a typewriter (line 909)

Any hints is appreciated

Hamilton Vera

unread,
May 31, 2011, 11:37:13 AM5/31/11
to ferre....@gmail.com, android-porting
Greetings, you may use this script:

hamilton@saygon:../out/target/product/XXX/system/etc$ cat init.gprs-pppd
#!/system/bin/sh
# An unforunate wrapper script
# so that the exit code of pppd may be retrieved


# this is a workaround for issue #651747
#trap "/system/bin/sleep 1;exit 0" TERM


PPPD_PID=

/system/bin/setprop "net.gprs.ppp-exit" ""

/system/bin/log -t pppd "Starting pppd"

PPPD_ARGS=`/system/bin/getprop net.gprs.ppp-args`

#/system/xbin/pppd $*
# pppd was put into /system/bin instead of /system/xbin after SDK1.6

/system/bin/pppd /dev/YOURDEVICE debug defaultroute $PPPD_ARGS noauth
crtscts nodetach usepeerdns ipcp-no-addresses noipdefault novj noccp
lcp-echo-failure 4 lcp-echo-interval 60 modem nocrtscts linkname ppp0

PPPD_EXIT=$?
PPPD_PID=$!

/system/bin/log -t pppd "pppd exited with $PPPD_EXIT"

/system/bin/setprop "net.gprs.ppp-exit" "$PPPD_EXIT"

#EOF

Usually RIL calls this one by property_set("ctl.start", SERVICE_PPPD_GPRS);


[]'s

Hamilton Vera

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

--
Hamilton Vera
int Administrator (char Network[],char ComputationalSystems[])
http://hvera.wordpress.com

paldan

unread,
Jun 1, 2011, 3:47:01 AM6/1/11
to android-porting
Hello,
I'm using Eclair and following a different path: in my platform pppd
activation is done through RIL_REQUEST_SETUP_DATA_CALL request. I had
to customize the RIL library for that.

Probably your last error is because you need to setup pppd for using
the correct device and this depends on your platform (for example if
you have a modem connected through USB the device could be ttyACM0 or
ttyUSB0).

I suggest you to read the following page:

http://ppp.samba.org/ppp/pppd.html

Regards,
Daniele

lnxarm

unread,
Jun 1, 2011, 10:24:21 AM6/1/11
to dnlplm, android-porting
How can I get data connection without using pppd?
 
In my case, I have two channels(/dev/ttyS0 use for AT commands, and /dev/ttyS1 can be used for data connection)
 
I can sucessfully get data connection by starting pppd service (at RIL_REQUEST_SETUP_DATA_CALL ), but I want to know how can I get data connection without this hack.
 
 
Regards,
 
2011-06-01

lnxarm

发件人: paldan
发送时间: 2011-06-01  03:47:14
收件人: android-porting
抄送:
主题: [android-porting] Re: Setup ppp

Hamilton Vera

unread,
Jun 1, 2011, 10:35:29 AM6/1/11
to lnx...@gmail.com, dnlplm, android-porting
If you want to use data using a mobile network/carrier you will have
to use pppd.

Please correct me if I am wrong.

2011/6/1 lnxarm <lnx...@gmail.com>:

--

Adrien

unread,
Jun 1, 2011, 6:56:00 AM6/1/11
to android-porting
thank you both, i'll try both solutions.

lnxarm

unread,
Jun 1, 2011, 1:40:54 PM6/1/11
to Hamilton Vera, android-porting
I think Andoird is using socket.
 
 
2011-06-01

lnxarm

发件人: Hamilton Vera
发送时间: 2011-06-01  10:35:30
收件人: lnxarm
抄送: dnlplm; android-porting
主题: Re: [android-porting] Re: Setup ppp
If you want to use data using a mobile network/carrier you will have
to use pppd.
Please correct me if I am wrong.
2011/6/1 lnxarm <lnx...@gmail.com>:

Adrien

unread,
Jun 6, 2011, 4:21:04 AM6/6/11
to android-porting
Hamilton:

I tried your script and it seems i am lacking some stuff. when i try
to start the script from the command line (with /dev/YOURDEVICE = /dev/
ttyUSB0, the same tty i use for RIL), the command prompt tells me

nodetach: not found
lcp-echo-interval: not found

and when i try to remove those, then it doesn't find the other
arguments. What am i missing?

Plus i've seen on several forums that people use two tty lines to
access the modem: one for data and one for calls if i understand
correctly. Could the problem come from this? If so how can i setup
multiple lines on a single modem?

Thanks

On 1 juin, 19:40, "lnxarm" <lnx...@gmail.com> wrote:
> I think Andoird is using socket.
>
> 2011-06-01
>
> lnxarm

simon

unread,
Jun 7, 2011, 5:45:27 AM6/7/11
to android-porting
I have just completed this part of work recently so here are some
advice.

1, get the ppp source code(I am using ppp-2.4.4) and compile "chat" .
(android has pppd but doesn't have chat . Maybe there are some other
ways to attach the net without chat )

2, modify ppp-2.4.4/scripts/ppp-on according to your own platform.
( take care about the arguments of pppd in the script )

3,test your ppp-on under command line. (eg: pppd call
your_dial_script_file_name)

4, If you can attatch to the net successfully ,then you can call the
script in RIL.

5, in order to call the script in RIL,you need to:
a, add a service in init.rc. eg:
service pppd_gprs /etc/ppp/init.gprs-pppd
user root
group radio cache inet misc
disabled

b, when you receive :RIL_REQUEST_SETUP_DATA_CALL , use
property_set("ctl.start", SERVICE_PPPD_GPRS);
to activate the script ( you have tested the scrpit at step 3
so you can probably attach to the net )

c, add permisions in enable the RIL to call the script.
( froyo_source_code/system/core/init/property_service.c ,
struct {
const char *service;
unsigned int uid;
unsigned int gid;
} control_perms[])

6, you probably can attach to the internet but still need to do
some work to make the mechanism robust. I think you will find some
places need to be improved.

paldan

unread,
Jun 7, 2011, 9:05:15 AM6/7/11
to android-porting
Hi,

On Jun 6, 10:21 am, Adrien <ferre.adr...@gmail.com> wrote:

>
> Plus i've seen on several forums that people use two tty lines to
> access the modem: one for data and one for calls if i understand
> correctly. Could the problem come from this? If so how can i setup
> multiple lines on a single modem?
>

You will need two tty lines for having both data connection and phone
features. Usually USB drivers (like CDCACM) create more than one
devices. Otherwise you have to use a software multiplexer.

Regards,
Daniele

Adrien

unread,
Jun 8, 2011, 8:11:43 AM6/8/11
to android-porting
Ok thanks for the answers. I'll try to use seperate lines as soon as I
am able to use pppd on android.

I just finished testing pppd on linux (works great when using the chat
script), and i'd like to use the chat program on Android as well (as
simon said). But to do so it needs to be compiled for ARM and i'm
stuck on this:
when i do /home/jdoe/bin/froyo/prebuilt/linux-x86/toolchain/arm-
eabi-4.4.0/bin/arm-eabi-gcc chat.c
i have a whole bunch of errors, mainly saying that i am missing the
header files
(chat.c:93:19: error: stdio.h: No such file or directory
chat.c:94:19: error: ctype.h: No such file or directory
chat.c:95:18: error: time.h: No such file or directory
chat.c:96:19: error: fcntl.h: No such file or directory
chat.c:97:20: error: signal.h: No such file or directory
chat.c:98:19: error: errno.h: No such file or directory
chat.c:99:20: error: string.h: No such file or directory
chat.c:100:20: error: stdlib.h: No such file or directory
chat.c:101:20: error: unistd.h: No such file or directory
chat.c:102:23: error: sys/types.h: No such file or directory
chat.c:103:22: error: sys/stat.h: No such file or directory
chat.c:104:20: error: syslog.h: No such file or directory
chat.c:115:21: error: termios.h: No such file or directory
....
)

I am pretty much a noob when it comes to cross compilation and i need
some help there.

Inxarm: sorry, i have no idea how to make a data connection without
the ppp deamon.

Adrien

unread,
Jun 9, 2011, 11:34:07 AM6/9/11
to android-porting
Simon: as you suggested i tried to use the command line first to make
it work, and it apparently does work.

script used:
/system/bin/pppd /dev/ttyUSB0 115200 persist defaultroute usepeerdns -
detach crtscts noauth debug connect "/system/bin/chat -v -s -f /etc/
ppp/dialTest"

with dialTest:
TIMEOUT 10
ABORT BUSY
ABORT DELAYED
ABORT "NO ANSWER"
ABORT "NO DIALTONE"
ABORT VOICE
ABORT ERROR
ABORT RINGING
'' AT

OK ATE1
OK AT+CGDCONT=1,"IP","websfr"
OK "ATD*99***1#"
CONNECT ''

the main android log:
I/BootReceiver( 1214): Got intent with action
android.intent.action.MEDIA_SCANNER_FINISHED
I/pppd ( 1229): Serial connection established.
D/pppd ( 1229): using channel 1
I/pppd ( 1229): Using interface ppp0
I/pppd ( 1229): Connect: ppp0 <--> /dev/ttyUSB0
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :16 found
I/ethernet( 936): the device flag :1090
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :16 found
I/ethernet( 936): the device flag :1090
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
D/Tethering( 936): ppp0 is not a tetherable iface, ignoring
W/pppd ( 1229): Warning - secret file /etc/ppp/pap-secrets has
world and/or group access
D/pppd ( 1229): sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic
0x60db354e> <pcomp> <accomp>]
D/pppd ( 1229): rcvd [LCP ConfNak id=0x1 <asyncmap 0xa0000>]
D/pppd ( 1229): sent [LCP ConfReq id=0x2 <asyncmap 0xa0000> <magic
0x60db354e> <pcomp> <accomp>]
D/pppd ( 1229): rcvd [LCP ConfAck id=0x2 <asyncmap 0xa0000> <magic
0x60db354e> <pcomp> <accomp>]
D/pppd ( 1229): rcvd [LCP ConfReq id=0x3 <asyncmap 0xa0000> <pcomp>
<accomp> <magic 0xfe45388e> <auth chap MD5>]
D/pppd ( 1229): No auth is possible
D/pppd ( 1229): sent [LCP ConfRej id=0x3 <auth chap MD5>]
D/pppd ( 1229): rcvd [LCP ConfReq id=0x5 <asyncmap 0xa0000> <pcomp>
<accomp> <magic 0xfe45388e> <auth pap>]
D/pppd ( 1229): No auth is possible
D/pppd ( 1229): sent [LCP ConfRej id=0x5 <auth pap>]
D/pppd ( 1229): rcvd [LCP ConfReq id=0x7 <asyncmap 0xa0000> <pcomp>
<accomp> <magic 0xfe45388e>]
D/pppd ( 1229): sent [LCP ConfAck id=0x7 <asyncmap 0xa0000> <pcomp>
<accomp> <magic 0xfe45388e>]
D/pppd ( 1229): sent [CCP ConfReq id=0x1 <deflate 15>
<deflate(old#) 15>]
D/pppd ( 1229): sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr
0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
D/pppd ( 1229): rcvd [LCP ProtRej id=0x8 80 fd 01 01 00]
D/pppd ( 1229): rcvd [IPCP ConfReq id=0x1 <addr 192.168.254.254>]
D/pppd ( 1229): sent [IPCP ConfAck id=0x1 <addr 192.168.254.254>]
D/pppd ( 1229): rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
D/pppd ( 1229): sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns3 0.0.0.0>]
D/pppd ( 1229): rcvd [IPCP ConfNak id=0x2 <addr 10.250.141.130> <ms-
dns1 172.20.2.39> <ms-dns3 172.20.2.10>]
D/pppd ( 1229): sent [IPCP ConfReq id=0x3 <addr 10.250.141.130> <ms-
dns1 172.20.2.39> <ms-dns3 172.20.2.10>]
D/pppd ( 1229): rcvd [IPCP ConfAck id=0x3 <addr 10.250.141.130> <ms-
dns1 172.20.2.39> <ms-dns3 172.20.2.10>]
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :20 found
I/ethernet( 936): the device flag :10008
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :21 found
I/ethernet( 936): the device flag :10008
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :20 found
I/ethernet( 936): the device flag :10008
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
E/pppd ( 1229): not replacing existing default route to eth0
[192.168.254.1]
I/pppd ( 1229): local IP address 10.250.141.130
I/pppd ( 1229): remote IP address 192.168.254.254
I/pppd ( 1229): primary DNS address 172.20.2.39
I/pppd ( 1229): secondary DNS address 172.20.2.10
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :16 found
I/ethernet( 936): the device flag :1090
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :16 found
I/ethernet( 936): the device flag :110D1
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/dalvikvm( 936): Jit: resizing JitTable from 4096 to 8192
I/pppd ( 1229): Terminating on signal 2
I/pppd ( 1229): Connect time 2.4 minutes.
I/pppd ( 1229): Sent 0 bytes, received 0 bytes.
D/pppd ( 1229): sent [LCP TermReq id=0x3 "User request"]
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :16 found
I/ethernet( 936): the device flag :1090
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :21 found
I/ethernet( 936): the device flag :10008
I/ethernet( 936): Done parsing
I/ethernet( 936): poll state :, left:4096
I/ethernet( 936): Poll events from ethernet devices
D/pppd ( 1229): rcvd [LCP TermAck id=0x3 "User request"]
I/pppd ( 1229): Connection terminated.
E/Tethering( 936): attempting to remove unknown iface (ppp0),
ignoring
I/ethernet( 936): recvmsg get data
I/ethernet( 936): event :17 found
I/ethernet( 936): the device flag :1090

The problem i have now is that doing so apparently removes all
interfaces (when i do ifconfig, i have 0 interfaces, not event eth0
and lo which i had just before). Then when i try to ping Google's ip
it says network unreachable. I hope i am close to the solution, i'll
buy a champagne bottle tonight and i hope i'll open it tomorrow :D )

thanks for the help btw, i am setting up a wiki documenting all my
work, and will give the link to the ppp related page when i can use
it.

paldan

unread,
Jun 10, 2011, 8:02:45 AM6/10/11
to android-porting
Hi,

On 9 Giu, 17:34, Adrien <ferre.adr...@gmail.com> wrote:
> The problem i have now is that doing so apparently removes all
> interfaces (when i do ifconfig, i have 0 interfaces, not event eth0
> and lo which i had just before). Then when i try to ping Google's ip
> it says network unreachable. I hope i am close to the solution, i'll
> buy a champagne bottle tonight and i hope i'll open it tomorrow :D )
>

Try to use netcfg instead of ifconfig. For dns you have to setup
Android dns properties (e.g. net.dns1 and net.dns2 and those depending
on your interface).

Regards,
Daniele

Adrien

unread,
Jun 10, 2011, 10:22:06 AM6/10/11
to android-porting
Well, adding dns doesn't do much.

After connecting manually i typed setprop net.dns1 XX.XX.XX.XX, and
nothing new happened.

I absolutely have to use ppp from ril in order to have an internet
connection?

if so in the ril what do i do exactly, like simon said i have to start
the ppp-gprs service, but when does android becomes aware that ppp0 is
actually the interface to use when connecting to the internet? I saw a
couple of things in the ip-up and ip-down scripts, but i am not sure
how android does to figure out which interface to use.

Tell me if i am not clear enough.

Adrien

unread,
Jun 17, 2011, 8:29:10 AM6/17/11
to android...@googlegroups.com
sorry for the long wait, i had to change my modem so i had a few things i had to take care of before continuing ppp dev.

I can't seem to be able to start pppd from ril: actually, th ril doesn't seem to call the setupdatacall function at all.

Below is my radio logcat: as you can see, it seems that the ril isn't able to setup a data call because the gsm data tracker thinks it's not ready for data, but why? 

01-01 01:00:28.500 D/GSM     ( 1021): [IccCard] Broadcasting intent ACTION_SIM_STATE_CHANGED LOADED reason null
01-01 01:00:28.507 D/GSM     ( 1021): GSMDataConnTrack handleMessage { what=4 when=28505 obj=android.os.AsyncResult@440754e0 }
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] No APN found for carrier: 20810
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] setState: FAILED
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] Clean up connection due to null
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] setState: DISCONNECTING
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] cleanUpConnection: !tearDown, call conn.resetSynchronously
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnection-1] DcInactiveState: msg.what=EVENT_RESET, ignore we're already reset
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnection-1] NotifyDisconnectCompleted
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnection-1] clearSettings
01-01 01:00:28.539 D/GSM     ( 1021): [DataConnection] Stop poll NetStat
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] cleanupConnection: !notificationDeferred
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] gotoIdleAndNotifyDataConnection: reason=null
01-01 01:00:28.539 D/GSM     ( 1021): [GsmDataConnectionTracker] setState: IDLE
01-01 01:00:28.570 D/GSM     ( 1021): GSMDataConnTrack handleMessage { what=5 when=28549 obj=simLoaded }
01-01 01:00:28.570 D/GSM     ( 1021): [GsmDataConnectionTracker] ***trySetupData due to simLoaded
01-01 01:00:28.570 D/GSM     ( 1021): [DSAC DEB] trySetupData with mIsPsRestricted=false
01-01 01:00:28.570 D/GSM     ( 1021): [GsmDataConnectionTracker] trySetupData: Not ready for data:  dataState=IDLE gprsState=1 sim=true UMTS=false phoneState=IDLE isDataAllowed=true dataEnabled=true roaming=false dataOnRoamingEnable=false ps restricted=false desiredPowerState=true MasterDataEnabled=true
01-01 01:00:39.000 D/AT      (  851): AT< +CREG: 1,"1901","2408"
01-01 01:00:39.000 I/RIL     (  851): !!!!!!!!!!!!!!!!!!!!!!  reference-ril.c onUnsolicited !!!!!!!!!!!!!!!!!!!!!!1
01-01 01:00:39.000 D/RILJ    ( 1021): [UNSL]< UNSOL_RESPONSE_NETWORK_STATE_CHANGED
01-01 01:00:39.000 D/RILJ    ( 1021): [0053]> OPERATOR
01-01 01:00:39.000 D/RIL     (  851): onRequest: OPERATOR
01-01 01:00:39.000 I/RIL     (  851): ##### Request operator
01-01 01:00:39.000 D/AT      (  851): AT> AT+COPS=3,0;+COPS?
01-01 01:00:39.000 D/RILJ    ( 1021): [0054]> GPRS_REGISTRATION_STATE
01-01 01:00:39.000 D/RILJ    ( 1021): [0055]> REGISTRATION_STATE
01-01 01:00:39.007 D/RILJ    ( 1021): [0056]> QUERY_NETWORK_SELECTION_MODE
01-01 01:00:39.023 D/AT      (  851): AT< +COPS: 0,0,"F SFR"
01-01 01:00:39.023 D/AT      (  851): AT< OK
01-01 01:00:39.023 I/RIL     (  851): ##### Request operator: had start
01-01 01:00:39.023 I/RIL     (  851): ##### Request operator: had first int
01-01 01:00:39.023 I/RIL     (  851): ##### Request operator: had next int
01-01 01:00:39.023 I/RIL     (  851): ##### Request operator: had next string
01-01 01:00:39.023 I/RIL     (  851): ##### Request operator: succeeded
01-01 01:00:39.023 D/RILJ    ( 1021): [0053]< OPERATOR {F SFR}
01-01 01:00:39.023 D/RIL     (  851): onRequest: GPRS_REGISTRATION_STATE
01-01 01:00:39.023 D/AT      (  851): AT> AT+CGREG?
01-01 01:00:39.031 D/AT      (  851): AT< +CGREG: 1,0
01-01 01:00:39.039 D/AT      (  851): AT< OK
01-01 01:00:39.039 D/RIL     (  851): onRequest: REGISTRATION_STATE
01-01 01:00:39.039 D/AT      (  851): AT> AT+CREG?
01-01 01:00:39.039 D/RILJ    ( 1021): [0054]< GPRS_REGISTRATION_STATE {0, ffffffff, ffffffff}
01-01 01:00:39.046 D/AT      (  851): AT< +CREG: 2,1,"1901","2408"
01-01 01:00:39.046 D/AT      (  851): AT< OK
01-01 01:00:39.046 D/RIL     (  851): onRequest: QUERY_NETWORK_SELECTION_MODE
01-01 01:00:39.046 I/RIL     (  851): #####  requestQueryNetworkSelectionMode
01-01 01:00:39.046 D/AT      (  851): AT> AT+COPS?
01-01 01:00:39.046 D/RILJ    ( 1021): [0055]< REGISTRATION_STATE {1, 1901, 2408}
01-01 01:00:39.062 D/AT      (  851): AT< +COPS: 0,0,"F SFR"
01-01 01:00:39.062 D/AT      (  851): AT< OK
01-01 01:00:39.062 D/RILJ    ( 1021): [0056]< QUERY_NETWORK_SELECTION_MODE {0}
01-01 01:00:39.062 E/GSM     ( 1021): Wrong network type: 0
01-01 01:00:39.062 E/GSM     ( 1021): Wrong network type: 0
01-01 01:00:39.062 D/GSM     ( 1021): Poll ServiceState done:  oldSS=[0 home null null null  Unknown CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false] newSS=[0 home null null null  Unknown CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false] oldGprs=1 newGprs=1 oldType=unknown newType=unknown
01-01 01:00:47.523 D/RILJ    ( 1021): [0057]> SIGNAL_STRENGTH
01-01 01:00:47.531 D/RIL     (  851): onRequest: SIGNAL_STRENGTH
01-01 01:00:47.531 D/AT      (  851): AT> AT+CSQ
01-01 01:00:47.539 D/AT      (  851): AT< +CSQ: 24,0
01-01 01:00:47.546 D/AT      (  851): AT< OK
01-01 01:00:47.546 D/RILJ    ( 1021): [0057]< SIGNAL_STRENGTH {24, 0, 0, 0, 0, 0, 0}

Adrien Ferré

unread,
Jun 20, 2011, 9:28:04 AM6/20/11
to android...@googlegroups.com
Hi everyone,

i made some progress during the weekend, thanks to chenyihuaz. I added the requests IMEI, IMSI et IMEISV which apparently were the cause of the data call never being made.

The ppp script is now started by the RIL, but the ip scripts are never called. I obviously made the scripts executable (chmod 755 ip-up) and tried serveral owning configurations (radio.root, radio.system, ...) but none of those worked.

I am also confused as to which properties i should set. In some case i see that i have to set "net.gprs.*" properties, in others i see "net.ppp0.*", ... Anyone knows which of those actually is used in android?

Adrien Ferré

unread,
Jun 23, 2011, 9:09:28 AM6/23/11
to android...@googlegroups.com
Hi

The problem with the ip scripts was that i had to name them like this
ip-up-ppp0
ip-down-ppp0
so that the ppp deamon knows where to find them.

So now, pppd starts along with ip-scripts and they allow me to pass the ips to Android's higher level layers (using system properties). 

BUT, it stops right afterwards, because data gets disabled for some reason and I can't find out why. 

Below are my radio and main logcat files



As you can see, disableAPNType(default) gets called somehow, and this causes the gsmconnectiontracker to remove the data connection.

  1. 01-01 01:00:55.796 D/GSM     ( 1051): [GsmDataConnectionTracker] setState: CONNECTED
  2. 01-01 01:00:55.812 D/GSM     ( 1051): [DataConnection] Start poll NetStat
  3. 01-01 01:00:55.812 D/GSM     ( 1051): preRx -1 preTx -1
  4. 01-01 01:00:55.812 D/GSM     ( 1051): newRx 3 newTx 3
  5. 01-01 01:00:55.835 D/GSM     ( 1051): GSMDataConnTrack handleMessage { what=23 when=55843 }
  6. 01-01 01:00:55.843 D/GSM     ( 1051): [GsmDataConnectionTracker] Clean up connection due to dataDisabled
  7. 01-01 01:00:55.843 D/GSM     ( 1051): [GsmDataConnectionTracker] setState: DISCONNECTING

i have been reading the telephony framwork code for some time, and i can't figure where the cause of this problem is. Any help is appreciated.


ffxx68

unread,
May 9, 2013, 12:10:24 PM5/9/13
to android...@googlegroups.com
Hi,

I’m porting a GB tablet firmware to JB (https://groups.google.com/forum/#!forum/renesas-emev-osp) and I’m now stuck at the 3G modem integration. I missed what has been customized in GB (though I can access code), so I have to redo the work myself.

I found Adrien's tutorial (https://afewe.wordpress.com/android-arm-development/use-point-to-point-protocol-ppp-in-android) very useful to this aim, though I still have a few doubts I’d like someone to clarify.

1) what needs to be done, in order to make the connection being triggered by the “appearance” of the ttyUSB* devices, when powering up the modem for example?
2) the chat script invoked by pppd is apparently operator-specific. What should be done to make connection generic and APN-independent?
3) If rild makes the “trick”, what are the parts that are typically customized and what type of info needs to be collected about the specific modem being used (btw, mine is a ZTE MF-212).

Thanks in advance
Fabio

Vishveshwar

unread,
May 10, 2013, 5:02:18 AM5/10/13
to android...@googlegroups.com
On JB 3G-modem integration seems to have become easier.
Refer this page on TI wiki:
http://processors.wiki.ti.com/index.php/Android-USB-3G-Modem-Integration

-Vishveshwar
Message has been deleted

ffxx68

unread,
May 13, 2013, 11:12:46 AM5/13/13
to android...@googlegroups.com
Thanks Vishevar for the very useful pointer.

I still have a few doubts though....

My modem is an internal ZTE MF-212 one and when powered up (by GPIO switching in kernel) it immediately appears as /dev/ttyUSB0 to /dev/ttyUSB2, so, no need to use usb_modeswitch in my case.

I still have a few doubts though:

1) Thought not explicitly mentioned in your tutorial, should we remove the "no-RIL" option in init.rc?

     setprop ro.radio.noril yes

What is the effect of this? I've noticed AOSP devices haven't this set...

2) Any suggestion about debug-logging rild? I see no logcat message when powering up the 3G module, though /dev/ttyUSB* are there.

3) What are the most modem-specific customizations introduced in reference-ril? Anything that needs to be changed, for a different modem?

4) I see no phone signal icon at all on UI, though I do have the mobile network options (with an empty APN list... in spite the apns-conf.xml is there). I'm wondering if there's anything else requiring customizations, in the AOSP code, apart from the commits you list above. I haven't downloaded the full rowboat-jb code, yet...

Thanks in advance
Fabio
Reply all
Reply to author
Forward
0 new messages