I'm experiencing the same problem connecting to my WiFi network with OctoPi.
Nothing i have tried worked!
I have raspberry pi 3 b+ and i am using it for more than 6 months and i know for sure the WiFi is working properly.
However when i try to connect from OctoPi It just wont work.
Mind that i have flushed multiple times back and forth from OctoPi and official raspbian OS.
On raspbian OS the WiFi works perfectly and connects immediately as i configure the wlan0 settings with my ssid and password.
However when i flush the OS to OctoPi it wont work no matter what i do.
I tried upgrading OctoPI's OS, I tried not upgrading, tried 2 different USB WiFi adapters.
I have even tried disabling the encryption my WiFI router i even tried several different inscription combinations.
Not to mention all the possible configurations of the config files.
It just wont connect, i have spent the last 2+ days trying to make it work.
I even tried to create a hot spot using my galaxy S7 and noting.
OctoPi just wont connect...
The most frustrating thing is that i can see mine and others network ssid when scanning with iwlist wlan0 scan
and when i flush the OS to something else it will connect with no problems.
I'm beginning to think there is an inherent problem with OctoPi it self.
Connecting the raspberry directly to the router works fine by the way, its only the WiFi that wont connect.
Any ideas on how to fix it?