Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network: Add wifi hybrid mode #766

Open
fnoop opened this issue May 1, 2018 · 15 comments
Open

Network: Add wifi hybrid mode #766

fnoop opened this issue May 1, 2018 · 15 comments
Assignees
Milestone

Comments

@fnoop
Copy link
Member

fnoop commented May 1, 2018

Add a filesystem/SD file flag to boot the system into AP mode. This is useful if normal wifi or network configuration fails for any reason, and particularly useful in the field.

@fnoop
Copy link
Member Author

fnoop commented May 30, 2018

Add a simultaneous managed/AP option, set by default on raspberry

@fnoop fnoop changed the title Add wifi AP rescue mode Network: Add wifi AP rescue mode May 30, 2018
@fnoop
Copy link
Member Author

fnoop commented May 30, 2018

@fnoop fnoop changed the title Network: Add wifi AP rescue mode Network: Add wifi hybrid mode May 31, 2018
@fnoop
Copy link
Member Author

fnoop commented May 31, 2018

Current wireless modes are managed, monitor and ap. Add a hybrid mode which simultaneously provides managed and ap, and set it by default on sample-nodes (download images) where possible.

@fnoop
Copy link
Member Author

fnoop commented May 31, 2018

Using the raspberry guides involves using udev rules and mac addresses. This is not feasible for distributed images as the mac address is unknown on user systems. Move the config up the stack.

@fnoop
Copy link
Member Author

fnoop commented May 31, 2018

iw phy phy0 interface add wlanap0 type __ap
This produces a 'rename3' interface: 3: rename3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000

@fnoop
Copy link
Member Author

fnoop commented May 31, 2018

Can use canonical interface name instead of physical:
sudo iw dev wlan0 interface add test1 type __ap

The interface then gets renamed immediately:
May 31 21:40:15 maverick-up kernel: [14008.805210] brcmfmac mmc1:0001:1 rename6: renamed from test1

@fnoop fnoop self-assigned this May 31, 2018
@fnoop fnoop added this to the 2.0 milestone May 31, 2018
@fnoop
Copy link
Member Author

fnoop commented May 18, 2019

iw list shows combinations available for an interface (eg. for rpi3):

valid interface combinations:
		 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
		   total <= 3, #channels <= 2
		 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
		   total <= 4, #channels <= 1

Need to programatically obtain this list in a python structure so we can expose in -api and start to make decisions and present to the user. Parsing iwlist output is not ideal, try and find better underlying source of data.

@fnoop
Copy link
Member Author

fnoop commented May 20, 2019

Control with python. Need to figure out:

  • How to determine which interfaces are capable of what combinations
  • How to add virtual interfaces
  • How to add virtuals in correct order for useable hybrid mode

@fnoop
Copy link
Member Author

fnoop commented May 20, 2019

Wireless tools provide iwconfig, iwlist etc. Different packages:

  • iw (eventual replacement for wireless-tools)
  • wireless-tools (iwlist, iwconfig)
  • libiw30 (underlying wireless tools library)
  • libiw-dev (dev tools for wireless-tools)

Python:

  • iwlib

@fnoop
Copy link
Member Author

fnoop commented May 20, 2019

python iwlib doesn't provide anything about combinations. Need to look at the source code for iwlist, and then code it into a new python library.
https://github.com/nathan-hoad/python-iwlib/blob/master/iwlib/_iwlib_build.py
As a quick hack to start with, we can just parse iwlist

@fnoop
Copy link
Member Author

fnoop commented May 20, 2019

PyRIC contains the mechanisms necessary to extract combinations without any other 3rdparty support, but not the code to do so yet. It's probably the best way long term.

@fnoop
Copy link
Member Author

fnoop commented May 20, 2019

Add 'iw' package to support parsing 'iw list'.

@fnoop
Copy link
Member Author

fnoop commented May 22, 2019

Near impossible to parse iw output, notwithstanding warning from iw: Do NOT screenscrape this tool, we don't consider its output stable.

Instead, use netlink/pyric to extract the combinations in a proper python structure:
wraith-wireless/PyRIC#48

@fnoop
Copy link
Member Author

fnoop commented May 24, 2019

Can't get it to work with rpi3. Have to start with managed interface first, then add an AP. Interfaces are created, but don't seem to be useable although the AP shows up in other devices.
https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=138730&sid=af012818635ca579a0b0c609ad61e31b&start=150

@fnoop fnoop modified the milestones: 2.0, 2.0-beta Aug 10, 2019
@fnoop fnoop modified the milestones: 2.0-beta, 1.2 Jan 21, 2020
@fnoop fnoop modified the milestones: 1.2, 1.3 Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant