{"action":"opened","issue":{"url":"https://api.github.com/repos/billz/raspap-webgui/issues/77","repository_url":"https://api.github.com/repos/billz/raspap-webgui","labels_url":"https://api.github.com/repos/billz/raspap-webgui/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/billz/raspap-webgui/issues/77/comments","events_url":"https://api.github.com/repos/billz/raspap-webgui/issues/77/events","html_url":"https://github.com/billz/raspap-webgui/issues/77","id":231136811,"number":77,"title":"rPI Zero W needs AP on same channel as client wifi","user":{"login":"andyjbm","id":3707689,"avatar_url":"https://avatars3.githubusercontent.com/u/3707689?v=3","gravatar_id":"","url":"https://api.github.com/users/andyjbm","html_url":"https://github.com/andyjbm","followers_url":"https://api.github.com/users/andyjbm/followers","following_url":"https://api.github.com/users/andyjbm/following{/other_user}","gists_url":"https://api.github.com/users/andyjbm/gists{/gist_id}","starred_url":"https://api.github.com/users/andyjbm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyjbm/subscriptions","organizations_url":"https://api.github.com/users/andyjbm/orgs","repos_url":"https://api.github.com/users/andyjbm/repos","events_url":"https://api.github.com/users/andyjbm/events{/privacy}","received_events_url":"https://api.github.com/users/andyjbm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-24T18:51:04Z","updated_at":"2017-05-24T18:51:04Z","closed_at":null,"body":"It's possible to use a pi Zero W as an AP/Client using the on board wifi nic as both AP wlan and client wlan.\r\n\r\nThe setup is reasonable straightfoward ;-) requiring a few tweeks shown below but the reason for this issue is the problem that in this config (using onboard wifi for both AP and client) the wifi nic requires that the AP be on the same channel as the client it has connected to.\r\n\r\nSo a mod is needed to change the AP channel (in hostapd.conf) to that of the client when it connects to a client ssid... otherwise the whole wifi client and AP falls over.\r\n\r\nSo example tweeks as promised to get the shared nic setup working in the 1st place.\r\nThis uses wlan0 as the client facing interface and creates uap0 as the AP interface.\r\nYes I believe it only works this way round.\r\n\r\nThis in /etc/rc.local:\r\n```\r\n#Set up IP forwarding and NAT routing\r\nsudo echo 1 > /proc/sys/net/ipv4/ip_forward\r\nsudo iptables -t nat -A POSTROUTING -j MASQUERADE\r\n\r\n#Create the AP Interface:\r\nsudo iw dev wlan0 interface add uap0 type __ap\r\nsudo ip addr add 192.168.12.1/24 dev uap0\r\n\r\nsudo service hostapd restart\r\nsudo service dnsmasq restart\r\n```\r\n\r\nHere's an example /etc/network/interfaces:\r\n'''auto lo\r\nauto eth0\r\nauto wlan0\r\nauto wlan1\r\n\r\nauto uap0\r\n\r\niface lo inet loopback\r\niface eth0 inet dhcp\r\n\r\nallow-hotplug wlan0\r\nallow-hotplug wlan1\r\n\r\niface wlan0 inet dhcp\r\n    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf\r\n\r\niface uap0 inet static\r\n  address 192.168.12.1\r\n  netmask 255.255.255.0\r\n  network 192.168.12.0\r\n  broadcast 192.168.12.255\r\n  gateway 192.168.12.1\r\n'''\r\nand finally an example /etc/hostapd/hostapd.conf:\r\n'''\r\n# ctrl_interface=/var/run/hostapd\r\n# ctrl_interface_group=0\r\nbeacon_int=100\r\nauth_algs=1\r\nwpa_key_mgmt=WPA-PSK\r\nssid=raspi-webgui\r\nchannel=6\r\nhw_mode=g\r\nwpa_passphrase=ChangeMe\r\ninterface=uap0\r\nwpa=2\r\nwpa_key_mgmt=WPA-PSK\r\nwpa_pairwise=TKIP\r\nrsn_pairwise=CCMP\r\ncountry_code=GB\r\nhw_mode=g\r\n'''"}}
{"actor":{"display_login":"andyjbm"}}