Skip to content
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

Changing Wifi network not possible #134

Closed
MaikelKelder opened this issue Aug 8, 2022 · 10 comments · Fixed by #142
Closed

Changing Wifi network not possible #134

MaikelKelder opened this issue Aug 8, 2022 · 10 comments · Fixed by #142
Assignees
Labels
bug Something isn't working

Comments

@MaikelKelder
Copy link

What happened

After the initial setup and filled in Wifi SSID and password, logon is succesful after the installation.
Yet, changing to another WiFI SSID doesnt seem to work, not by file edit, not by klipperscreen.

By klipperscreen you see that he initiates Wifi, but it will never connect to new network.

What did you expect to happen

Joining other WIfi network after entering SSID and password, manual file edit, OR by klipperscreen.

How to reproduce

Change Wifi by file editting or klipperscreen.

Additional information

I dont have expertise in Mainsail, yet found this to possible bug, I hope to help in this way and that my foundings are correct.

@MaikelKelder MaikelKelder added the bug Something isn't working label Aug 8, 2022
@KwadFan KwadFan self-assigned this Aug 12, 2022
@KwadFan
Copy link
Member

KwadFan commented Aug 13, 2022

Hey, we try to reproduce that this weekend.

Did you flash the Image with rpi-imager and set wifi credentials on setup?

@MaikelKelder
Copy link
Author

MaikelKelder commented Aug 13, 2022 via email

@KwadFan
Copy link
Member

KwadFan commented Aug 13, 2022

So, after flash you edited the mainsailos-wpa-supplicant.txt and it doesnt work.
What do you mean by "WiFi works after setup in pi." exactly?
I have to reproduce the steps as nearly I could, so I need an exact description what you have done.

What editor was used to edit the file?

Regards

@MaikelKelder
Copy link
Author

MaikelKelder commented Aug 13, 2022 via email

@KwadFan
Copy link
Member

KwadFan commented Aug 13, 2022

To my sadness we can confirm it, but I need some time to investigate the root cause.

I will provide a solution as soon it is fixed for existing installations.

Sorry for the hazzle.

@MaikelKelder
Copy link
Author

MaikelKelder commented Aug 13, 2022 via email

@KwadFan
Copy link
Member

KwadFan commented Aug 14, 2022

I did some investigation,
In rpi-imager the softlink that points to the mainsailos-wpa-supplicant.txt, which is created by CustomPIOS ( the framework used to manipulate the base image) gets overwritten and does not work as intended anymore.

I have to do a test with balena also.

At this poitn I have no clue how to solve that easily but will provide a solution asap.

@KwadFan
Copy link
Member

KwadFan commented Aug 14, 2022

Hey @MaikelKelder,

It seems thats not our fault. I found the following in the Raspberry PI OS docs.
You will need to define a wpa_supplicant.conf file for your particular wireless network. Put this file onto the boot folder of the SD card. When the Raspberry Pi boots for the first time, it will copy that file into the correct location in the Linux root file system and use those settings to start up wireless networking.

https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-networking-2

I think they internally changed the behavior that leads to a behavior that CustomPIOS try to change with its "network module"
This changes from a real file "wpa_supplicant.conf" to a symlink to /boot/mainsail-wpa-supplicant.txt.

But this symlink gets overwritten if you try to change WiFi Settings with raspi-config and maybe ( I cant confirm that ) by KlipperScreen. Also it will be overwritten if you use rpi-imager to setup your WiFi and brake the existing symlink to the known txt file.

This is reproducable because normally it changes your clear text password in the txt file in /boot to an psk hash, but that dont happen either.

Could you maybe confirm that a wpa_supplicant.conf in boot do work?

Regards

@MaikelKelder
Copy link
Author

MaikelKelder commented Aug 14, 2022 via email

Arksine referenced this issue in Arksine/moonraker Aug 15, 2022
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
@KwadFan
Copy link
Member

KwadFan commented Aug 23, 2022

After some further digging it turns out that wpa_cli is the guilty one.
KlipperScreen uses wpa_cli to set WiFi settings, however wpa_cli overrides our softlink to /boot/mainsail-wpa-supplicant.txt.

I am working on a solution, but I think it will end up in making an example file and you have to put a wpa_supplicant.conf to /boot.

This is the mentioned way of Raspberry Foundation.

KwadFan added a commit that referenced this issue Aug 27, 2022
This is more a workaround as a fix.
Raspberry Foundation changed handling of wpa_supplicant.conf.

Also KlipperScreen uses wpa_cli which overrides softlink to txt.

fixes #134

Signed-off-by: Stephan Wendel <me@stephanwe.de>
KwadFan added a commit that referenced this issue Sep 1, 2022
This is more a workaround as a fix.
Raspberry Foundation changed handling of wpa_supplicant.conf.

Also KlipperScreen uses wpa_cli which overrides softlink to txt.

fixes #134

Signed-off-by: Stephan Wendel <me@stephanwe.de>

Signed-off-by: Stephan Wendel <me@stephanwe.de>
MSzturc pushed a commit to MSzturc/THEOS that referenced this issue Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants