Skip to content

Conversation

@darryllee
Copy link

Some APs are returning Quality values of single integers instead of x/100. I'm not sure why, but getCellQuality doesn't seem to recognize a single integer, and so Quality ends up being set to '', per the default value set in line 157.

Unfortunately, when sortNetworks then tries to figure out a sorting factor, it assumes there will be a slash, and we get the error: Unhandled exception 'need more than 1 value to unpack' at /usr/lib/python2.7/dist-packages/kano/network.py line 225

I couldn't figure out why getCellQuality isn't able to deal with a single integer Quality, but I was able to workaround these weird APs (luckily neither of them is mine) by setting factor to 0 if Quality = ''.

Some APs are returning Quality values of single integers instead of x/100. I'm not sure why, but getCellQuality doesn't seem to recognize a single integer, and so Quality ends up being set to '', per the default value set in line 157.

Unfortunately, when sortNetworks then tries to figure out a sorting factor, it assumes there will be a slash, and we get the error: Unhandled exception 'need more than 1 value to unpack' at /usr/lib/python2.7/dist-packages/kano/network.py line 225

I couldn't figure out why getCellQuality isn't able to deal with a single integer Quality, but I was able to workaround these weird APs (luckily neither of them is mine) by setting factor to 0 if Quality = ''.
@tombettany
Copy link
Member

Ah, great job @darryllee! Thanks for looking into this problem; it is always very difficult to test on every AP.

It looks like the getCellQuality() function only gets run if the line starts with Quality= and the getCellQuality() function is looking specifically for the =.

If your comment about the output is correct, those APs which only show a single number have the line being

Quality:40  Signal level:0  Noise level:0

whereas the other APs have the line

Quality=72/100  Signal level=65/100

i.e. they have : instead of =.

While this PR is good in that it prevents crashing in the case of certain APs, it isn't ideal as it doesn't allow the ranking to work. Is it possible to make some changes to network.py to resolve the root of this problem? We could probably safely assume that the quality number given is out of 100 in this case so we could parse it and divide by 100.

Also, we are currently using the jessie branch for our development so ideally this would be rebased on that and the PR submitted to that branch.

@darryllee
Copy link
Author

Oh dur. Right a : instead of an =. It's right there. Sure let me take a
stab at fixing it properly.

We'll still need to adjust for a non fractional Quality but I actually
wrote some code for that before I realized Quality wasn't getting set at
all in those cases.

Thanks Tom!

On Thursday, February 25, 2016, Tom [email protected] wrote:

Ah, great job @darryllee https://github.com/darryllee! Thanks for
looking into this problem; it is always very difficult to test on every AP.

It looks like the getCellQuality() function only gets run if the line
starts with Quality=

if s.strip().startswith("Quality="):
cellData["Quality"] = getCellQuality(s)
cellData["Signal"] = getCellSignal(s)
cellData["Noise"] = getCellNoise(s)

and the getCellQuality()
def getCellQuality(s):
s = s.split("=")[1]
return s.strip().split(" ")[0]

function is looking specifically for the =.

If your comment
#198 (comment)
about the output is correct, those APs which only show a single number have
the line being

Quality:40 Signal level:0 Noise level:0

whereas the other APs have the line

Quality=72/100 Signal level=65/100

i.e. they have : instead of =.

While this PR is good in that it prevents crashing in the case of certain
APs, it isn't ideal as it doesn't allow the ranking to work. Is it possible
to make some changes to network.py
https://github.com/KanoComputing/kano-toolset/blob/jessie/kano/network.py
to resolve the root of this problem?

Also, we are currently using the jessie branch
https://github.com/KanoComputing/kano-toolset/tree/jessie for our
development so ideally this would be rebased on that and the PR submitted
to that branch.


Reply to this email directly or view it on GitHub
#197 (comment)
.

--Darryl Lee [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants