-
Notifications
You must be signed in to change notification settings - Fork 76
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
Detect, record if wifi can be AP and suppress installing supporting files #3070
Conversation
@jvonau are the 1+6 mentions of "AP" in bold below extraneous — not offering any hope at all to enable AP mode? (as an example, apparently from a Kingdel PC) Paste below from file
Output below from command
...
...
...
...
(Above excerpts are from iiab-diagnostics http://sprunge.us/NMOYJl?en) |
Now what has been presented is a user configured WiFi network, given I shown you how to use NetworkManager's connection sharing on an XO-4 what in 2014-2015, running iiab-network would cause a clash over control of the wifi device causing the crash noted at |
#3057 (comment) won't support ap0, I'd would try with wifi_up_down: False.
Did this connection actually become active and working? That would be useful information to know. |
I would think none.
see https://wiki.gentoo.org/wiki/Hostapd & https://gist.github.com/Semant1ka/ee087c2bd1fbf6b0287c3307b8d4f291 |
@@ -101,6 +101,16 @@ | |||
set_fact: | |||
num_wifi_interfaces: "{{ count_wifi_interfaces.stdout|int }}" | |||
|
|||
- name: Check for Access Point capablility with 'iw list' | |||
command: iw list | grep -v AP: | grep AP | wc -l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes AP
appears in comments like the following — e.g. on a Raspberry Pi 4 Model B Rev 1.1 in this case:
root@box:~# iw list | grep -vn AP: | grep AP
21: * AP
164: * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
188: * [ 4WAY_HANDSHAKE_AP_PSK ]: AP mode PSK offload support
Should we... perhaps instead... grep for any string(s) * AP
that appear at the end of any lines?
(If the existence of at least one of these... is indeed the decider/clincher?)
command: iw list | grep -v AP: | grep AP | wc -l | |
command: iw list | grep '* AP$' | wc -l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 164 188 will not exist without line 21 and the test below is against an integer, what return value is provided without wc -l?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 164 188 will not exist without line 21
For sure, I agree.
I was just suggesting a failsafe — e.g. in case the string 'AP' mysteriously appears in comments arising from diverse/wonky WiFi cards in future?
Towards possibly making things even more resilient?
what return value is provided without wc -l?
I restored the wc -l
into the suggestion above a few minutes ago.
bash can do the counting, if counting's required, that works too.
Whereas another option is to avoid bash and have Ansible do the counting — e.g. using code like REGISTER_VAR.stdout_lines | length > 0
here:
iiab/roles/1-prep/tasks/hardware.yml
Lines 23 to 33 in db1531e
- name: "Look for any WiFi devices present: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5" | |
shell: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5 | |
register: wifi_devices | |
ignore_errors: True | |
changed_when: False | |
- name: "Set has_wifi_device: True, if output (from above) shows device(s) here: {{ wifi_devices.stdout_lines }}" | |
set_fact: | |
has_wifi_device: True | |
when: wifi_devices is defined and wifi_devices.stdout_lines | length > 0 | |
# when: wifi_devices is defined and wifi_devices.stdout | trim != "" |
Every year, lots of people make clear they want/need this! What test cases / HW / OS should be prioritized to smoke-test this PR? |
Shouldn't the PR number tell you the age? |
Found this while running ./iiab-network
|
Can you tell if there might have been some kind of a network glitch during firmware/tasks/download.yml — when it was trying to download http://d.iiab.io/packages/brcmfmac43455-sdio.bin_2021-11-30_minimal to (Did several of those 7 files possibly fail to download, if you can tell what happened?) |
Fixes bug:
hostapd restart error noted in #3057 (comment)
Untested