How to debug wifi setup on OpenWrt?

2

I have TP-LINK MR3020 device, which is connected to my laptop via UTP cable. It is accessible. I have installed full distribution recently, but then broke it and went from scratch with failsafe/firstboot.

Now I have removed luci and would like to configure everything from command line.

I have Wi-Fi network available and I want my device to connect to it and to share internet to my UTP connection.

Here is the content of my /etc/config wireless file:

config wifi-device  radio0
        option type     mac80211
        option channel  auto
        option macaddr  e8:de:27:54:68:78
        option hwmode   11ng
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

#config wifi-iface
#       option device   radio0
#       option network  lan
#       option mode     ap
#       option ssid     OpenWrt
#       option encryption none
#       option disabled 1

config wifi-iface
        option device   radio0
        option network  inthemoon
        option mode     sta
        option ssid     'In The Moon Network'
        option encryption 'psk2'
        option key      'mykey'

Here is the content of my /etc/config/network file:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

config interface 'inthemoon'
        option proto 'dhcp'

I was thinking this is sufficient to fullfill the task.

And here are results of some commands:

Successfully initialized wpa_supplicant
root@MR3020:~# ifup inthemoon
Successfully initialized wpa_supplicant
root@MR3020:~# wifi
Successfully initialized wpa_supplicant
root@MR3020:~#

Unfortunately, I can se no any sign that Wi-Fi connection is working.

No any interner commands working like "ping".

How to see, what is happening and how to debug the configuration?

UPDATE

logread says "Sending discover" and "wan is down" (I renamed inthemoon to wan and radio0 to wlan0, hoping to become compatible with another configs like firewall)

UPDATE 2

Full log after command

root@MR3020:/etc/config# /etc/init.d/network restart ; ifup wan ; ping 192.168.10.1
Successfully initialized wpa_supplicant
Successfully initialized wpa_supplicant
PING 192.168.10.1 (192.168.10.1): 56 data bytes
ping: sendto: Network is unreachable

192.168.10.1 is the IP address of a gateway. On gateway I see no DHCP lease of the device.

Log:

Jan  1 00:53:38 MR3020 daemon.notice netifd: Interface 'lan' is now down
Jan  1 00:53:38 MR3020 kern.info kernel: [ 3218.140000] br-lan: port 1(eth0) entered disabled state
Jan  1 00:53:38 MR3020 kern.info kernel: [ 3218.160000] device eth0 left promiscuous mode
Jan  1 00:53:38 MR3020 kern.info kernel: [ 3218.160000] br-lan: port 1(eth0) entered disabled state
Jan  1 00:53:38 MR3020 kern.info kernel: [ 3218.160000] eth0: link down
Jan  1 00:53:38 MR3020 daemon.notice netifd: Interface 'loopback' is now down
Jan  1 00:53:38 MR3020 daemon.notice netifd: Interface 'wan' is now down
Jan  1 00:53:38 MR3020 user.info firewall: removing lan (br-lan) from zone lan
Jan  1 00:53:40 MR3020 kern.info kernel: [ 3220.270000] device eth0 entered promiscuous mode
Jan  1 00:53:40 MR3020 daemon.notice netifd: Interface 'lan' is now up
Jan  1 00:53:40 MR3020 daemon.notice netifd: Interface 'loopback' is now up
Jan  1 00:53:40 MR3020 kern.info kernel: [ 3220.510000] eth0: link up (100Mbps/Full duplex)
Jan  1 00:53:40 MR3020 kern.info kernel: [ 3220.510000] br-lan: port 1(eth0) entered forwarding state
Jan  1 00:53:40 MR3020 kern.info kernel: [ 3220.520000] br-lan: port 1(eth0) entered forwarding state
Jan  1 00:53:41 MR3020 user.notice ifup: Enabling Router Solicitations on lan (br-lan)
Jan  1 00:53:42 MR3020 user.info firewall: adding lan (br-lan) to zone lan
Jan  1 00:53:42 MR3020 kern.info kernel: [ 3222.520000] br-lan: port 1(eth0) entered forwarding state
Jan  1 00:53:43 MR3020 user.notice ifup: Enabling Router Solicitations on loopback (lo)
Jan  1 00:53:46 MR3020 daemon.notice netifd: Interface 'wan' is now down
Jan  1 00:53:47 MR3020 daemon.notice netifd: wan (10625): udhcpc (v1.19.4) started
Jan  1 00:53:47 MR3020 daemon.notice netifd: wan (10625): Sending discover...
Jan  1 00:53:47 MR3020 daemon.notice netifd: wan (10625): udhcpc: sendto: Network is down
Jan  1 00:53:47 MR3020 daemon.notice netifd: wan (10625): Read error: Network is down, reopening socket
Jan  1 00:53:47 MR3020 daemon.notice netifd: wan (10625): udhcpc: bind: No such device
Jan  1 00:53:47 MR3020 daemon.notice netifd: Interface 'wan' is now down

The same log occurs if I enter incorrect wireless password.

Dims

Posted 2014-09-28T19:06:24.000

Reputation: 8 464

logread is the magic command you're looking for. Please add its output to your question. – Daniel B – 2014-09-28T20:22:19.437

Which version of OpenWrt are you using? I have 12.09-rc1 on mine and it’s running perfectly fine. I don’t see any messages from wpa_supplicant at all in your log. – Daniel B – 2014-09-29T08:53:13.483

No answers