Wifi passphrase error

Wifi was working allright. Yesterday night when I booted the OSMC on the RPi2 Wifi could not connect. It could however detect my network but have the failure to connect error. When I go into putty and feed the commands:

connmanctl > technologies > scan wifi > agent on > services > connect wifi_mynetworkcode_managed_psk > enter my wifi password it gives “invalid-key”.

I’ve dont this more then 20 times now I am sure it is the right password for my wifi. What is wrong?

Weird;

System > Settings > Services > Remote Control > Allow programs on other systems to control Kodi

When this option is turned on my wifi sees the network, but cannot connect to the network, it returns: invalid passphrase in putty.

When this option is turned off the wifi connects just fine.

Bug?

Is there some reason you’re not using the networking GUI in OSMC settings to configure wifi ?

I did at first, but it only gave me the error: Failed to connect to network.

For more details/information about the error I figured I would try it in SSH. The error it returned there was as stated before: “Invalid-key”.

Ok. So I rebooted my system. Turns out Wifi is out again. Getting the same: “Failure to connect to network” in the networking GUI in OSMC.

Troubleshooting right now with a lan cable attached to the Pi.

Edit: enabling “Allow programs on other systems to control Kodi” and disabling this option again won’t fix the problem as it did an hour ago. Still no wifi on the pi running out of ideas.

Thread is useless without debug logs.

Wifi network (WPA2-PSK) is called: interwebs (easy to cntrl+f in log)

Reboot with ethernet cable, wifi does not connect automatically. Trying manual connection. It connected! Log: http://paste.osmc.io/xusulebema

Reboot without ethernet cable, wifi does not connect autmatically. Trying manual connection, doesnt connect either. Plugged in ethernet cable and tried manual connection again: Does not work! Log: http://paste.osmc.io/olayimirum

Edit:
After several boots and troubleshooting: seems the wifi will only connect when I boot with the ethernet cable connected and then manually set up the wifi network.

Wifi will not connect automatically when Ethernet is connected. We specifically configure connman to only use a single network interface at once and give Ethernet priority with the following two options in /etc/connman.conf:

PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=true

So don’t boot up with Ethernet connected and expect wifi to also connect. If you manually connect wifi it will force it to connect even though Ethernet is plugged in, but next time you reboot Ethernet will take precedence and wifi will not connect. If you don’t like this behaviour you can change SingleConnectedTechnology to false. (Or don’t plug in Ethernet…)

Your final log is full of entries saying that the 4 way handshake failed due to a wrong key, for example:

Mar 26 13:15:27 osmc kernel: wlan0: deauthenticating from 8c:04:ff:80:ab:cf by local choice (Reason: 1=UNSPECIFIED)
Mar 26 13:15:27 osmc kernel: rtl8192c_common:rtl92c_fill_h2c_cmd(): return H2C cmd because of Fw download fail!!!
Mar 26 13:15:27 osmc wpa_supplicant[279]: wlan0: CTRL-EVENT-DISCONNECTED bssid=8c:04:ff:80:ab:cf reason=1 locally_generated=1
Mar 26 13:15:27 osmc wpa_supplicant[279]: wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
Mar 26 13:15:27 osmc wpa_supplicant[279]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="interwebs" auth_failures=1 duration=10 reason=WRONG_KEY

Are you absolutely sure you’re entering the right key ? Do you have any non letter/number characters in your pass phrase ? If you don’t use a US/UK keyboard have you checked that your keyboard layout is correct by trying to type your pass phrase into any other text entry box (with visible characters) in Kodi ?

It might be that you are typing a password with special characters but that due to the wrong keyboard layout you might be typing some wrong characters.

Not sure what else it could be besides the wrong passphrase.

I am 100% sure I typed the password right. In the password there is a special character: “@”. The wifi worked all right during installation when I typed the password into the windows installer for osmc. Then when I changed that setting in the first post the wifi stopped working. I can now only get the wifi to connect when there is an ethernet cable connected.

This is not a matter of me typing in the wrong password. I’ve tried it over 50 times.

I just pulled out the wifi receiver and bought a LAN cable to connect the Pi to the network.

Cheers

I’d also think it’s a us/uk layout thing, especially since you have the “@” character in your passphrase. Check here: http://www.uk-yankee.com/articles/us-vs-uk-keyboards-layouts-and-how-type-poundeuroother-symbols

Can you try setting up your wifi password without any special characters and see whether you can connect?

I didn’t say that you were pressing the wrong keys - I was suggesting that a keyboard layout discrepancy is causing the wrong character to be entered. As cocomic points out, the @ and " keys are reversed between UK and US keyboard layouts, so if you press a @ you will get a " and vica versa if the keyboard layout selected in the software is wrong.

This is why I suggested you try typing your wifi password into another visible text entry box inside Kodi to see what appears - did you try that ?

I would change my wifi password to:-
123456789

And then test it.

Changing the password works.

I find it weird however:
When I type in the password for the wifi I type it using the keyboard in OSMC. I literally press the ‘@’ on the osmc software.

In that case it’s possible the networking settings module is not handling a pass phrase with an @ character. I’ll pass that on to the networking module dev to see if he can reproduce it.

@ is udes as the separaor between user and pass, if you replace the @ with %40 it will probably work

I’m having this same issue, but my passphrase is entirely alphabetical.

I’m having the same issue, invalid-key (can’t connect with GUI neither), i changed my password to 123456789 but still invalid-key :frowning:

Debug log please.

I also had this - major pain in the bum.

In the logs i was seeing:

21:52:54 T:1314386976 NOTICE: Attempting connection to /net/connman/service/wifi_6cadf804963f_415355535f4775657374_managed_psk
21:52:54 T:1893725216 ERROR: CecLogMessage - Write: sent command error !
21:52:55 T:1314386976 NOTICE: DBusException connecting net.connman.Error.Failed: Input/output error

I was able to get around it by going into the conmann cache folders and deleting the access points cache folder. Once a reboot was done, it worked fine. I also changed /etc/conmann.conf to the following:

PreferredTechnologies=wifi,ethernet
SingleConnectedTechnology=true
AllowHostnameUpdates=true

In the cache settings, i could see the correct passwords etc for my 3 diff access points that it was refusing to connect to

Assuming you have numeric values, make sure you are NOT using the num pad on your keyboard. It’s been my experience w/all things LINUX to never use num pad. It transposes the numbers or doesn’t accept at all.