[this article has not been reviewed/checked since March 2021]
Wifi is WEP Protected Fix by Sid Gulick
If Your Wifi is WEP protected, the RPi 4B will most likely not connect, here's a fix from Sid Gulick (I edited his fix slightly for consistency with this guide):
When you open the pi desktop without having selected a wifi 'ap' ( i think that's the term, the name for a router you might be able to log on to) there's an icon in the upper right, blue with 2 red x's. click on that and it will scan for possible connections. choose one and enter the password. If it's a WEP protected link it won't connect.
Open Terminal.
Type:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
and nano will open wpa_supplicant.conf.
there should be one entry of the form
network={
ssid="modem id"
key_mgmt=NONE
wep_key0="modem password"
(wep_tx_keyidx=0)
}
the last line in parens was suggested by the article which suggested that WEP was useless, one should change over to WPA, but if one insisted on WEP one would need an entry in the wpa_supplicant file of the above form.
I burned a new sd with rpi raspian and booted it up and tried to enter my modem and password in the wifi initial configuration menu; it failed, I hit skip, and the desktop appeared with the blue icon with red x's in the right corner. I clicked that, entered my password. the connection failed. then i opened Terminal and typed:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
In that file was an entry like the one above but without the 4th line in parens. I removed the quotes around the password, used <ctrl>x, saved the file. I can't remember whether I rebooted but the wifi link was then working. I also can't remember where i saw the suggestion that when there's a WEP password in this file you have to remove the quotes but I tried a lot of things before stumbling on it.