emw
Posts: 52
Joined: Tue Apr 12, 2016 2:53 pm

Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Wed Nov 22, 2017 7:03 pm

How do you get the raspberry pi to connect to the wifi router after setting the ssid/password without rebooting. In older versions I just used 'sudo ifdown wlan0; sudo ifup wlan0' but ifupdown is not supported on stretch.

I have tried each of the following, none of which have work:

Code: Select all

sudo systemctl restart wpa_supplicant.service
sudo systemctl restart networking.service
sudo service networking restart
but 'sudo reboot' works fine

User avatar
ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6446
Joined: Fri Jul 29, 2011 5:36 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Wed Nov 22, 2017 11:28 pm

Code: Select all

wpa_cli -i wlan0 reconfigure

metalshark
Posts: 3
Joined: Sun Sep 28, 2014 10:13 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Fri Jan 11, 2019 9:02 pm

ShiftPlusOne wrote:
Wed Nov 22, 2017 11:28 pm

Code: Select all

wpa_cli -i wlan0 reconfigure
This doesn't seem to work for me. I'm using the latest stretch. All I want is to restart wlan0 to reconnect to the wifi without rebooting.

User avatar
HawaiianPi
Posts: 7842
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Sat Jan 12, 2019 1:57 am

metalshark wrote:
Fri Jan 11, 2019 9:02 pm
All I want is to restart wlan0 to reconnect to the wifi without rebooting.
Out of curiosity, why is rebooting such a problem for you? :?

Even the Desktop version of Raspbian takes only 15 seconds to reboot (less time than it took you to ask how to avoid rebooting).

And wpa_cli -i wlan0 reconfigure should work. If it doesn't there may be something wrong with your wpa_supplicant.conf file.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

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

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Sat Jan 12, 2019 2:19 am

metalshark wrote:
Fri Jan 11, 2019 9:02 pm
ShiftPlusOne wrote:
Wed Nov 22, 2017 11:28 pm

Code: Select all

wpa_cli -i wlan0 reconfigure
This doesn't seem to work for me. I'm using the latest stretch. All I want is to restart wlan0 to reconnect to the wifi without rebooting.
What is the response from the above command?
It should return OK and then connect to WIFI in a few seconds.
If it returns FAIL then there is something wrong with the conf file.
If it returns OK and still does not connect the SSID or password is wrong or the WIFI is off etc.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

metalshark
Posts: 3
Joined: Sun Sep 28, 2014 10:13 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Thu Jan 24, 2019 9:37 pm

klricks wrote:
Sat Jan 12, 2019 2:19 am
metalshark wrote:
Fri Jan 11, 2019 9:02 pm
ShiftPlusOne wrote:
Wed Nov 22, 2017 11:28 pm

Code: Select all

wpa_cli -i wlan0 reconfigure
This doesn't seem to work for me. I'm using the latest stretch. All I want is to restart wlan0 to reconnect to the wifi without rebooting.
What is the response from the above command?
It should return OK and then connect to WIFI in a few seconds.
If it returns FAIL then there is something wrong with the conf file.
If it returns OK and still does not connect the SSID or password is wrong or the WIFI is off etc.
It does say "OK" but the WIFI didnt come back. SSID and PASSWORD is correct because when I do a reboot it will connect. WIFI OFF?? how may I find out is it is off? Does issuing the command >

Code: Select all

ifconfig wlan0 down
turn off the WIFI?

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

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Thu Jan 24, 2019 10:47 pm

metalshark wrote:
Thu Jan 24, 2019 9:37 pm
klricks wrote:
Sat Jan 12, 2019 2:19 am
metalshark wrote:
Fri Jan 11, 2019 9:02 pm


This doesn't seem to work for me. I'm using the latest stretch. All I want is to restart wlan0 to reconnect to the wifi without rebooting.
What is the response from the above command?
It should return OK and then connect to WIFI in a few seconds.
If it returns FAIL then there is something wrong with the conf file.
If it returns OK and still does not connect the SSID or password is wrong or the WIFI is off etc.
It does say "OK" but the WIFI didnt come back. SSID and PASSWORD is correct because when I do a reboot it will connect. WIFI OFF?? how may I find out is it is off? Does issuing the command >

Code: Select all

ifconfig wlan0 down
turn off the WIFI?
I mean the WIFI is turned off or not configured correctly in the WIFI router.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

metalshark
Posts: 3
Joined: Sun Sep 28, 2014 10:13 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Fri Jan 25, 2019 8:25 pm

Nah.. the wifi is clearly on. BTW, I'm using a wash down version of stretch. I downloaded the RasPBX image and that's the one I'm using. Do you think it's a possibility that it's missing file or driver? I already did the (1) sudo apt update and (2) sudo apt upgrade.

Ernst
Posts: 1386
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Fri Jan 25, 2019 8:35 pm

metalshark wrote:
Fri Jan 25, 2019 8:25 pm
Nah.. the wifi is clearly on. BTW, I'm using a wash down version of stretch. I downloaded the RasPBX image and that's the one I'm using. Do you think it's a possibility that it's missing file or driver? I already did the (1) sudo apt update and (2) sudo apt upgrade.
I suggest you ask here: http://www.raspberry-asterisk.org/forum/
The road to insanity is paved with static ip addresses

techabilla
Posts: 1
Joined: Fri Feb 01, 2019 2:22 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Fri Feb 01, 2019 2:28 pm

I have the same problem, although I've been using the desktop UI to switch between networks. Changing to a new, or previously working wifi network will not work until a reboot is performed. I've tried the suggested command, and it returns 'OK', but still not network connection until reboot.

Raspberry Pi 2 Model B, Raspian Stretch, Edimax WiFi adapter.

MarrsAttax
Posts: 25
Joined: Fri Jun 01, 2012 2:39 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Tue Feb 26, 2019 3:04 pm

I'm having this problem too. I was using a quite out of date version of raspbian where 'wpa_cli reconfigure' would reconnect without reboot but this seems to have stopped now I have updated.

User avatar
ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6446
Joined: Fri Jul 29, 2011 5:36 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Tue Feb 26, 2019 3:20 pm

MarrsAttax wrote:
Tue Feb 26, 2019 3:04 pm
I'm having this problem too. I was using a quite out of date version of raspbian where 'wpa_cli reconfigure' would reconnect without reboot but this seems to have stopped now I have updated.
Still works here, I just pass it -i wlan0 as well, to prevent it from defaulting to the p2p device.

audas
Posts: 41
Joined: Tue Oct 01, 2019 11:11 pm

Re: Connecting to wifi router after changing wpa_supplicant.config without reboot (stretch)

Wed Feb 24, 2021 4:27 am

Yup, this was working for a long time on multiple devices with many different versions of rasp - now failing on latest build.

Fixed - user error - sorry.

Return to “Beginners”