pasamonte
Posts: 4
Joined: Sun Mar 05, 2017 7:51 pm

Forget a Wifi Network and Ethernet

Fri Oct 19, 2018 9:46 am

Hi all.
I am using a Raspbian Jessie and I am experiencing a problem with the wifi connection.

I want to connect by default to a wifi network but Jessie keeps connecting to the old one after every reboot.
I have tested everything I know to avoid it:

1.- Overwriting /etc/wpa_supplicant/wpa_supplicant.conf with the new configuration and deleting the old one. Doesn't work.

2.- Keeping both definitions in /etc/wpa_supplicant/wpa_supplicant.conf with a wrong wifi password for the old wifi.

3.- making a copy of the /etc/wpa_supplicant/wpa_supplicant.conf with the correct wifi in

Code: Select all

/boot
4.- making chmod for the /etc/wpa_supplicant/wpa_supplicant.conf and letting it just with read permission.

Every single time I reboot the file /etc/wpa_supplicant/wpa_supplicant.conf is changed and overwritten with the old wifi configuration.

Does anyone know where does it keep the old config to be able to overwrite the file everytime?

How can I make it forget the old wifi?

Thanks in advance.

B.Goode
Posts: 6531
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Forget a Wifi Network and Ethernet

Fri Oct 19, 2018 11:25 am

Every single time I reboot the file /etc/wpa_supplicant/wpa_supplicant.conf is changed and overwritten with the old wifi configuration.
This might be a symptom of a wider problem with your system.

Check that your microSD card has not spontaneously entered a read-only state.

Create a trivial file, with a few words of unimportant content, with an obvious name like do_i_survive. Save it somewhere obvious, like your home directory. Check that it really exists by reading its contents and that it appears in directory listings.

Then reboot your system and verify that the test file is recovered and remains accessible. If this simple test fails - as I suspect it might - it will also explain your inability to reconfigure your WiFi configuration.

pasamonte
Posts: 4
Joined: Sun Mar 05, 2017 7:51 pm

Re: Forget a Wifi Network and Ethernet

Fri Oct 19, 2018 12:24 pm

B.Goode wrote:
Fri Oct 19, 2018 11:25 am
Every single time I reboot the file /etc/wpa_supplicant/wpa_supplicant.conf is changed and overwritten with the old wifi configuration.
This might be a symptom of a wider problem with your system.

Check that your microSD card has not spontaneously entered a read-only state.

Create a trivial file, with a few words of unimportant content, with an obvious name like do_i_survive. Save it somewhere obvious, like your home directory. Check that it really exists by reading its contents and that it appears in directory listings.

Then reboot your system and verify that the test file is recovered and remains accessible. If this simple test fails - as I suspect it might - it will also explain your inability to reconfigure your WiFi configuration.

So you're right. I've created a shell script to switch networks and it disappeared after reboot.
How can I solve the read only problem?
I can't even imagine when it happened. I installed some time ago an open vpn and configured it and it's still there.

Thanks a lot fot the hint!!

B.Goode
Posts: 6531
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Forget a Wifi Network and Ethernet

Fri Oct 19, 2018 12:41 pm

How can I solve the read only problem?



You probably can't. I am not aware of a proven working solution ever being published in these forums.

The best way forward is to write a fresh version of Raspbian to a new micro SD card, then with an external usb card reader dongle extract any irreplaceable content from the old card.

klricks
Posts: 5882
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Forget a Wifi Network and Ethernet

Fri Oct 19, 2018 12:44 pm

pasamonte wrote:
Fri Oct 19, 2018 12:24 pm
..
.
So you're right. I've created a shell script to switch networks and it disappeared after reboot.
How can I solve the read only problem?
Can't be fixed. You need a new SD card. You may be able to clone the image from the bad card onto a new card.
IMO it would be best to start with a fresh download of Raspbian Stretch.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

kaksi
Posts: 68
Joined: Tue Mar 10, 2015 6:19 am

Re: Forget a Wifi Network and Ethernet

Sat Oct 20, 2018 11:52 am

pasamonte wrote:
Fri Oct 19, 2018 12:24 pm
How can I solve the read only problem?
There are several options:

1) Many cards come with a 5 years warranty. My dealer always replaced them.

2) Format it in an (old) camera, navigator, Android... Needs a lot of luck.

3) Look for an utility on the manufacturer's site.

4) There are utilities on internet. The question is how much you can trust them.

fruitoftheloom
Posts: 17603
Joined: Tue Mar 25, 2014 12:40 pm

Re: Forget a Wifi Network and Ethernet

Sat Oct 20, 2018 12:19 pm

pasamonte wrote:
Fri Oct 19, 2018 12:24 pm
B.Goode wrote:
Fri Oct 19, 2018 11:25 am
Every single time I reboot the file /etc/wpa_supplicant/wpa_supplicant.conf is changed and overwritten with the old wifi configuration.
This might be a symptom of a wider problem with your system.

Check that your microSD card has not spontaneously entered a read-only state.

Create a trivial file, with a few words of unimportant content, with an obvious name like do_i_survive. Save it somewhere obvious, like your home directory. Check that it really exists by reading its contents and that it appears in directory listings.

Then reboot your system and verify that the test file is recovered and remains accessible. If this simple test fails - as I suspect it might - it will also explain your inability to reconfigure your WiFi configuration.

So you're right. I've created a shell script to switch networks and it disappeared after reboot.
How can I solve the read only problem?
I can't even imagine when it happened. I installed some time ago an open vpn and configured it and it's still there.

Thanks a lot fot the hint!!

Yes best to start with a NEW SD Card and also change to the currently supported Raspbian Stretch OS, Jessie is end of life:

https://www.raspberrypi.org/downloads/raspbian/

https://www.raspberrypi.org/documentati ... /README.md
Adieu

pasamonte
Posts: 4
Joined: Sun Mar 05, 2017 7:51 pm

Re: Forget a Wifi Network and Ethernet

Mon Oct 22, 2018 9:57 am

Thank you all!!!
I'll create a new set up with Stretch. A pity that I'll have to reconfigure all the open vpn stuff.

Return to “Beginners”