Wifi trouble with new image on Pi W 2

I am having problems with a brand new image of Octopi on a new Raspberry Pi W 2 connecting to my Wifi network. When I first boot the Pi, it does not connect to my Wifi network, and when I log in with another method (UART or HDMI and Keyboard), I can still not connect to the network.

I have tried new images, all OctoPi 0.18.0, and OctoPrint from 1.7.3, 1.7.2, and 1.7.1. I've burned the images using Raspberry Pi Imager and BalenaEtcher.

To setup the wireless connection, I've tried many different methods.

  • The method was to setup the octopi-wpa-supplicant.txt with the ssid, psk, and country code under the WPA/WPA2 network area. I used Notepad++ and made sure all the line endings were all LF, no CRs in sight. I've also done this many times on fresh images, so a typo is very unlikely.
  • The second method I tried was to use the Raspberry Pi Imager to set the network settings. I noticed that uses a "first boot" script. I'm not sure if this is supported by the Octopi, but it didn't work anyway...
  • The third method is to use the raspi-config method of setting the ssid and psk. When I do this, I can check that I still do not have an ip address using "ifconfig".

I have checked the file "/etc/wpa_supplicant/wpa_supplicant.conf" to check that the correct ssid and psk were copied, and they are correct (let me know if you want to see this, but it is the standard basic file).

running sudo wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0 gives me the error "ctrl_iface exists and seems to be in use", if I remove the /var/run/wpa_supplicant/wlan0 file, I get "n180211: kernel reports: Match already configured" many times, then "Failed to create interface p2p-dev-wlan0: -16 (Device or resource busy)"

Also, when i run sudo iwlist wlan0 scan | grep ESSID, I can see my SSID with the best signal.

What I think is the weirdest thing about this problem is that when I try using the latest Raspian Lite image, i set up the wpa_supplicant.conf in the boot partition and everything works fine! I have tried setting up Octopi and Octoprint manually, but I came up against some other unrelated problems that I would like to avoid.

Any help would be appreciated. Has anyone else had this problem? I don't understand what I could be doing since it is a brand new image every time.


Just to be sure - when you set the wifi credentials via the pi imager you didn't touch the username, right?

Nope, the username stays "pi" and I am also keeping the hostname "octopi"