This may affect any users using piaware in a country that allows WiFi channels above 11.
Out-of-the-box, piaware 3.5.0 supports WiFi Channels 1-11.
The reason this is a problem is that WiFi routers are often set to automatically pick a channel, and so that could be any legal channel (1-13 in the UK). If it happens to pick 12 or 13, your Pi fails to connect. I spent many, many hours getting to the root cause and solving it.
Some of the solutions I found talked about updating the operating system and firmware but I didn’t need to do that.
All that is necessary was to correctly set the WiFi Region (GB in my case). After doing that, sudo iwlist wlan0 channel will report Ch1-13.
Setting WiFi region in raspi-config seems the logical way to do it, but that didn’t work for me. I think that action creates a wpa_supplicant.conf with REGION=GB but I suspect that when a wpa-roam config is present, wpa_supplicant is ignored.
The solution for me was:
sudo iw reg set GB
That instantly got ch 12 and 13 to appear and my Pi to connect.
It doesn’t survive a reboot so I then added that command (without needing sudo) to /etc/rc.local and it’s now connecting reliable every time on any channel.