Re: dbus deb with increased timeout

2009-12-15 Thread arne anka
i applied those patches right now.
so far the pin dialog appears twice: once before powerring on antenna and  
once afterwards.
if the second pin dialog is canceled, the phone button stays disabled.
i i put in the pin even the second time all the stuff supposed to happen  
after that runs again, ie reading phone book and sms.


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-15 Thread Neil Jerram
2009/12/15 arne anka openm...@ginguppin.de:
 i applied those patches right now.
 so far the pin dialog appears twice: once before powerring on antenna and
 once afterwards.
 if the second pin dialog is canceled, the phone button stays disabled.
 i i put in the pin even the second time all the stuff supposed to happen
 after that runs again, ie reading phone book and sms.

Thanks for testing, and I'm sorry it isn't working...  I'll take
another look with your report in mind.

Neil

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-15 Thread Neil Jerram
2009/12/15 Neil Jerram neiljer...@googlemail.com:
 2009/12/15 arne anka openm...@ginguppin.de:
 i applied those patches right now.
 so far the pin dialog appears twice: once before powerring on antenna and
 once afterwards.
 if the second pin dialog is canceled, the phone button stays disabled.
 i i put in the pin even the second time all the stuff supposed to happen
 after that runs again, ie reading phone book and sms.

 Thanks for testing, and I'm sorry it isn't working...  I'll take
 another look with your report in mind.

Hmm, I'm having difficulty working this out.  Would you mind posting
(or sending just to me) your /tmp/zhone.log, if you still have it
available?

Thanks,
   Neil

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-14 Thread Neil Jerram
2009/12/12 arne anka openm...@ginguppin.de:
 hi,
 after hours of struggling with debian's djungle of ways to build a package
 i finally succeeded to cross compile dbus with an increased timeout.
 reason: for months now i was fighting with zhone taking several attempts
 (4 to 5 ususally, often at least one restart of frameworkd and sometimes
 even reboots) to pop up the pin dialog.

 after installing the newly built packages, the dialog popped up at the
 first try. i restarted to be sure and again it was there the first attempt.
 for those struggling with the same problem in debian, here's the debs:

 http://www.ginguppin.de/node/29

This is great news - but it is surprising that it needs a change to
the dbus code.  Isn't there a way to configure the default dbus
timeout, or to set it for particular methods?  From googling I've
found hints that adding timeout=100 to the relevant method call
might work - but unfortunately nothing definitive on this.

Regards,
Neil

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-14 Thread arne anka
 This is great news - but it is surprising that it needs a change to
 the dbus code.  Isn't there a way to configure the default dbus
 timeout, or to set it for particular methods?  From googling I've
 found hints that adding timeout=100 to the relevant method call
 might work - but unfortunately nothing definitive on this.

not afaik.
a normal per call or startup option would have been my first choice, but  
 from everything i could gather, there's no way to do that.
i'd expected the patch mentioned to add exactly that kind of option, but  
it turned out to add only a build time option.

but yesterday the phone (or maybe only zhone) lost connection to the  
network which made me miss an appointment and several calls (once a year  
people call ...).
in a hurry i restarted the whole phone but zhone was showing exactly the  
same issues again :-(

back at home i set the t/o to 250*1000 and rebuild and this time i also  
installed the libdbus-package (not only dbus and dbus-x11), since i didn't  
check what package will contain the modified files.
restart frameworkd and zhone allowed immediate pin input, don't know how  
much it is worth ...

but i put the new packages up at ginguppin.de tonight.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-14 Thread Neil Jerram
2009/12/14 arne anka openm...@ginguppin.de:

 not afaik.
 a normal per call or startup option would have been my first choice, but
  from everything i could gather, there's no way to do that.
 i'd expected the patch mentioned to add exactly that kind of option, but
 it turned out to add only a build time option.

OK, thanks.

 but yesterday the phone (or maybe only zhone) lost connection to the
 network which made me miss an appointment and several calls (once a year
 people call ...).
 in a hurry i restarted the whole phone but zhone was showing exactly the
 same issues again :-(

I think the main problem here is not dbus request timeout.  When ogsmd
is still starting up, dbus calls to it - i.e. the antenna power and
authentication status calls - actually complete very quickly with a
device is not enabled error.  If the antenna power call fails like
this, zhone decides to try reading the authentication status.  If the
auth status call fails, zhone does nothing ever after.  So if you're
unlucky with timing, you can easily reach a situation where GSM is not
up and nothing else ever happens.

For me the attached zhone patches fix this.  They change the GSM
startup sequence so that authentication is handled before switching on
the antenna, and add retrying in the case where the auth call fails.

(Another detail in the zhone GSM startup sequence is that it assumes
that if the SetAntennaPower call fails, it may be because a SIM PIN is
needed.  But this complicates the retry logic, and it seems plausible
to me to handle any authentication first.)

A big caveat is that I don't have SIM authentication and so haven't
been able to test if the auth/antenna swapping really works.  If
someone with a PIN could do that, it would be great.

Regards,
   Neil
From 45d0393cc9e8816ffaf9acd19b1fb30007c270c8 Mon Sep 17 00:00:00 2001
From: Neil Jerram neiljer...@googlemail.com
Date: Tue, 15 Dec 2009 00:55:47 +
Subject: [PATCH 1/3] Named entry points turnOnAntenna and handleAuth

---
 zhone |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/zhone b/zhone
index 771a32b..f184855 100755
--- a/zhone
+++ b/zhone
@@ -2158,6 +2158,9 @@ class GSMAgent( Agent ):
 
 This is called to start the authentication process
 
+self.turnOnAntenna()
+
+def turnOnAntenna( self ):
 self.setState( _(Turning on Antenna) )
 dbus_object.gsm_device_iface.SetAntennaPower(
 True,
@@ -2175,6 +2178,9 @@ class GSMAgent( Agent ):
 
 def cbAntennaPowerError( self, e ):
 logger.info( SIM seems to be protected. Checking auth status now. )
+self.handleAuth()
+
+def handleAuth( self ):
 self.setState( _(Reading authentication status) )
 dbus_object.gsm_sim_iface.GetAuthStatus(
 reply_handler=self.cbAuthStatusReply,
-- 
1.6.5.4

From 58dd86f51b7f54a3f4e63b8d3c4c4683683131a0 Mon Sep 17 00:00:00 2001
From: Neil Jerram neiljer...@googlemail.com
Date: Tue, 15 Dec 2009 00:58:14 +
Subject: [PATCH 2/3] Do auth first, then turn on antenna

---
 zhone |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/zhone b/zhone
index f184855..6ec72f9 100755
--- a/zhone
+++ b/zhone
@@ -2158,7 +2158,7 @@ class GSMAgent( Agent ):
 
 This is called to start the authentication process
 
-self.turnOnAntenna()
+self.handleAuth()
 
 def turnOnAntenna( self ):
 self.setState( _(Turning on Antenna) )
@@ -2190,8 +2190,8 @@ class GSMAgent( Agent ):
 def cbAuthStatusReply( self, authstatus ):
 if authstatus == READY:
 self.setState( _(Telephony Ready) )
-# restart auth, should lead to registering this time...
-self.cbResourceReady()
+# Now turn on antenna
+self.turnOnAntenna()
 elif authstatus == SIM PIN:
 self.setState( _(Waiting for PIN) )
 self.main.groups[pin_edit].setup(
-- 
1.6.5.4

From acdd194ea63068605139917daa3f3f0ba060168d Mon Sep 17 00:00:00 2001
From: Neil Jerram neiljer...@googlemail.com
Date: Tue, 15 Dec 2009 00:59:50 +
Subject: [PATCH 3/3] If first auth attempt fails, try again

---
 zhone |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/zhone b/zhone
index 6ec72f9..c0da2ae 100755
--- a/zhone
+++ b/zhone
@@ -23,6 +23,8 @@ You have been warned :)
 __version__ = 0.0.0
 MODULE_NAME = zhone
 
+from time import sleep
+
 # Locale support
 import gettext
 
@@ -2216,6 +2218,9 @@ class GSMAgent( Agent ):
 def cbAuthStatusError( self, e ):
 self.setState( _(Failed to read authentication status) )
 logger.exception( e )
+sleep(5)
+# Retry
+self.handleAuth()
 
 def cbPINDone( self, pin, *args ):
 self.setState( _(Sending PIN) )
-- 
1.6.5.4

___
Openmoko community mailing list
community@lists.openmoko.org

dbus deb with increased timeout

2009-12-12 Thread arne anka
hi,
after hours of struggling with debian's djungle of ways to build a package  
i finally succeeded to cross compile dbus with an increased timeout.
reason: for months now i was fighting with zhone taking several attempts  
(4 to 5 ususally, often at least one restart of frameworkd and sometimes  
even reboots) to pop up the pin dialog.

after installing the newly built packages, the dialog popped up at the  
first try. i restarted to be sure and again it was there the first attempt.
for those struggling with the same problem in debian, here's the debs:

 http://www.ginguppin.de/node/29

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: dbus deb with increased timeout

2009-12-12 Thread Michael 'Mickey' Lauer
Am Samstag, den 12.12.2009, 20:04 +0100 schrieb arne anka:
 hi,
 after hours of struggling with debian's djungle of ways to build a package  
 i finally succeeded to cross compile dbus with an increased timeout.
 reason: for months now i was fighting with zhone taking several attempts  
 (4 to 5 ususally, often at least one restart of frameworkd and sometimes  
 even reboots) to pop up the pin dialog.
 
 after installing the newly built packages, the dialog popped up at the  
 first try. i restarted to be sure and again it was there the first attempt.
 for those struggling with the same problem in debian, here's the debs:
 
  http://www.ginguppin.de/node/29

Awesome, thanks for the update.

-- 
:M:


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community