ilovehd
Posts: 8
Joined: Fri Nov 15, 2013 7:29 pm

Turn WIFI on from the command line - Still off

Fri Feb 23, 2018 7:43 pm

Model 3 running Jessie - I am trying to turn the wifi on from the command line.

I have tried ifup wlan0, and its still off.

iwconfig shows wlan0

if i click Image in the GUI to turn the wifi on it works no problem.

How do I do this from the command line?

Thanks!

pcmanbob
Posts: 4546
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Turn WIFI on from the command line - Still off

Fri Feb 23, 2018 9:44 pm

Try

ifconfig wlan0 up

Or

sudo ifconfig wlan0 up
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

ilovehd
Posts: 8
Joined: Fri Nov 15, 2013 7:29 pm

Re: Turn WIFI on from the command line - Still off

Mon Feb 26, 2018 11:45 am

when I try that command I get a message:

SIOCSIFFLAGS: Operation not possible due to RF-kill

Any other ideas?

rfkill list returns these results
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no

ilovehd
Posts: 8
Joined: Fri Nov 15, 2013 7:29 pm

Re: Turn WIFI on from the command line - Still off

Mon Feb 26, 2018 12:02 pm

I resolved the issue by issuing the following command:

sudo rfkill unblock 0

Thanks all !

PiGraham
Posts: 3405
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Turn WIFI on from the command line - Still off

Mon Feb 26, 2018 12:06 pm

[Edit] I see OP found this solution before I posted but I'll post anyway for the detail.


How did you turn Wi-Fi off?

A search on rfkill led here

http://www.geekmind.net/2011/01/linux-w ... e-due.html

Pi has no hardware button so that stuff is irrelevant but maybe this is useful:

What does this report?

Code: Select all

sudo rfkill list all
My PiZeroW gives this:

Code: Select all

[email protected]:~ $ sudo rfkill list all
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
1: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no
If it reports blocked maybe this will unblock it:

Code: Select all

sudo rfkill unblock 0 
That's using the number for the interface listed above

The Soft blocked status seems to correspond to the GUI "Turn Wi-Fi on" / "Turn Wi-Fi off".

Return to “Beginners”