AP-mode radio0 in RasPi 3 always acts as a client -- shows as wlan0 in luci?


#1

Hello world,

My lede Installation on a RasPi 3 is configured with Wifi in AP mode, but not for the life of me I manage to get it working. It always shows as a client in the config and also my WiFi scanners show no activity.

What am I doing wrong here?
I have set up Security, a passphrase, selected a channel, enabled DHCP on the br-lan interface but never ever will the RasPi start the Wifi.

The hardware is functioning all right, because the "Scan" button works just fine and finds all my WiFi networks ... so it is a software problem, most likely a misconfiguration on my part.

Now, before I start posting all my config files, can someone please give me a pointer on how to debug a bridged lan/wifi network?

Thanks and greetings,

-Thomas


#2

You might get better answers (instead of guesses) if you post here

  • your /etc/config/wireless,
  • kernel log (dmesg) about wifi detection etc. during boot. (only the relevant 50-100 lines)
  • system log output (logread) when you do "wifi up" from console.

That would give at least some data about what is happening.


#3

Hi @hnyman,

thanks for the quick reply.
Here we go:

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
	option htmode 'HT20'
	option country 'DE'
	option channel '5'

config wifi-iface
	option device 'radio0'
	option mode 'ap'
	option ssid 'firewall'
	option network 'lan'
	option encryption 'psk2+ccmp'
	option key 'mein passwort'

dmesg (Hmm, no radio in there at all ... only the ethernets)

[    5.643837] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 29 2016 20:48:16 version 7.45.41.26 (r640327) FWID 01-4527cfab
[    5.686220] usbcore: registered new interface driver brcmfmac
[    5.696847] kmodloader: done loading kernel modules from /etc/modules.d/*
[    5.725103] r8152 1-1.3:1.0 eth1: v1.08.7
[    5.781287] usb 1-1.5: reset high-speed USB device number 5 using dwc_otg
[    5.964445] r8152 1-1.5:1.0 eth2: v1.08.7
[    7.283638] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    7.296449] br-lan: port 1(eth0) entered blocking state
[    7.304487] br-lan: port 1(eth0) entered disabled state
[    7.312771] device eth0 entered promiscuous mode
[    7.321955] br-lan: port 1(eth0) entered blocking state
[    7.329719] br-lan: port 1(eth0) entered forwarding state
[    7.396757] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[    7.466601] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[    7.502299] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[    8.760858] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
[   16.984221] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[  490.021397] br-lan: port 1(eth0) entered disabled state
[  490.036075] device eth0 left promiscuous mode
[  490.043207] br-lan: port 1(eth0) entered disabled state
[  490.052670] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  490.066826] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  492.123625] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[  492.135951] br-lan: port 1(eth0) entered blocking state
[  492.143729] br-lan: port 1(eth0) entered disabled state
[  492.151885] device eth0 entered promiscuous mode
[  492.160940] br-lan: port 1(eth0) entered blocking state
[  492.168584] br-lan: port 1(eth0) entered forwarding state
[  492.237040] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[  492.247652] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[  492.307379] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[  492.318042] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[  493.620940] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
[ 1701.788413] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 2626.782884] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[ 2626.793959] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready

logread on wifi up

Thu Apr  6 11:02:29 2017 daemon.notice netifd: radio0 (15642): command failed: No error information (-524)
Thu Apr  6 11:02:29 2017 daemon.notice netifd: radio0 (15656): command failed: No error information (-524)
Thu Apr  6 11:02:29 2017 daemon.notice netifd: radio0 (15656): command failed: Not supported (-95)
Thu Apr  6 11:02:29 2017 daemon.notice netifd: radio0 (15656): command failed: I/O error (-5)
Thu Apr  6 11:02:29 2017 daemon.notice netifd: radio0 (15656): command failed: Too many open files in system (-23)
Thu Apr  6 11:02:30 2017 daemon.notice netifd: radio0 (15656): command failed: Too many open files in system (-23)
Thu Apr  6 11:02:30 2017 daemon.notice netifd: radio0 (15656): Device setup failed: INTERFACE_CREATION_FAILED
Thu Apr  6 11:02:30 2017 daemon.notice netifd: radio0 (15656): WARNING: Variable 'interfaces' does not exist or is not an array/object

And yes, I have seen that last error message, but a key / option labelled "interfaces" is nowhere documented (at least not where I was looking)

8^(

Please point me to my stupid mistake.
Thanks! -T


#4

I am not sure if you have any problem in the wireless config, but I am not sure of you have the correct drivers for your wifi module. The logread items on "wifi up" point to problems with the driver.

I added Raspi3 to the title, but you might edit it more. You likely need help from Raspberry specialists.


#5

Hmmm -- I can scan allright using the Module, so how can it be a driver problem?


#6

Also, I wonder how to get rid of these "too many open files" error messages.Tried to increase the ulimit but seem unable to make that persistent.

Is there a dedicated Raspberry forum part - could not find any. I have installed the latest version from the official download site, so I would have expected the configuration fits.


#7

And then I get this on the command line:

root@LEDE:/sbin# wifi status
{
        "radio0": {
                "up": true,
                "pending": false,
                "autostart": true,
                "disabled": false,
                "retry_setup_failed": false,
                "config": {
                        "hwmode": "11g",
                        "path": "platform\/soc\/3f300000.mmc\/mmc_host\/mmc1\/mmc1:0001\/mmc1:000
:1",
                        "htmode": "HT20",
                        "country": "DE",
                        "channel": "5"
                },
                "interfaces": [
                        {
                                "section": "@wifi-iface[0]",
                                "config": {
                                        "mode": "ap",
                                        "ssid": "firewall",
                                        "encryption": "psk2+ccmp",
                                        "key": "mein passwort",
                                        "mode": "ap",
                                        "network": [
                                                "lan"
                                        ]
                                }
                        }
                ]
        }
}

The GUI tells a different story - what is going on?


#8

@hnyman, all,

just noticed that the interface-name in LUCI is shown as "wlan0":

after I do ifconfig wlan0 I also see it in terminal (note: not before):

root@LEDE:/etc/board.d# ifconfig
br-lan    Link encap:Ethernet  HWaddr B8:27:EB:xx:xx:xx
          inet addr:10.xx.xx.xx  Bcast:10.xx.xx.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7833868 errors:0 dropped:544 overruns:0 frame:0
          TX packets:6890789 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8667031638 (8.0 GiB)  TX bytes:5022712746 (4.6 GiB)

eth0      Link encap:Ethernet  HWaddr B8:27:EB:xx:xx:xx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7833881 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6890789 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8667032683 (8.0 GiB)  TX bytes:5077933278 (4.7 GiB)

eth1      Link encap:Ethernet  HWaddr 00:E0:4C:xx:xx:xx
          inet addr:172.xx.xx.xx  Bcast:172.xx.xx.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7950 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6494 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1368646 (1.3 MiB)  TX bytes:2162004 (2.0 MiB)

eth2      Link encap:Ethernet  HWaddr 00:E0:4C:xx:xx:xx
          inet addr:192.xx.xx.xx  Bcast:192.xx.xx.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6861370 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7750725 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5023266650 (4.6 GiB)  TX bytes:8768241578 (8.1 GiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:430 errors:0 dropped:0 overruns:0 frame:0
          TX packets:430 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:43629 (42.6 KiB)  TX bytes:43629 (42.6 KiB)

wlan0     Link encap:Ethernet  HWaddr B8:27:EB:xx:xx:xx
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

But ifconfig radio0 yields nothing ... 8^(


#9

Experts out there, I just found this here:

https://www.mail-archive.com/lede-dev@lists.infradead.org/msg06676.html

along with the many error messages I get (like the "Too many open files in system (-23)" thingy) may this be the solution to my issue?

If so -- how can I apply the path?


#10

That seems to have been applied to the LEDE master on 22 March as r3825:
https://git.lede-project.org/?p=source.git;a=commit;h=8301e613655c2d95fa5430a1a57d92d966fdc70b

If you have a newer master build, you already have the patch.

You can also test the patch in a live router (if you have older build or 17.01).
http://patchwork.ozlabs.org/patch/738708/

The example below assumes that you have opkg installed "wget" and "patch". Wget downloads it a bit stupidly to as index.html (from that website)

   cd /tmp
   wget http://patchwork.ozlabs.org/patch/738708/raw/
   less index.html
   cd /lib/netifd/wireless/
   patch --dry-run -p 8 -i /tmp/index.html   (to see that it applies cleanly)
   patch -p 8 -i /tmp/index.html     (actual patching)

Ps. And to your previous question. "radio0" is not an interface, but a physical radio, so ifconfig does not know about it. interfaces that use the radio device are like wlan0, wlan1, wlan1-1 etc. The same radio can have multiple interfaces.


#11

Checking my scard image, it seems I am running r3205 ... and somehow this patching resulted in broken USB net interfaces so my router is now offline.

I need to re-install -- should I go back to latest release or forward to current development snapshot? Any quick suggestions or recommendations?


#12

3205 sounds either like something from the 17.01 branch or something really old from the master (something like 2 months old :slight_smile: ).

With "newish" routers your best bet is usually with the development snapshots. And you should likely update without saving settings. Just re-create them again after the flash.


#13

@hnyman -- thanks, so I figured and am already in the flashing process.

Now .. while this is ongoing: How would I keep this up to date afterwards?
I found little instructions on howto jump to next versions -- the documentation of sysupgrade is ambiguous. 8^(


#14

Sysupgrading depends quite much on the target platform. For most routers a new firmware can just be flashed while keeping old settings, i.e. there is support for proper sysupgrade. So not much advice is needed.

But I am not familiar with brcm270x & Raspberry sysupgrading.


#15

I had exactly the same issue as you.

I'm using a Raspberry 3 with LEDE 17.01.0 release(image name lede-17.01.0-r3205-59508e3-brcm2708-bcm2710-rpi-3-ext4-sdcard.img).

I had also tried the snapshot today(image name lede-brcm2708-bcm2710-rpi-3-ext4-sdcard.img) without any luck. Even worse, it booted without any wifi.

Sad. :frowning:


#16

@zixia -- please support me by adding to my Bug Report:

https://bugs.lede-project.org/index.php?do=details&task_id=692

8^)


#17

Sure! :smiley:


#18

I've noticed a bug about the country code setting in OpenWRT does not work in RPi, please see these 2 links.
https://forum.openwrt.org/t/cannot-use-channels-12-and-13-on-raspberry-pi-3-in-ap-config
https://bugs.openwrt.org/index.php?do=details&task_id=1133