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
Illogical WiFi configuration in openhabian-config #1693
Comments
I forgot to mention that the reason this isn't a problem the first time you run |
@Nadahar if you could come up with a PR I would merge it but I don't have the time to cope with it Just provide the code don't bother with signing etc I'll do. |
Given networking setup changed a lot in bookworm, I've removed the WiFi setup options from the menu for now. Anyone feel free to contribute a PR to re-add them. |
Does that mean that we must prevent openhabian from updating or things will break, or does it only concern new installations? |
I don't understand your question. I've only removed the options why would that break anything. You will only get bookworm on fresh installs. |
Ok, that's basically what I needed to know.
I'm dealing with so many different systems, and it's been a long time since I did the openhabian setup now, so I simply don't remember how it works. What I do remember is that some things openhabian "leave alone", while other things get overwritten by scripts or something (like my SMB shares that keep breaking/getting their permissions removed). Since I don't have any overview of what is what, I just wanted to know if I needed to take special care to prevent Wi-Fi from breaking or not, without having to dive into all the details right now. |
Issue information:
Something is "off" with the logic regarding the WiFi configuration. The
Disable WiFi
option will run:openhabian/functions/wifi.bash
Lines 105 to 115 in 5a5110e
...which will call
enable_disable_wifi()
here:openhabian/functions/helpers.bash
Lines 114 to 132 in 5a5110e
This will (physically) disabled the onboard WiFi adapter in the Raspberry Pi as far as I can understand. I assume it will do nothing to WiFi dongles..? If so, it should probably be named a little differently, to make sure it is clear that this is about the onboard WiFi.
After rebooting, as instructed to,
wlan0
is gone and all is well in that sense. But, the WiFi configuration in/etc/wpa_supplicant/wpa_supplicant.conf
is left untouched, still containing the SSID and PSK from the previous configuration if it was previously configured. I would assume this means that WiFi dongles would continue to work even after a reboot.Now comes the problem. If you enter
openhabian-config
again, theSystem Settings
under 37 are still the same. You can choose betweenWiFi setup
andDisable WiFi
, although both these options will fail. It's not possible to disable the (onboard) WiFi adapter, since it already is disabled. The option won't complain, it will actually falsely assert that WiFi is still enabled:...it will then continue to pretend to do something and ask you to reboot.
The other option
WiFi setup
is more troubling though, as it will present you with this error:...which doesn't actually tell you anything about "what is going on". A further look at the script will reveal what really happens:
openhabian/functions/wifi.bash
Lines 35 to 104 in 5a5110e
This is where the "lacking" logic all comes together to make everything very confusing. The "WiFi setup" actually starts by enabling the (onboard) WiFi adapter. But it doesn't stop and ask for a reboot if the adapter really is disabled in
/boot/config.txt
. Thus, the next steps will fail, specifically this part:openhabian/functions/wifi.bash
Lines 58 to 70 in 5a5110e
What has actually happened is that the (onboard) WiFi adapter has been enabled, and if you reboot and then enter
openhabian-config
and runWiFi setup
again it will actually work. But, the way to get there is highly illogical and confusing.Suggested fix
I really don't know bash scripting, so I would probably spend a lot of time trying to get something working put together. But, since your EULA/DCO is impossible for me to comply with, this would be futile to attempt anyway. I'm therefore going to try to explain what I think should be done instead.
I think making this logical would require:
Enable onboard WiFi
orDisable onboard WiFi
accordingly. Devices without onboard WiFi shouldn't have this option at all.WiFi setup
would suffice - that instead of entering a SSID there would be a way to chose "clear configuration" or similar. This option should make/etc/wpa_supplicant/wpa_supplicant.conf
be in a "default" state with no SSID/PSK configured.System information:
OpenHABian 1.7.3 on a Raspberry Pi 4.
The text was updated successfully, but these errors were encountered: