I am following this thread with great interest as I recently have
tried to setup a 3G connection though a Huawei USB modem. I succeded
in doing this from both an Android-x86 and a Beagleboard. However this
was using a manual startup of the PPP daemon, where I have modified
the chat script to use the APN name of my 3G provider.

Will the result of the implementation work reflected in this thread be
released for the Android community either as an extension to the
generic RIL or as an alternative RIL implementation ?

- Jens Kristian

On 21 Maj, 09:52, Uhrenfeldt Henrik <henrik.uhrenfe...@ixonos.com>
wrote:
> Hi Mike,
>
> Hehe... I had the same feeling.
>
> My DEACTIVATE does not work 100% smooth, but it works. I basically set 
> AT+CGACT=0,1 and wait for PPPD to die from natural causes. As far as I 
> remember, it does in fact call ip-down. I do not attempt to stop the service 
> manually (via init.svc.pppd_gprs), neither do I care about the untracked pid 
> (which I think I get as well).
>
> Regarding breaking out of data mode, my modem automatically terminates the 
> PPP connection when it receives the AT+CGACT=0,1, so I am not doing anything 
> like the '+++'...
>
> One thing though - I cannot seem to get the exit code from pppd properly, but 
> at some point I gave up and decided I could live without it. Since I was able 
> to setup the data connection several times in a row, I concluded it was good 
> enough :-)
>
> - Henrik
>
>
>
> -----Original Message-----
> From: M&M stich [mailto:mstic...@gmail.com]
> Sent: 20. maj 2010 22:26
> To: Uhrenfeldt Henrik
>
> Cc: android-porting
> Subject: Re: Data connection via cell modem (GPRS)
>
> Hi Henrik!
> @#$%^^!!  This is driving me nuts.
>
> Ok, I lengthened the timeout, takes around 14 Sec for me.  I also see the 
> DEACTIVATE due to APN changed.  But the deactivate does not work.
>
> Looks like ip-down does not get called. If I manually do a stop on the 
> service, it does not get called. If I kill pid from the console, then it does 
> get called.  I'm relying on it to set the same property I use to check 
> startup to "no" instead of "yes".  I suppose I could use the 
> init.svc.pppd_gprs property instead, but I thought ip-down should get called. 
>   By the way, the shell that ran ip-up does not go away after it runs.  When 
> I stop pppd_gprs, I get an "untracked pid exited" from it.
>
> BUT,  the chat disconnect script is not running correctly either, it seems. 
> It needs to do the '+++' to break out of data mode.  The modem requires 1 sec 
> before and 1 sec after of quiet time for this to work.  I set verbose on the 
> chat command, but it did not show me anything.  I may need to figure out how 
> to trace it.
> Thanks
> Mike
>
> On Thu, May 20, 2010 at 10:29 AM, Uhrenfeldt Henrik 
> <henrik.uhrenfe...@ixonos.com> wrote:
>
>         Hi Mike!
>
>         I bet 2 seconds is not near enough.. I have a timeout of 15 seconds 
> to wait for the PPP to get up properly - in average it takes around 7-8 
> seconds. Then probably what goes wrong next is the fact that the needed 
> properties were set in the last run, so your SETUP_DATA_CALL finishes 
> quickly, but meanwhile you may have confused the modem with another 
> AT+CGDCONT..
>
>         You have to get the first attempt to work and be sure that there are 
> no race conditions with setting/reading properties. For example - if you set 
> your custom property to something like "initing" in the beginning of the pppd 
> service and wait for it to become "up", the next time you run 
> SETUP_DATA_CALL, it will be "up" until the service is really running and 
> setting it to "initing" - unless you do some kludgy waiting in 
> SETUP_DATA_CALL before initially checking state of your property. This had me 
> tweaking for some time.
>
>         To get all this running properly, I also had to implement 
> DEACTIVATE_DATA_CALL in which I send an "AT+CGACT=0,1" and then I wait for 
> pppd service to exit (yet another property to check for). In our setup, 
> Android always sets up the connection twice (due to some weirdness with a 
> list of APNs changing in higher layers), so we need to have a reliable 
> shutdown as well - sigh..
>
>         Regarding your timeout on the AT channel there is not much to say 
> else than it seems the modem is somehow in a state where it won't answer. 
> This is of course critical for the RIL and it has no choice other than 
> attempting to restart. Hopefully it is caused by PDP context confusion or 
> some other invalid chain of commands caused by the data setup stuff.
>
>         - Henrik
>         ---
>         Henrik Uhrenfeldt
>         Chief Software Engineer
>         Ixonos Denmark ApS
>         Niels Jernes Vej 10,
>         DK-9220 Aalborg Ø, Denmark
>         mobile +45 4030 2607
>         email: henrik.uhrenfe...@ixonos.com
>        http://www.ixonos.com
>
>         -----Original Message-----
>         From: M&M stich [mailto:mstic...@gmail.com]
>
>         Sent: 20. maj 2010 17:08
>         To: Uhrenfeldt Henrik
>         Cc: android-porting
>         Subject: Re: Data connection via cell modem (GPRS)
>
>         Hi Henrik,
>         ip-up sets a custom property last (only does some logging after that) 
> that triggers the ril to send a response.  The ril waits 2 sec for the 
> property, then times out and returns an error.  Android then tries again 
> shortly thereafter, and the ril does not have to wait at all, everything is 
> setup.
>
>         Now,when I try and start the browser, it somehow causes a timeout on 
> the signal strength request and cause the radio to crash.  This is a new 
> behavior.  Here is the end of the radio log, showing the data call being set 
> up as described.  PDPconnection seems to have the dns correctly.  Also shows 
> the at channel timeout somehow caused by the browser trying to start.  It 
> does restart successfully eventually.
>         Thanks   Mike
>         ---------------------------------------------------
>         :::::
>         D/GSM     (  955): SIMRecords: record load complete
>         D/GSM     (  955): [GsmSimCard] Broadcasting intent 
> SIM_STATE_CHANGED_ACTION LOADED reason null
>         D/GSM     (  955): Get PreferredAPN
>         D/GSM     (  955): [GsmDataConnectionTracker] ***trySetupData due to 
> simLoaded
>         D/GSM     (  955): [DSAC DEB] trySetupData with mIsPsRestricted=false
>         I/GSM     (  955): Preferred APN:310410:310410:ATT, 1, 310410, 
> wap.cingular, null, null, null, null, null, *
>         I/GSM     (  955): Waiting APN set to preferred APN
>         D/GSM     (  955): [GsmDataConnectionTracker] Create from allApns : 
> [ATT, 1, 310410, wap.cingular, null, null, null, null, null, *]
>         D/GSM     (  955): [GsmDataConnectionTracker] Setup watingApns : 
> [ATT, 1, 310410, wap.cingular, null, null, null, null, null, *]
>         D/GSM     (  955): [PdpConnection] DataConnection.getState()
>         D/GSM     (  955): [PdpConnection] Connecting to carrier: 'ATT' APN: 
> 'wap.cingular' proxy: 'null' port: 'null
>         D/RILJ    (  955): [0057]> SETUP_DATA_CALL wap.cingular
>         D/RIL     (  863): onRequest: SETUP_DATA_CALL
>         D/RIL     (  863): requesting data connection to APN 'wap.cingular'
>         D/RIL     (  863):  ---- Initial running status :  len : 2  Status: no
>         D/RIL     (  863):  ---- Starting service pppd_gprs -----
>         D/RIL     (  863): --- Initial Response is : 1 ; gprs ; 
> 000.000.000.000
>         D/RIL     (  863):  ---- starting wait for property -----, len : 2  
> Status: no
>         D/GSM     (  955): [GsmDataConnectionTracker] setState: INITING
>         D/RIL     (  863):  ---- PPPD failed to start:  status = no , length 
> = 2 , retry = 0
>         D/RILJ    (  955): [0057]< SETUP_DATA_CALL error: 
> com.android.internal.telephony.CommandException: GENERIC_FAILURE
>         D/GSM     (  955): [PdpConnection] DataConnection.handleMessage()
>         E/GSM     (  955): PDP Context Init failed 
> com.android.internal.telephony.CommandException: GENERIC_FAILURE
>         D/RILJ    (  955): [0058]> LAST_DATA_CALL_FAIL_CAUSE
>         D/RIL     (  863): onRequest: LAST_DATA_CALL_FAIL_CAUSE
>         D/RILJ    (  955): [0058]< LAST_DATA_CALL_FAIL_CAUSE error: 
> com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED
>         D/GSM     (  955): [PdpConnection] DataConnection.handleMessage()
>         D/GSM     (  955): [PdpConnection] Notify PDP fail at 1274367573216 
> due to Unknown Data Error
>         D/GSM     (  955): [GsmDataConnectionTracker] PDP setup failed 
> Unknown Data Error
>         D/GSM     (  955): [GsmDataConnectionTracker] setState: FAILED
>         D/GSM     (  955): PDP activate failed. Scheduling next attempt for 5s
>         D/GSM     (  955): NOT Posting GPRS Unavailable notification -- 
> likely transient error
>         D/GSM     (  955): GPRS reconnect alarm. Previous state was FAILED
>         D/GSM     (  955): [GsmDataConnectionTracker] Clean up connection due 
> to simLoaded
>         D/GSM     (  955): [GsmDataConnectionTracker] setState: DISCONNECTING
>         D/GSM     (  955): [PdpConnection] DataConnection.clearSettings()
>         D/GSM     (  955): [DataConnection] Stop poll NetStat
>         D/GSM     (  955): [GsmDataConnectionTracker] setState: IDLE
>         D/GSM     (  955): [GsmDataConnectionTracker] ***trySetupData due to 
> (unspecified)
>         D/GSM     (  955): [DSAC DEB] trySetupData with mIsPsRestricted=false
>         I/GSM     (  955): Preferred APN:310410:310410:ATT, 1, 310410, 
> wap.cingular, null, null, null, null, null, *
>         I/GSM     (  955): Waiting APN set to preferred APN
>         D/GSM     (  955): [GsmDataConnectionTracker] Create from allApns : 
> [ATT, 1, 310410, wap.cingular, null, null, null, null, null, *]
>         D/GSM     (  955): [GsmDataConnectionTracker] Setup watingApns : 
> [ATT, 1, 310410, wap.cingular, null, null, null, null, null, *]
>         D/GSM     (  955): [PdpConnection] DataConnection.getState()
>         D/GSM     (  955): [PdpConnection] Connecting to carrier: 'ATT' APN: 
> 'wap.cingular' proxy: 'null' port: 'null
>         D/RILJ    (  955): [0059]> SETUP_DATA_CALL wap.cingular
>         D/RIL     (  863): onRequest: SETUP_DATA_CALL
>         D/RIL     (  863): requesting data connection to APN 'wap.cingular'
>         D/RIL     (  863):  ---- Initial running status :  len : 3  Status: 
> yes
>         D/RIL     (  863):  ---- Starting service pppd_gprs -----
>         D/RIL     (  863): --- Initial Response is : 1 ; gprs ; 
> 000.000.000.000
>         D/RIL     (  863):  ---- starting wait for property -----, len : 3  
> Status: yes
>         D/RIL     (  863):  --- PPPD started successfully; status : yes  
> Lengthe: 3,  Retry count : 200
>         D/RIL     (  863):  ---- Local IP read as :   10.129.140.89  length : 
> 13 -----
>         D/RIL
>
> ...
>
> læs mere »- Skjul tekst i anførselstegn -
>
> - Vis tekst i anførselstegn -

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to