lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Finding IP address of wlan0(wifi)

Sat Dec 07, 2013 3:57 pm

I type in ipconfig wlan0 it only shows Ethernet HWaddr 00:13:ef:30:00:8e
RX Packet, TX Packet.

I don't see any IP address .

I already put this on my wpa_supplicant.conf so the wlan0 should be configured already
network={
ssid="HOME-1EF"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="1DF434535GDF545665"
}

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Finding IP address of wlan0(wifi)

Sat Dec 07, 2013 4:41 pm

'ip addr' or 'ifconfig wlan0' should work

That HW MAC address (00:13:ef:30:00:8e) looks like it's for a bluetooth adapter.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 07, 2013 7:30 pm

@doug, I try both ip adds and if config wlan0. It doesn't list the inet field. It only list the hardware address, no ip address listed.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Finding IP address of wlan0(wifi)

Sat Dec 07, 2013 9:26 pm

lilzz wrote:@doug, I try both ip adds and if config wlan0. It doesn't list the inet field. It only list the hardware address, no ip address listed.
Then the interface isn't up or isn't configured.

What do you have in /etc/network/interfaces?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sun Dec 08, 2013 6:36 am

my /etc/network/interfaces
auto l0
iface l0 inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


so why my wlan0 isn't up?

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Finding IP address of wlan0(wifi)

Sun Dec 08, 2013 10:35 pm

Add
auto wlan0

To the top of your interfaces file.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sun Dec 08, 2013 10:47 pm

instead of depending on the system reading the /etc/network/interfaces file, can I try those commands manually on command line?

meaning iwconfig auto wlan0
or iwconfig iface wlano inet dhcp

this way, I make sure all the commands are taken in and one at time.

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Finding IP address of wlan0(wifi)

Sun Dec 08, 2013 10:52 pm

lilzz wrote:my /etc/network/interfaces
auto l0 <-- is this one zero or lower case L zero
iface l0 inet loopback <-- same here
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp


so why my wlan0 isn't up?
The first two lines of /etc/network/interfaces look strange. They should be

Code: Select all

auto lo
iface lo inet loopback
using lower case L and lower case O

If you use wpa-roam the /etc/network/interfaces file must use the line iface wlan0 inet manual NOT iface wlan0 inet dhcp If you check dmesg you should see an error message about wpa-roam and manual.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Tue Dec 10, 2013 4:58 pm

OK, I have all the above lines in my /etc/network/interfaces

so, now I do sudo ifup wlan0
ifup: interface wlan0 already configured

iI did iwconfig
wlan0 unassociated Nickname:"<WIFI@REALTEK>"

I did iwlist
Nothing there

I am using my laptop now and served online, so my wifi is definitely working, but the pi couldn't find the wifi network

I also launched wpa_gui and nothing there too with the list.

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Finding IP address of wlan0(wifi)

Tue Dec 10, 2013 5:12 pm

How about

Code: Select all

sudo iwlist wlan0 scan
What response do you get with that.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Wed Dec 11, 2013 8:30 am

OK, sudo iwlist wlan0 scan produces my Wifi network
ESSID "HOME-1E62"

and ifup wlan0 produces interface wlan0 already configured.

So, I start to ping ping 10.0.0.2 but it says network unreachable.

route -n produces a empty table. What am I missing? why I can't ping?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: Finding IP address of wlan0(wifi)

Wed Dec 11, 2013 9:40 am

10.0.0.2 is an odd IP address to be pinging - a local network usually starts 192.168.x.y
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Finding IP address of wlan0(wifi)

Thu Dec 12, 2013 6:40 am

What do you get from
ifconfig wlan0
iwlist scan

On another machine can you look at the details of how it's connected? On Windows you do that with a ipconfig /all command. Does your RPi work if you connect it with a wire?

What does ifconfig eth0 show in that case?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Thu Dec 12, 2013 8:23 am

ifocnfig wlan0 gives me everything on the wlan0 except inet property, it's missing.

the only thing I suspect is the wifi adapter on pi didn't log into the wifi network meaning the spa_supplicant.conf isn't properly read in.

right now, I can't ping yahoo.com unhost or network unreachable.


How do I manually read in the wpa_supplicant.conf info on the command line?
Also the lines on the /etc/network/interfaces, can I manually duplicate them on command line?
for example, auto wlan0, how do I issue that on command line?

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Thu Dec 12, 2013 8:25 am

sudo iwlist wlan0 scan give me the wifi network, but if I use wpa_gui it doesn't detect anything, nothing show up if use that.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Finding IP address of wlan0(wifi)

Thu Dec 12, 2013 10:24 am

I'd restart the router, if you haven't already, it may not make a difference but its always worth trying.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Finding IP address of wlan0(wifi)

Thu Dec 12, 2013 1:48 pm

lilzz wrote:sudo iwlist wlan0 scan give me the wifi network, but if I use wpa_gui it doesn't detect anything, nothing show up if use that.
If Wifi Config GUI doesn't work make sure/etc/network/interfaces looks like the following

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
and put /etc/wpa_supplicant/wpa_supplicant.conf back to the default, as the settings you already have may not be right, which is like

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
then try the wifi config gui.

Otherwise you could just ignore wpa_supplicant.conf and set up your wifi just using /etc/network/interfaces file which can be done setting it to look like the following

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "network-name"
wpa-psk "network-password"
but using you own network name and password. Often much easier to get going.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 12:53 am

Ok, I have my /etc/network/interfaces like this and it turn off the wpa_supplicant.

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "HOME-1E62"
wpa-psk "56FGD45SDFFSE"

After I reboot, I did iwconfig it says wlan0, ESSID "HOME-1E62 NickName "<WIFI@REALTEK>"
Frequency 2.43GHz But still no inet field

route -n produces empty tables.
ping yahoo.com produces unreachable host.

So, at this point I don't know what goes wrong. Instead using /etc/network/interfaces during boot up time, can I do it manually on command line? I like to see some feedback from system,

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 1:25 am

lilzz wrote:Ok, I have my /etc/network/interfaces like this and it turn off the wpa_supplicant.

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "HOME-1E62"
wpa-psk "56FGD45SDFFSE"
After I reboot, I did iwconfig it says wlan0, ESSID "HOME-1E62 NickName "<WIFI@REALTEK>"
Frequency 2.43GHz But still no inet field

route -n produces empty tables.
ping yahoo.com produces unreachable host.

So, at this point I don't know what goes wrong. Instead using /etc/network/interfaces during boot up time, can I do it manually on command line? I like to see some feedback from system,
iwconfig does not show the IP for your wifi but it does show the MAC address of the Wifi Access Point. You need to use command ifconfig to see the wlan IP address inet addr:.

You could try commands

Code: Select all

sudo ifdown --force wlan0
sudo ifup --force wlan0
and see what happens. These commands will take down the wifi and bring it back up again and try to connect.

If you see your network when using command sudo iwlist wlan0 scan then your wifi is basically working. Something may not be letting it connect. Don't forget both the wifi network name and password are case sensitive, not just the password. I presume the network transmits it's name and its not hidden. Set it to transmit it's name if it does not.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 1:53 am

sudo iwlist wlan0 scan shows my wifi network, which is OK.

I type sudo ifup --force wlan0
ioctl[SIOCSIWAP] : Operation not permitted
ioctl[SIOCSIWENCPDEEXT]: Invalid Argument
Internet System Cinsritium DHCP CLient 4.2.2

listening on LPF/wlan0/..
Sending on LPF/wlan0/..
DHCPDISCOVER on lwan0 to 255.255.255.255 port 67 interval 4
receive packet failed on wlan0: Network is down.

Basically, sudo ifup --force wlan0 says network is down but sudo iwlist wlan0 scan indicates network is there.

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 2:29 am

lilzz wrote:sudo iwlist wlan0 scan shows my wifi network, which is OK.

I type sudo ifup --force wlan0
ioctl[SIOCSIWAP] : Operation not permitted
ioctl[SIOCSIWENCPDEEXT]: Invalid Argument
Internet System Cinsritium DHCP CLient 4.2.2

listening on LPF/wlan0/..
Sending on LPF/wlan0/..
DHCPDISCOVER on lwan0 to 255.255.255.255 port 67 interval 4
receive packet failed on wlan0: Network is down.

Basically, sudo ifup --force wlan0 says network is down but sudo iwlist wlan0 scan indicates network is there.
Fair enough. Your wifi is working but for some reason it cannot connect to your network. I have assumed your network uses WPA/WPA2 security. Is that right? If it uses WEP security you will need to edit /etc/network/interfaces.

Change wpa-ssid to wireless-essid and remove the quotation marks around the network-name

Change wpa-psk to wireless-key and remove the quotation marks from around the network password.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 3:02 am

I am sure its WPA, not WEP.

OK, I trying the other way of using wpa_gui, and under Adapter shows wlan0
current status : Inactive


Click Scan, scan and found HOME-1E62
CLick Connect; nothing happened
Now How can I connect thru Gui, it didn't prompt me for the network password.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 3:15 am

Ok, I rebooted the system and relaunched wpa_gui, again.
this time I can see the network, so I clicked Connect, and status now shows connected. (Completed)

But I still cannot ping anything,
ifconfig wlan0 still not showing inet.
route -n is also empty.

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 1:13 pm

Does your router have a DHCP server?

What's your gateway address? (Most likely 192.168.1.1 or 192.168.0.1)

So try configuring the interface manually

Code: Select all

ifconfig wlan0 192.168.1.88 netmask 255.255.255.0 
ifconfig wlan0 up
route add default gateway 192.168.1.1
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Re: Finding IP address of wlan0(wifi)

Sat Dec 14, 2013 7:34 pm

it's working now after I got another adapter.

thanks

Return to “General discussion”