I wrote: > I wrote: > > Xose Vazquez Perez wrote: > > > Craig McQueen wrote: > > > > > > > I have a D-Link DWA-140 USB Wi-Fi device which is rt2800 based > > > > (5392 chipset). I'm trying to use it on a BeagleBone Black based > > > > system with 3.14.x kernel built with Yocto. We're using ConnMan > > > > 1.30 at the > > moment. > > > > > > Try it with a _desktop x86_64 distribution_ , with a *recent kernel* > > > as > > > Fedora: (WORK is gnome) > > > https://alt.fedoraproject.org/pub/alt/live-respins/ > > > > Hmm, that is non-trivial but I may try it. > > > > For now, I'll also try a 4.4.6 kernel running on a BeagleBone Black > > (with a USB hub to work around another issue with the rt2800usb driver > > crashing as described in another e-mail). > > > > > > We've been finding some instabilities with it periodically > > > > disconnecting from some networks. So we tried upgrading the > > > > firmware file rt2870.bin from version 0.29 to 0.36. That seems to > > > > be more stable with the network. However, we're finding that it > > > > initially doesn't connect, until the Wi-Fi has been disabled and then re- > enabled. ' > > > scan wifi' > > > > and 'iwlist scan' don't return anything until Wi-Fi has been > > > > disabled and then re-enabled. > > > > > > Don't use any wrapper(NM, ConnMan, wicd, ...), usually are buggy. > > > You should use raw commands "iw" and "wpa_supplicant". Hints: > > > https://wireless.wiki.kernel.org/en/users/documentation/iw and > > > wpa_supplicant always running with "-Dnl80211" > > > > Okay, I've stripped down the system so ConnMan, udev rules aren't > running. > > > > On all systems, after plugging in the device, I have to issue: > > > > ip link set wlan0 up > > > > After this, I try to do a scan: > > > > iw dev wlan0 scan > > > > On kernel 4.4.6, with firmware 0.36, it works fine (lists APs it > > finds). On kernel 3.14.x, with firmware 0.29, it works fine. But on > > kernel 3.14.x, with firmware 0.36, it returns nothing. But then, if I do this: > > > > ip link set wlan0 down > > ip link set wlan0 up > > iw dev wlan0 scan > > > > Then it works fine. > > > > So, the question is, why does firmware 0.36 with kernel 3.14.x not > > work until I've made the interface go up, then down, and then up again? > > I've managed to build, using Yocto, kernel 4.4.12 for BeagleBone. When I run > it, it has the same problem. That's different from the Ubuntu 16.04 for > BeagleBone using 4.4.6 kernel. > > With my Yocto build, it had a different version of the 'ip' and 'iw' commands. > So I tried copying the Ubuntu versions, but that didn't make a difference. I > tried using the Yocto built 4.4.12 kernel with the Ubuntu root filesystem, but > it halted during the boot process (don't know why). My best guess is that > there's some kernel config difference that makes a difference, but there are > many differences, so I'm not sure which one it might be. > > I'm not sure at this point how to narrow it down to the root cause. Any > advice? > > I wonder if maybe there's a race condition in the rt2800usb driver between > loading the rt2870.bin firmware and doing the interface-up initialisation. > Normally the firmware loads at the point of doing the 'iw link set wlan0 up' > command. Is there a way to force the firmware to load before that > command? I've got two rt2800 devices: * D-Link DWA-140 with RT chipset 5392, rev 0223, and RF chipset 5372 * Edup EP-N8537 with RT chipset 5390, rev 0502, and RF chipset 5370 I've also found that with the Yocto-built 4.4.12 kernel, this no-scan issue only happens to the Edup with the 5390 chipset. The D-Link is fine. With the Ubuntu 4.4.6 kernel, both devices work fine, without this no-scan problem. I'm having trouble narrowing it down further, since these varying circumstances don't obviously point towards a root cause. Somehow it seems to be dependent on a combination of kernel configuration, the device's chipset, and which firmware is loaded on the device. Unless it's just a marginal timing issue due to some race condition. But at this point I'm not sure where to look. Any advice would be much appreciated; I'm not sure where to look next since I'm not familiar with the USB and Wi-Fi systems of the kernel. Where might I find rt2800 experts/maintainers these days who might be able to give some advice on this? Thanks, Craig McQueen ��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f