Intermittent or poor WiFi signal on the Raspberry Pi 4 / Pi 400 is usually caused by local conditions, your internet router configuration/bands or sometimes just older Raspberry Pi OS software.
Below are some of the common fixes to WiFi issues on the Pi4/Pi400:
There are two actions you can take to ensure you have up to date software and the latest packages to ensure WiFi is running at peak performance.
In a new terminal window, type the following commands to update Raspberry Pi OS:
sudo apt-get update
sudo apt-get upgrade
WiFi Chip Software Update
Again in a terminal, type the following commands to update the relevant software:
sudo apt update
sudo apt install firmware-brcm80211
Set your timezone/location
When you first set up a Raspberry Pi, sometimes you'll need to manually set the timezone/location to allow you to make a WiFi connection (even though the initial setup screens appear to set this for you).
In a terminal window type in 'sudo raspi-config', then 'Localisation Options' - then set your locale, timezone and WLAN country.
2.4GHz vs 5GHz
If you're seeing connection drop-outs or poor reception, it might be because your router is connecting via the 5GHz band. Whilst 5GHz offers greater speeds over 2.4GHz, it can't travel as far. Try disabling the 5GHz band in your router - if that clears up the problem then you then know it's a WiFi band issue.
Disable WiFi 'smart' switching
Some newer routers feature two WiFi bands - 2.4GHz and 5GHz - and many will automatically switch your device's connection between these bands in an attempt to help the connection/speed. This can sometimes cause issues, so when troubleshooting WiFi it can be useful to log in to your router and disable any smart-switching features (or disable the 5GHz band altogether).
Setting a static IP address for your Pi
Some 'smart' routers/hubs seem to have an issue if multiple Raspberry Pis are on the same network. Log in to your router and set each one with a static IP address to see if that resolves your issue.
If you're running multiple Raspberry Pis, you'll see that they all show up on your network as the name 'Raspberry Pi'. Whilst this is usually fine, it's a good idea to give each one a unique name to avoid confusion when troubleshooting network issues. To do this, open a terminal window and enter 'sudo raspi-config'. Then select 'Network Options' and then 'Hostname' to change the name that will show on your network.