You need to find out the wireless encryption standard of your network ,which I found as Wired Equivalent Privacy (WEP) for my case so even after supplying the correct user name and password, I was getting the above error.
The reason was WEP key (i.e. password) only allowed hexadecimal digits (i.e. 0 – 9, A – F) as password therefore ‘hello’ is not a valid password, and maximum length for the password is 26 hexadecimal digits (or 104 bits). This is the reason that WEP is not very secure and less used nowadays so we need to supply the password as hexadecimal digits.
If you still want to use WEP, here is the fix :
Run your editor (example using nano) to modify the configuration of /etc/wpa_supplicant/wpa_supplicant.conf file:
syntax : sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following configuration to the end of the file:
network={
ssid=”your network ssid”
key_mgmt=NONE
wep_key=0123456789abcdef0123456789
}
Please note that there is no quote for wep_key and it must be hexadecimal digits, and maximum length not exceeding 26 hexadecimals as shown above.
Save the file and reload the network service or reboot,now your Raspberry Pi 3 will be connected successfully.