{"action":"created","issue":{"url":"https://api.github.com/repos/oblique/create_ap/issues/203","repository_url":"https://api.github.com/repos/oblique/create_ap","labels_url":"https://api.github.com/repos/oblique/create_ap/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/oblique/create_ap/issues/203/comments","events_url":"https://api.github.com/repos/oblique/create_ap/issues/203/events","html_url":"https://github.com/oblique/create_ap/issues/203","id":184817772,"number":203,"title":"can_be_sta_and_ap() regexp fails on Raspi3","user":{"login":"macmpi","id":16296055,"avatar_url":"https://avatars.githubusercontent.com/u/16296055?v=3","gravatar_id":"","url":"https://api.github.com/users/macmpi","html_url":"https://github.com/macmpi","followers_url":"https://api.github.com/users/macmpi/followers","following_url":"https://api.github.com/users/macmpi/following{/other_user}","gists_url":"https://api.github.com/users/macmpi/gists{/gist_id}","starred_url":"https://api.github.com/users/macmpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macmpi/subscriptions","organizations_url":"https://api.github.com/users/macmpi/orgs","repos_url":"https://api.github.com/users/macmpi/repos","events_url":"https://api.github.com/users/macmpi/events{/privacy}","received_events_url":"https://api.github.com/users/macmpi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":31,"created_at":"2016-10-24T11:42:37Z","updated_at":"2017-02-08T19:13:40Z","closed_at":"2016-11-26T17:50:26Z","body":"Hi,\r\n\r\nAs reported here in few instances (issues #185 and #187 ), setting-up a passphrase-enabled AP with Raspberry Pi 3 fails if `--no-virt` is not set. Failure comes with an error message:\r\n`Failed to create interface mon.ap0: -95 (Operation not supported)\r\n`\r\nIndeed, in absence of `--no-virt` directive, `create_ap` script is trying to detect virtual interface support for particular wifi interface, and sets `NO_VIRT` flag accordingly.\r\nThis detection fails with rpi3 built-in interface, hence `NO_VIRT` is incorrect, and execution fails if `--no-virt` directive is not previously set.\r\n\r\nLooking at [this discussion about multiple SSID support](http://wiki.stocksy.co.uk/wiki/Multiple_SSIDs_with_hostapd)  and create_ap code, it turns out that `can_be_sta_and_ap()` may not properly process relevant info on raspi3.\r\nFor reference, `iw list` (or `iw phy phy0 info`) on raspi3 gives relevant info as:\r\n\r\n```\r\n    valid interface combinations:\r\n          * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,\r\n            total <= 3, #channels <= 2\r\n          * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,\r\n            total <= 4, #channels <= 1\r\n\r\n```\r\n\r\nwhich according to the aforementioned article and AP<=1 **should indeed return 1 from**  [can_be_sta_and_ap()](https://github.com/oblique/create_ap/blob/master/create_ap#L279) (`NO_VIRT=1`), as this wifi chip can not support virtual interface (value of AP section should be at least 2 to support virtual interfaces).\r\nI'm not an expert in regexp, so I won't propose a fix myself, but one may want to look into that.\r\n\r\nNow, there might be another logic bug somewhere, as in current state (with regexp issue), setting hotspot with no password works on raspi3, even omitting `--no-virt` option: no error like in passphrase situation.\r\nIt's surprising as that raspi3 chip does not support virtual interface as we saw.\r\nUnless I'm missing something, virtual interface availability is probably independent of the AP security mechanism (passphrase or not).\r\nWhile this second issue will be hidden if NO_VIRT is properly set with eventual regexp fix, there might be something to look at here too.\r\n\r\nInterested in any feedback.\r\n"},"comment":{"url":"https://api.github.com/repos/oblique/create_ap/issues/comments/278431019","html_url":"https://github.com/oblique/create_ap/issues/203#issuecomment-278431019","issue_url":"https://api.github.com/repos/oblique/create_ap/issues/203","id":278431019,"user":{"login":"oblique","id":194040,"avatar_url":"https://avatars.githubusercontent.com/u/194040?v=3","gravatar_id":"","url":"https://api.github.com/users/oblique","html_url":"https://github.com/oblique","followers_url":"https://api.github.com/users/oblique/followers","following_url":"https://api.github.com/users/oblique/following{/other_user}","gists_url":"https://api.github.com/users/oblique/gists{/gist_id}","starred_url":"https://api.github.com/users/oblique/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oblique/subscriptions","organizations_url":"https://api.github.com/users/oblique/orgs","repos_url":"https://api.github.com/users/oblique/repos","events_url":"https://api.github.com/users/oblique/events{/privacy}","received_events_url":"https://api.github.com/users/oblique/received_events","type":"User","site_admin":false},"created_at":"2017-02-08T19:13:40Z","updated_at":"2017-02-08T19:13:40Z","body":"No, it's a bug in the driver. It needs to be fixed there."}}
{"actor":{"display_login":"oblique"}}