-
Notifications
You must be signed in to change notification settings - Fork 369
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
raspi-config breaks octopi-wpa-supplicant.txt link to wpa_supplicant.conf #336
Comments
It turns out to be a subtle problem in However, it'll probably take quite a while before my PR is merged and propagated all the way to next OctoPi release. I'm open to options of a short-term fix. |
Meh. How about checking on boot (via a service file) if the symlink exists and if not a) repeating the |
I'm not confident about re-establishing the symlink. To do so we need to choose one between It looks like RPi-Distro team was quick in merging my PR. At this moment I'd say just wait until the PR makes it way into next Jessie release. Meanwhile the users can work around the problem by not using |
I think the chances for this are pretty slim though considering that
The problem with that though is that unless a user actively updates their version of The problem here is communication - yes, users can easily work around this, but if they forget it or just don't read (and the latter is way more common than you'd think) they will run into this. So personally I'd rather find a way to work around this issue that doesn't require knowledge and action (or specific in-action) on the user's part. |
Sorry for the topic drift, but I have to say it's impressive watching you guys work this out (even though much of it goes over my head). I appreciate all of the effort you put in to making OctoPi what it is. |
Totally agreed @foosel on ensuring we sufficiently communicate the problem to users. Regarding a new service to fix this problem: are you suggesting:
|
Nope. I'm suggesting
That way any modifications to the txt file persist. There should hopefully be none but the change of the WiFi country in the conf since the user will most likely have rebooted directly after doing this. |
Sorry for the formatting mess, I'm on mobile and the mobile version of Github is a PITA... |
My instinct says doing something that complicated just to patch up a problem with simple root cause is overkill. Meanwhile I don't have a good alternative... I'm very tied up these days. Will get back to it as soon as I get a chance. When is the latest time to get a PR in to fix this issue? @foosel |
IMHO it's not THAT complicated - just compared to the actual solution to the problem it tries to workaround it appears completely overkill. But well, what can you do... you should see some things I did in OctoPrint to get around problems ;) Detecting your pip parameters for example - needs to be done by installing a dummy package and have it write some stuff to a temporary file whose path is injected through an environment variable because modern pip versions swallow all output from a running setup.py and the only way to determine certain things about a pip environment is by running inside it, so.... horribly convoluted :) Anyhow... I don't know about @guysoft 's thoughts on this, personally I'd say with a release like this give people at least a week with an RC, better more. RC1 was released last friday. I can see if I can take a shot at the service thing tomorrow or the day after if that helps. |
Thanks a lot @foosel I may be freed up a bit next week. Let me know when/if you want me to take a stab at it. |
Included script will make sure that if wpa_supplicant.conf is no longer a symlink but it and /boot/octopi-wpa-supplicant.txt exist, the selected wifi country will be extracted and written to /boot/octopi-wpa-supplicant.txt and then the symlink will be recreated. If wpa_supplicant.conf is completely gone, only the symlink will be recreated. Nothing will be done if /boot/octopi-wpa-supplicant.txt does not exist. The service file ensures that this check is done on every boot, after the local file system becomes available but before the networking gets initialized. This should solve guysoft#336 Note that this requires systemd (Debian Jessie) - since current Raspbian starts SysV init scripts only after networking has started to initialized, it was impossible for me to create a SysV init script that fixes the symlink prior to network initialization.
Whipped something up, see PR #337 |
Pulled, I can't built a nightly though because there is no internet the past two days in my apartment (in the works, we think an insane thunderstorm is the culprit), so it will wait and then I will make an RC2. |
Thanks @foosel for your excellent work! |
Fixed in 0.14, will keep an eye on removing it when the fix goes in to official Rpi-foudation release. |
@guysoft I'm curious: did Rpi-foundation ever fix this in their release? Perhaps when Raspian Stretch came out? |
Thanks, Guy. I would not have had the vaguest idea of where to look for this. (I also would not have recognized what was going on in the code shown in the screenshot, had I not followed some of the discussion. Beyond my knowledge level.) |
So, are the changes made in this PR not necessary anymore? I wonder if it would be sensible to remove them in order to not have unnecessary code in the repo gumming up the works? It would help people like me not chase ghosts :) |
@nbelakovski - If I followed things correctly, it's still needed in OctoPi 0.14, since that is based on Raspian Jessie-Lite. I may not be needed in OctoPi 0.15 when it comes out, since it appears Raspian Stretch has corrected the problem |
I can build a nightly, but wont have time to test. If anyone volunteers to test then ill do itit. |
Happy to test it out, if you want. Seeing as I was the one to stumble across the issue in the first place. It will be a few days before I can get to it. I'm away from home now. Just let me know when it's up, and which version I should test. |
@guysoft did you already undo the changes referenced a few posts up by nbelakovski? I have not tested any of the nightlies, because I don't know how to tell which one has the change. |
@guysoft - That's the one. I thought that was what you were referring to when you said "I can build a nightly, but wont have time to test. If anyone volunteers to test then ill do it" a few posts up. The original problem was fairly obscure. It only happened when someone tried to change the WiFi Country setting via Raspi-config. At one point, I tested a whole bunch of other Raspi-config options, but never found anything else that caused the problem. I have no idea if there are things outside of raspi-config that could also cause the problem. I've never heard of one. I'm perfectly happy to test whether raspi-config in Raspian Stretch causes a problem. Going beyond raspi-config testing (if any other testing is desired) is probably beyond me. I'm just a user who is good at breaking things, not a programmer. |
Sure, go ahead. You'll need to manually revert this in CustomPiOS though I think. |
…merged, also see talk in guysoft/OctoPi#336
Reverted, wait for next nightly to test |
Nightly build: https://storage.googleapis.com/octoprint/2018-03-02_2017-11-29-octopi-stretch-lite-0.15.0.zip |
Just tested. Using raspi-config to change WiFi Country no longer breaks the link between octopi-wpa-supplicant.txt and wpa_supplicant.conf |
Yay |
I experienced an issue where the information in /boot/octopi-wpa-supplicant.txt stops updating the network information in /etc/wpa_supplicant/wpa_supplicant.conf. I experienced this in OctoPi 0.14rc1. I have not tried it in version 0.13.
When working normally, issuing
ls -l /etc/wpa_supplicant/
yields (among other things):
lrwxrwxrwx 1 root root 21 Jul 27 2016 wpa_supplicant.conf -> /boot/octopi-wpa-supplicant.txt
When I run sudo raspi-config > localisation > Change WiFi Country > US , then select "finish", raspi-config prompts me to reboot. (I selected yes) After this the wpa_supplicant.conf file stops getting updated when /boot/octopi-wpa-supplicant.txt is edited.
The output from
ls -l /etc/wpa_supplicant/
changes to:-rwxr-xr-x 1 root root 619 Apr 1 22:58 wpa_supplicant.conf
. [Note: per conversation with K. Jiang, the link is broken even before the Pi reboots after editing WiFi Country.]From further poking around, I discovered that using raspi-config to change the localisation Time Zone, does not break the link. When changing the time zone, Raspi-config does not prompt you to reboot, it just exits when you click finish. Manually rebooting after this also does not break the link.
I've not done enough testing to know if the break is specific only to setting the WiFi Country, or if there are other settings in Raspi-config that might cause a break.
The text was updated successfully, but these errors were encountered: