How to change the wifi key?

Hi,

I can not connect to my wifi box since I changed my wifi key.

I put the old one back and it works again.

So why ?

Regards.

You can remove all WiFi networks by running: sudo rm /var/lib/connman/wifi_*

Ok, and after ?

rm: cannot remove ‘/’: Is a directory
rm: cannot remove ‘var’: No such file or directory
rm: cannot remove ‘/’: Is a directory
rm: cannot remove ‘lib’: No such file or directory
rm: cannot remove ‘/’: Is a directory
rm: cannot remove ‘connman’: No such file or directory
rm: cannot remove ‘/’: Is a directory
rm: cannot remove 'wifi’: No such file or directory_
rm: cannot remove ‘Externe’: Is a directory
rm: cannot remove ‘Movies’: Is a directory
rm: cannot remove ‘Music’: Is a directory
rm: cannot remove ‘Pictures’: Is a directory
rm: cannot remove ‘TV Shows’: Is a directory
rm: cannot remove ‘mkdir’: Is a directory

Where is the file containing the wifi key ?

My guess is you’ve put unnecessary spaces in the command Sam provided. Check it again please and afterwards try to connect to your new wifi.

And now is good ?

rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_4c697665626f782d43453833_managed_psk’: Is a directory
rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_4e6575665f4c6f72646b6f5f706c7573_managed_psk’: Is a directory
rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_4e6575665f4c6f72646b6f_managed_psk’: Is a directory
rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_5346525f30353530_managed_psk’: Is a directory
rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_5346525f443632385f706c7573_managed_psk’: Is a directory
rm: cannot remove ‘/var/lib/connman/wifi_e8de27a0ecb0_5346525f44363238_managed_psk’: Is a directory

Sorry, use rm -rf.

Like this ?

sudo rm -rf /var/lib/connman/wifi_*

I still can not change the key !!!

Now I can not connect to wifi even by putting back my old key !!!

How can I do ?

Once you have deleted the directory; you can then connect with the new key after a reboot.

No, even after a reboot I can not get in a new key.

And I noticed that there was a file “setting” in the folder /var/lib/connman

How long is the new passphrase? There is a minimum length (I think it was 8 chars) to use with connman on OSMC.

I tried 8 and 20 chars

You tried in the GUI or via ssh + connmanctl?
What is the error?
Screenshot?

In the GUI because I’m not connected to wifi anymore.

There is no error message just that the connection failed.

Have you rebooted the wifi router?

hum… no ! I’m trying

Not better. I have to connect to ethernet and modify directly in SSH.

It’s possible ? Where is the file containing the password ?

Well you basically deleted it with your previous steps. Assuming now that you have recreated a connection in MyOSMC you should find the details in /var/lib/connman/wifi_* where the string after the wifi relates to the WLAN you connected to.
Alternatively use connmanctl on the command line to connect to your wifi.
agent on, enable wifi, scan wifi, services, connect <THE WIFI you want to connect to from services output> it will then ask you for password.

I have an error at this place connect <MyBox: Error ‘connect’: Invalid argument

what is the exact command ?

Without the < just the service string that is shown in previous services command