-
Notifications
You must be signed in to change notification settings - Fork 1k
can_be_sta_and_ap() regexp fails on Raspi3 #203
Comments
Here is a suggested fix for multiple SSID support detection in can_be_sta_and_ap().
by
Hope this helps. |
How would you test this fix? Can you please prepare a PR so we can test it on our own real quick? |
Done. Hopefully it should not break detection for already working wifi adapters, and probably help support new ones by default... |
I think it still does not work for me. I've just installed create_ap and patched line myself. This is the output i get:
|
from the command line, can you let me know the output of: |
It reports nothing.
|
empty report is indeed what is expected in that case. |
properly chained the return code now. Now on Raspi3 (and others wifi interfaces not supporting multiple SSID), you should see the following warning that was missed before if you did not specify |
Actually, error in your case seems to come-up from nl80211 driver inside hostapd, probably not an issue with create_ap capability detection (my bad). I assume you may be running hostapd v2.3. |
Actually, looking at this, some crafted a setup that works (AP and client on Raspi3). Unsure I do not have Raspi3 handy to test at this point, but seems an interesting track... |
Why did you close your PR? |
I closed the PR because I think it does not address the issue the proper way. At this time I do not think it is a matter of improper detection of AP & Client capability. We now need to find the proper reason why |
My raspi is currently not connected to any AP, but I've tried the command anyways:
|
I'm getting out of suggestions for now... |
Probably something else is going on with rpi3. My Intel adapter has the following interface combinations and it can have an AP with passphrase while I'm connected to another AP.
|
Thanks @oblique for your feedback on this. Back to rpi3, looking at this method, do you see any meaningful setting that may be different from what |
The method of the link is the same. I need to get a new nanosd to try it on my PI. I dig a bit in the kernel and it looks like the Back to the PI, can you try the Ruby implementation if it works?
PS: Ruby implementation is not finished yet. I may change many things. |
Can't look at it currently as I do not have rpi3 with me. Also noticed |
I got new sdcard and found what is wrong with RPi3. The combinations are correct and adapter supports virtual interfaces. The problem is in the Broadcom drivers, this is what I found:
So, as a conclusion the best solution is to never use virtual interface with RPi3. If a user really wants virtual interface with RPi3 he/she must use the above commands and keep in mind that RPi3 will misbehave. |
I'm not sure how What are your suggestions? |
Thanks a lot for this in-depth analysis and workaround suggestions ! As for |
I can do the change on shell script as well, since I do it with only 2-3 lines and yes I will print a warning with a link to this issue. We can report this to the author of the driver, but first I prefer to get the crash dump of the kernel panic just to make sure that it crashes within the driver. |
Does the fix mean that --no-virt is automatically applied now? Thanks for looking into the issue! If that all works, you should consider to tag (and sign) a new release ;) |
New release is ready. Yes you can use another adapter, but it looks like I need to do some |
Sorry, forgot to delete the new iptables rule on cleanup. New release again. |
Last thing, is |
In ruby implementation will handle it. In Bash implementation it can only use only one channel. |
Why is that? Is there another way to kill it more softly? |
No, it's a bug in the driver. It needs to be fixed there. |
noted this brcmfmac: Change stop_ap sequence: don't have pi3 with me to test if referenced kernels with updated driver "naturally" fixes this issue, and does not need the automatic --novirt anymore. |
"ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time" , how can solve it, thansks. |
Would be nice to check if updated firmware being in final testing fixes this issue (do not have one handy to test unfortunately). |
@macmpi I got the new driver running on my rpi3 how should I test it? |
But devices can't connect, I'll try out the ruby branch |
edit: It seems it doesn't support channel 9 changing router to 6.. BRB |
Nope didn't work either
|
i can not change the password |
I tested the RaspberryPi forums script/configuration and I confirm that it works flawlessly; I am using the same hardware but on a different board, kernel 5.8.16. Always make sure that your |
Hi,
As 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:Failed to create interface mon.ap0: -95 (Operation not supported)
Indeed, in absence of
--no-virt
directive,create_ap
script is trying to detect virtual interface support for particular wifi interface, and setsNO_VIRT
flag accordingly.This detection fails with rpi3 built-in interface, hence
NO_VIRT
is incorrect, and execution fails if--no-virt
directive is not previously set.Looking at this discussion about multiple SSID support and create_ap code, it turns out that
can_be_sta_and_ap()
may not properly process relevant info on raspi3.For reference,
iw list
(oriw phy phy0 info
) on raspi3 gives relevant info as:which according to the aforementioned article and AP<=1 should indeed return 1 from can_be_sta_and_ap() (
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).I'm not an expert in regexp, so I won't propose a fix myself, but one may want to look into that.
Now, 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.It's surprising as that raspi3 chip does not support virtual interface as we saw.
Unless I'm missing something, virtual interface availability is probably independent of the AP security mechanism (passphrase or not).
While 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.
Interested in any feedback.
The text was updated successfully, but these errors were encountered: