Bug #558

Improve wifi performance

Added by Hammel almost 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:10 Nov 2016
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:-
Target version:PiBox - 0.12.0
Severity:01 - Critical

Description

It became clear after the two Maker Faire events that wifi in public spaces performs much worse than at home. There are probably tricks to dealing with this, not the least of which is choosing a different channel (which we can already do).

Here is a discussion on other things that can be done to improve performance: http://7signal.com/wi-fi-learning-center/top-wi-fi-issues-and-challenges/
Many of these could be configured through the pnc app.

Associated revisions

Revision 71996fd4
Added by Hammel almost 4 years ago

RM #558: Initial support for a wireless scan component. It's klunky but it will be sufficient
for the PiBox platform.

Revision 71996fd4
Added by Hammel almost 4 years ago

RM #558: Initial support for a wireless scan component. It's klunky but it will be sufficient
for the PiBox platform.

Revision be9da6c0
Added by Hammel almost 4 years ago

RM #558: Add thread to handle automatic updates to the wifi scan window.

Revision be9da6c0
Added by Hammel almost 4 years ago

RM #558: Add thread to handle automatic updates to the wifi scan window.

Revision ca0df062
Added by Hammel almost 4 years ago

RM #558: Switch to using a custom GTK widget, which allows handling async operations much better.

Revision ca0df062
Added by Hammel almost 4 years ago

RM #558: Switch to using a custom GTK widget, which allows handling async operations much better.

Revision 9c9ef0f3
Added by Hammel almost 4 years ago

RM #558: Switch to static link of .a so gdb works from source (not-installed) build.

Revision 9c9ef0f3
Added by Hammel almost 4 years ago

RM #558: Switch to static link of .a so gdb works from source (not-installed) build.

Revision bc8298fc
Added by Hammel almost 4 years ago

RM #558: Add BSS processing, just to see the BSS entries in the area, their strength and channel.
This is in prep for graphing them.

Revision bc8298fc
Added by Hammel almost 4 years ago

RM #558: Add BSS processing, just to see the BSS entries in the area, their strength and channel.
This is in prep for graphing them.

Revision 636aa796
Added by Hammel almost 4 years ago

RM #558: Assign colors to SSIDs based on BSS entries.

Revision 636aa796
Added by Hammel almost 4 years ago

RM #558: Assign colors to SSIDs based on BSS entries.

Revision 1ab7153b
Added by Hammel almost 4 years ago

RM #558: Basic eliptical graph of signal strength. Needs lots of work.

Revision 1ab7153b
Added by Hammel almost 4 years ago

RM #558: Basic eliptical graph of signal strength. Needs lots of work.

Revision db6d4c1e
Added by Hammel almost 4 years ago

RM #558: Completed first working version of graphing of channel signal strength.

Revision db6d4c1e
Added by Hammel almost 4 years ago

RM #558: Completed first working version of graphing of channel signal strength.

Revision 55d35c66
Added by Hammel almost 4 years ago

RM #558: Fix graph offset so channels are more easily identified.

Revision 55d35c66
Added by Hammel almost 4 years ago

RM #558: Fix graph offset so channels are more easily identified.

Revision b2e22f33
Added by Hammel almost 4 years ago

RM #558: Fix segfault exposed when run on ARM.

Revision b2e22f33
Added by Hammel almost 4 years ago

RM #558: Fix segfault exposed when run on ARM.

Revision 56fb3a32
Added by Hammel almost 4 years ago

RM #558: Add all 14 channels for access point channel selection. Move IP address to a text entry
field because scanner doesn't leave room for it on PiBox. Added notes.txt as a reminder of how
the channel frequencies map to the structure in wifiscanwidget.c.

Revision 56fb3a32
Added by Hammel almost 4 years ago

RM #558: Add all 14 channels for access point channel selection. Move IP address to a text entry
field because scanner doesn't leave room for it on PiBox. Added notes.txt as a reminder of how
the channel frequencies map to the structure in wifiscanwidget.c.

History

#1 Updated by Hammel almost 4 years ago

  • Target version changed from 0.13.0 to 0.12.0

#2 Updated by Hammel almost 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

https://www.cyberciti.biz/tips/linux-find-out-wireless-network-speed-signal-strength.html
I can use "watch -n 1 cat /proc/net/wireless" (or a thread based alternative) to monitor the wireless signal.

or to run through a popen(): cat /proc/net/wireless | tail -1 | sed 's/ \+/ /g'

http://www.howtogeek.com/197268/how-to-find-the-best-wi-fi-channel-for-your-router-on-any-operating-system/
I can use "sudo iwlist wlan0 scan | grep \(Channel" to find which channels are in use and recommend which one to use

http://www.linuxjournal.com/content/wi-fi-command-line
Noisy environment settings:
  • sudo iwconfig wlan0 retry 16
  • sudo iwconfig wlan0 frag 512
  • sudo iwconfig wlan0 commit

According to this video the best wifi channels are 1, 6, and 11. I should scan the network for traffic on those channels and pick the best of those automatically. It also suggests more tx power can be used (if hostapd.conf permits) but will generate more heat.

Wireless API information is available from the Linux Wireless web site.

Overlapping channels come in sets, meaning if you can find channels that aren't in use and dont overlap those in use then that's the best channel to use for a WiFi network. Also there are really only 14 channels we care about for g @ 2.5GHz with four more added for 5Ghz.

Graphs could be straight edged or with an arc.

Selecting colors:

#3 Updated by Hammel almost 4 years ago

  • % Done changed from 10 to 40

Making progress. I've got a Cairo based display showing which channels are in use and by how many networks. Now I want to graph the signal strength. To do this I need to run this command:

$ iw dev wlan0 scan
BSS 10:6f:3f:e7:24:55(on wlp3s0) -- associated
    TSF: 797749164512 usec (9d, 05:35:49)
    freq: 5200
    beacon interval: 100 TUs
    capability: ESS Privacy (0x0011)
    signal: -62.00 dBm
    last seen: 82272 ms ago
    Information elements from Probe Response frame:
    SSID: MuseBA
    Supported rates: 6.0* 9.0 12.0* 18.0 24.0* 36.0 48.0 54.0 
    DS Parameter set: channel 40
...

So look for the BSS in the first colmn to find a new entry. Then parse out the signal strength, SSID and channel. That's good enough to start. I can graph the signal and show the SSID with each graph.

Here is how you convert dBm to a percentage. It assumes a maximum dBm of -50, which seems about right from my laptop.

quality = 2 * (dBm + 100)

#4 Updated by Hammel almost 4 years ago

See this comment on serverfault. It mentions different dBm levels for different types of hardware. Basically, for PiBox if the dbm signal is -70 to -60 then the signal is good. So I could do a "yellow line" above which the BSS is good.

#5 Updated by Hammel almost 4 years ago

  • % Done changed from 40 to 70

Graphing of wifi channels and signal strength is complete. Code is committed and pushed. Looks pretty good, actually. I select colors for the graphics using the golden ratio.

Now I need to add all 14 channels to the options menu for selecting a channel for the access point. Then I should set the default to 1, 6 or 11.

#6 Updated by Hammel almost 4 years ago

  • Project changed from PiBox to pibox-network-config
  • Category deleted (09 - Testing)

#7 Updated by Hammel almost 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 70 to 100

Done. All changes committed and pushed.

Closing issue.

#8 Updated by Hammel almost 4 years ago

One additional note:

I swapped out all the ModMyPi dongles with the various Panda wifi dongles and things got much better. I also moved the RPI2 away from its USB hub just a bit. Maybe that's what I really needed: better dongles and less interference from the Pi.

Also available in: Atom PDF