guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.49k stars 369 forks source link

wpa_supplicant works if called manually but not automatically on boot #720

Closed mnesarco closed 3 years ago

mnesarco commented 3 years ago

What were you doing?

Installing OctoPi on RaspBerryPi 3B Rev 1.2

  1. Image flashed onto micro sd
  2. /boot/octopi-wpa-supplicant.txt edited with correct network and country
  3. Boot with HDMI monitor and keyboard
  4. Wifi is not working so
  5. I did:
    sudo killall wpa_supplicant
    sudo wpa-supplicant -c/boot/octopi-wpa-supplicant.txt -Dwext -iwlan0
  6. After that, WIFI works as expected
  7. But after restart it didn't work untill I repeat step 4 manually

What did you expect to happen?

I want to use the PI in headless mode, so i need it to connect to wifi automatically

What happened instead?

It requires manual commands:

sudo killall wpa_supplicant
sudo wpa-supplicant -c/boot/octopi-wpa-supplicant.txt -Dwext -iwlan0

Did the same happen when running OctoPrint in safe mode?

I have not tested in safe mode, but i have a vanilla installation.

Version of OctoPi

octopi-buster-armhf-lite-0.18.0.zip

Printer model & used firmware incl. version

Tronxy XY2-pro, but it is irrelevant to the wifi problem.

Screenshot(s)/video(s) showing the problem:

I have read the FAQ.

trajesus commented 3 years ago

Issue #717 already says that wpa-supplicant may not be working correctly. It wasn't working for me either and that solved it. Try it as it could solve your case too 👍 (replacing wlx8cae4cf876bc in the command by the name of your interface which seems to be wlan0)

mnesarco commented 3 years ago

Thank you, I will try it, but I am not using an external USB dongle.

trajesus commented 3 years ago

I think it should work even if you are not using a dongle. You just need to run both commands described in the issue I mentioned (with the correct interface name) and reboot.

mnesarco commented 3 years ago

It is very strange. It didn't work with the cron workaround, but it still works if done manually. I have double checked the cron job.

mnesarco commented 3 years ago

I have solved it with a different approach. I just copied the modified /boot/octopi-wpa-supplicant.txt to /boot/wpa_supplicant.conf and it works, without any cron job.

https://www.raspberrypi.org/documentation/configuration/wireless/headless.md