[Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread Martin Langhoff
Hi list!

We have a bug on 802/8.2.1 where in some cases (specific combination
of WPA2 with certain AP chipsets) we fail to associate on the very
first attempt, and then subsequent attempts succeed.

I am wondering if a workaround is possible here -- to patch the
Sugar/Neighbourhood view code that drives NM so that for certain cases
it automatically retries once before giving up.

Is it possible? Where should I look?

More about the bug:  Under the right conditions, this repros 100%: it
always fails the first attempt, always succeeds the second time.
Anyone interested in the root cause should get into
http://dev.laptop.org/ticket/9936 -- and be prepared to get into the
firmware/supplicant/kernel interactions. The bug seems to be fixed on
F11 images.

cheers,



martin
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread C. Scott Ananian
On Thu, Feb 4, 2010 at 9:04 AM, Martin Langhoff
 wrote:
> We have a bug on 802/8.2.1 where in some cases (specific combination
> of WPA2 with certain AP chipsets) we fail to associate on the very
> first attempt, and then subsequent attempts succeed.
>
> I am wondering if a workaround is possible here -- to patch the
> Sugar/Neighbourhood view code that drives NM so that for certain cases
> it automatically retries once before giving up.

I've got a similar bug I'm working on @ litl, with a similar workaround.

I think I convinced myself that network manager was the right place to
make the patch, because you want to reuse NM's list/order of
previously-connected APs to try.  If you look at it, NM has code to do
the connection attempts at intervals -- but it also has code to
*prevent* retries to any connection that has failed once.  I think the
right fix is to tweak that so that it still retries those connections,
but at a slightly longer time interval.
  --scott

-- 
 ( http://cscott.net/ )
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread Martin Langhoff
On Thu, Feb 4, 2010 at 9:49 AM, C. Scott Ananian  wrote:
> I think I convinced myself that network manager was the right place to
> make the patch, because you want to reuse NM's list/order of

The right place, I am sure, is the kernel or firmware ;-)

For my specific case, I am trying to find the codeblock that controls
the "try known APs, if they don't work cycle though mesh frequencies".
I am pretty sure that this control cycle happens in Sugar/Python code.

I am also pretty sure I don't want to hack on our bespoke NM if I can help it.

cheers,


m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread C. Scott Ananian
On Thu, Feb 4, 2010 at 12:08 PM, Martin Langhoff
 wrote:
> On Thu, Feb 4, 2010 at 9:49 AM, C. Scott Ananian  wrote:
>> I think I convinced myself that network manager was the right place to
>> make the patch, because you want to reuse NM's list/order of
>
> The right place, I am sure, is the kernel or firmware ;-)
>
> For my specific case, I am trying to find the codeblock that controls
> the "try known APs, if they don't work cycle though mesh frequencies".
> I am pretty sure that this control cycle happens in Sugar/Python code.

I thought that had been moved into NM.  I could be wrong.
 --scott

-- 
 ( http://cscott.net/ )
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread Martin Langhoff
On Thu, Feb 4, 2010 at 1:26 PM, C. Scott Ananian  wrote:
> I thought that had been moved into NM.  I could be wrong.

In Sugar 0.82 this seems to be handled but a bunch of objects, and I
don't yet understand how they tie together. But
src/view/home/MeshBox.py has a _disconnect_activate_cb() method that
seems to switch to mesh mode.

def _disconnect_activate_cb(self, menuitem):
# Disconnection for an AP means activating the default mesh device
network_manager = hardwaremanager.get_network_manager()
if network_manager and self._meshdev:
network_manager.set_active_device(self._meshdev)
self._palette.props.secondary_text = _('Disconnecting...')
self.props.pulsing = False

There are however several methods around with the same name, so it
could be this one. Or the other one.

Hopefully ppl who hacked on this code will say "yes, you're looking at
the right place". Or "lookie over there..."

cheers,



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-04 Thread C. Scott Ananian
On Thu, Feb 4, 2010 at 2:55 PM, Martin Langhoff
 wrote:
> On Thu, Feb 4, 2010 at 1:26 PM, C. Scott Ananian  wrote:
>> I thought that had been moved into NM.  I could be wrong.
>
> In Sugar 0.82 this seems to be handled but a bunch of objects, and I
> don't yet understand how they tie together. But
> src/view/home/MeshBox.py has a _disconnect_activate_cb() method that
> seems to switch to mesh mode.
>
>    def _disconnect_activate_cb(self, menuitem):
>        # Disconnection for an AP means activating the default mesh device
>        network_manager = hardwaremanager.get_network_manager()
>        if network_manager and self._meshdev:
>            network_manager.set_active_device(self._meshdev)
>            self._palette.props.secondary_text = _('Disconnecting...')
>            self.props.pulsing = False
>
> There are however several methods around with the same name, so it
> could be this one. Or the other one.
>
> Hopefully ppl who hacked on this code will say "yes, you're looking at
> the right place". Or "lookie over there..."

http://www.google.com/search?q=networkmanager-list+mesh+site:mail-archive.com
  --scott

-- 
 ( http://cscott.net/ )
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-08 Thread Martin Langhoff
On Thu, Feb 4, 2010 at 2:55 PM, Martin Langhoff
 wrote:
> Hopefully ppl who hacked on this code will say "yes, you're looking at
> the right place". Or "lookie over there..."

Actually, if there any notes or diagrams of how the network model/view
stuff ties together on 0.82 it'd be a lifesafer. Without a conceptual
map of what it's trying to do, it looks like bits of logic are
scattered all over the place...

I am sure there is a method to the madness.



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-08 Thread Daniel Drake
On 4 February 2010 08:04, Martin Langhoff  wrote:
> Hi list!
>
> We have a bug on 802/8.2.1 where in some cases (specific combination
> of WPA2 with certain AP chipsets) we fail to associate on the very
> first attempt, and then subsequent attempts succeed.

This is an 8.2.1 regression, because several libertas patches were
added late with little testing.

I would suggest reverting those patches.

The reason that it works in F11 is that those patches were never sent
upstream and hence are not included in that kernel.

Daniel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-08 Thread Martin Langhoff
On Mon, Feb 8, 2010 at 4:03 PM, Daniel Drake  wrote:
> This is an 8.2.1 regression, because several libertas patches were
> added late with little testing.

IIRC, the libertas patches did fix interop with other APs. We fixed
some, broke some.




m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-08 Thread Daniel Drake
On 8 February 2010 16:38, Martin Langhoff  wrote:
> On Mon, Feb 8, 2010 at 4:03 PM, Daniel Drake  wrote:
>> This is an 8.2.1 regression, because several libertas patches were
>> added late with little testing.
>
> IIRC, the libertas patches did fix interop with other APs. We fixed
> some, broke some.

Broke all WPA/WPA2 ones, at least when talking about the first
connection attempt.

Additionally, the only reports of improved connectivity that I've seen
came from Marvell/cozybit, who told me that they were not using OLPC's
XO nor sugar at the time. I haven't seen equivalent feedback from
actual users.

Daniel
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-09 Thread Martin Langhoff
On Mon, Feb 8, 2010 at 5:57 PM, Daniel Drake  wrote:
> Broke all WPA/WPA2 ones, at least when talking about the first
> connection attempt.

Only some. And needing a retry isn't a big deal. Cost-benefit and
risk-benefit analysis tells me that working around it in Sugar is a
few orders of magnitude smarter than fixing it in the kernel.

No more bikeshedding for me.

Can anyone help me understand how the Sugar objects tie together?


m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-10 Thread Martin Langhoff
On Thu, Feb 4, 2010 at 3:04 PM, Martin Langhoff
 wrote:
> http://dev.laptop.org/ticket/9936 -- and be prepared to get into the

In case someone needs to understand this setup, the "control logic" is mainly in

  nminfo.py
  nmclient.py
  MeshBox.py

The whole thing is a mesh of callbacks. Lots of objects around the
Sugar desktop subscribe directly to NM events. Coordination and
decisionmaking is moderately centralised in those 3 files above.

So I have a candidate patch, attached to #9936 - seems to work well,
but I'd need failing APs to test it fully. Been testing it with wrong
passphrases ;-)

The only AP I have handy right now (Airport Express) does not show the
bug with 802B1. It does hit the dhclient/dbus timing issue on 802
pretty often, and it completely fails with 767. But with 802B1, it
connects very solidly.

... knowing where to hack is 99.9% of the battle, as usual... once I
found nminfo.py...

cheers,


m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-15 Thread Tomeu Vizoso
On Wed, Feb 10, 2010 at 14:29, Martin Langhoff
 wrote:
> On Thu, Feb 4, 2010 at 3:04 PM, Martin Langhoff
>  wrote:
>> http://dev.laptop.org/ticket/9936 -- and be prepared to get into the
>
> In case someone needs to understand this setup, the "control logic" is mainly 
> in
>
>  nminfo.py
>  nmclient.py
>  MeshBox.py
>
> The whole thing is a mesh of callbacks. Lots of objects around the
> Sugar desktop subscribe directly to NM events. Coordination and
> decisionmaking is moderately centralised in those 3 files above.
>
> So I have a candidate patch, attached to #9936 - seems to work well,
> but I'd need failing APs to test it fully. Been testing it with wrong
> passphrases ;-)

I don't have an assorted array of APs to test with, but will give the
patch a look once I have dealt with the last feature patches for 0.88.
Sorry for not giving better feedback earlier.

Regards,

Tomeu

> The only AP I have handy right now (Airport Express) does not show the
> bug with 802B1. It does hit the dhclient/dbus timing issue on 802
> pretty often, and it completely fails with 767. But with 802B1, it
> connects very solidly.
>
> ... knowing where to hack is 99.9% of the battle, as usual... once I
> found nminfo.py...
>
> cheers,
>
>
> m
> --
>  martin.langh...@gmail.com
>  mar...@laptop.org -- School Server Architect
>  - ask interesting questions
>  - don't get distracted with shiny stuff  - working code first
>  - http://wiki.laptop.org/go/User:Martinlanghoff
> ___
> Sugar-devel mailing list
> Sugar-devel@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] Automatically Retrying an AP?

2010-02-15 Thread Martin Langhoff
On Mon, Feb 15, 2010 at 5:57 PM, Tomeu Vizoso  wrote:
> I don't have an assorted array of APs to test with, but will give the
> patch a look once I have dealt with the last feature patches for 0.88.
> Sorry for not giving better feedback earlier.

NP. Great if you can give it a check.

All that code has been reworked in 0.84 and later, and the workaround
is no longer needed in the F11 builds anyway, so it's a short-lived
patch. Uy team has confirmed it solves the issue on their setup, and
so I am happy.

What it did uncover (for me anyway) is that 0.84 and possibly later
Sugars have several issues talking with NM in the "Sugar is a
configuration server for NM" interaction. Looks like Sugar still
cannot convince NM to take the new passphrase, and that
enabling/disabling encryption breaks things.

See http://dev.laptop.org/ticket/9977 and http://bugs.sugarlabs.org/ticket/1674



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel