0

We have an embedded arm device running an OS based on Debian 9, running kernel 4.14.67-1.0.6+.

EDIT: As per @A.B's request, below is the driver/chipset info too for future viewers - I didn't know how to find this at the time of asking the question.

filename:       /lib/modules/4.14.67-1.0.6+/extra/mlan.ko
license:        GPL
version:        C605
author:         Marvell International Ltd.
description:    M-WLAN MLAN Driver
srcversion:     103492D596FC10822F1F391
depends:
name:           mlan
vermagic:       4.14.67-1.0.6+ SMP preempt mod_unload modversions ARMv7 p2v8

We're able to connect to WiFi on bootup, but when the signal is lost the device is not automatically reconnecting. I've been going over the documents for /etc/network/interfaces and wpa_supplicant again and again trying different options and while I've made some progress it's still not reconnecting properly.

My config is shown below. I've tried playing about with wpa-conf vs wpa-roam with a manual iface setting. I've tried using different autoscan and ap_scan settings for wpa_supplicant. We've tried using NetworkManager in the past but that proved to have some issues with the GSM interface on this device.

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug mlan0
iface mlan0 inet dhcp
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf

ap_scan=2

# Networks SSIDs
network={
        ssid="1+ Benji"
        psk="REDACTED"
        key_mgmt=WPA-PSK
}

I'm testing this by rebooting the device and making sure it has a good connection, then turning off and on the WiFi hotspot on my mobile. When it's brought back up wpa_supplicant now scans to attempt to reconnect (which it wasn't before) but the connection keeps failing just saying that the station is leaving.

/var/log/syslog

# Network manually turned off
Feb 11 15:56:08 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-DISCONNECTED bssid=94:65:2d:83:c2:0d reason=3
Feb 11 15:56:08 arm kernel: [  154.302149] wlan: EVENT: Disassociated (reason 0x3)
Feb 11 15:56:08 arm kernel: [  154.302166] wlan: REASON: (Deauth) Sending STA is leaving (or has left) IBSS or ESS
Feb 11 15:56:08 arm kernel: [  154.302339] wlan: Disconnected from 94:XX:XX:XX:c2:0d: Reason code 3
Feb 11 15:56:08 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 11 15:56:08 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:13 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=1
Feb 11 15:56:13 arm kernel: [  159.732160] wlan: SCAN COMPLETED: scanned AP count=0
Feb 11 15:56:14 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:19 arm kernel: [  165.291259] usb 2-1: USB disconnect, device number 5
Feb 11 15:56:19 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=1
Feb 11 15:56:19 arm kernel: [  165.572172] wlan: SCAN COMPLETED: scanned AP count=0
Feb 11 15:56:20 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:26 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=1
Feb 11 15:56:26 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="1+ Benji" auth_failures=1 duration=10 reason=CONN_FAILED
Feb 11 15:56:26 arm kernel: [  171.912043] wlan: SCAN COMPLETED: scanned AP count=0
Feb 11 15:56:31 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:36 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=1
Feb 11 15:56:36 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="1+ Benji" auth_failures=2 duration=20 reason=CONN_FAILED
Feb 11 15:56:36 arm kernel: [  182.252181] wlan: SCAN COMPLETED: scanned AP count=0

# Network AP manually turned back on 
Feb 11 15:56:46 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:51 arm kernel: [  197.512170] wlan: SCAN COMPLETED: scanned AP count=1
Feb 11 15:56:51 arm kernel: [  197.682452] wlan: Connected to bssid 94:XX:XX:XX:c2:0d successfully
Feb 11 15:56:51 arm kernel: [  197.685349] wlan: Received disassociation request on mlan0, reason: 3
Feb 11 15:56:51 arm kernel: [  197.685361] wlan: REASON: (Deauth) Sending STA is leaving (or has left) IBSS or ESS
Feb 11 15:56:53 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-DISCONNECTED bssid=94:65:2d:83:c2:0d reason=3 locally_generated=1
Feb 11 15:56:53 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 11 15:56:53 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:54 arm kernel: [  199.872319] wlan: Connected to bssid 94:XX:XX:XX:c2:0d successfully
Feb 11 15:56:54 arm kernel: [  199.874233] wlan: Received disassociation request on mlan0, reason: 3
Feb 11 15:56:54 arm kernel: [  199.874247] wlan: REASON: (Deauth) Sending STA is leaving (or has left) IBSS or ESS
Feb 11 15:56:55 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-DISCONNECTED bssid=94:65:2d:83:c2:0d reason=3 locally_generated=1
Feb 11 15:56:55 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 11 15:56:55 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:55 arm kernel: [  201.702474] wlan: Connected to bssid 94:XX:XX:XX:c2:0d successfully
Feb 11 15:56:55 arm kernel: [  201.704140] wlan: Received disassociation request on mlan0, reason: 3
Feb 11 15:56:55 arm kernel: [  201.704152] wlan: REASON: (Deauth) Sending STA is leaving (or has left) IBSS or ESS
Feb 11 15:56:57 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-DISCONNECTED bssid=94:65:2d:83:c2:0d reason=3 locally_generated=1
Feb 11 15:56:57 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="1+ Benji" auth_failures=3 duration=30 reason=CONN_FAILED
Feb 11 15:56:57 arm wpa_supplicant[459]: mlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 11 15:56:57 arm wpa_supplicant[459]: mlan0: Trying to associate with SSID '1+ Benji'
Feb 11 15:56:58 arm kernel: [  203.872352] wlan: Connected to bssid 94:XX:XX:XX:c2:0d successfully
Feb 11 15:56:58 arm kernel: [  203.874052] wlan: Received disassociation request on mlan0, reason: 3
Feb 11 15:56:58 arm kernel: [  203.874064] wlan: REASON: (Deauth) Sending STA is leaving (or has left) IBSS or ESS

As you can see after I turn the network AP back on the device keeps trying to reconnect, but fails with reason 3. I've looked up that reason and I can't find anything that actually says anything meaningful and the message of "Sending STA is leaving (or has left) IBSS or ESS" isn't helpful.

If any additional information or output logs are needed please let me know and I'll be happy to supply them.

  • Welcome, try ap_scan=1, killall wpasupplicant then try to reconnect. – GAD3R Feb 11 at 16:32
  • 1
    I have tried ap_scan=1 for several hours with various combinations of other settings (including on its own). From what I can see in the syslog it doesn't actually rescan at all once the connection's dropped. I also just left it running for some time in case it just wasn't logging but still didn't reestablish the connection. I will give it a quick try with the killall though, if that works I should be able to hook it into the disconnect event? – TheBeardedQuack Feb 11 at 16:46
  • I tried that again and it still didn't do anything. I don't know why shutting down wpasupplicant would do anything anyway? Just to make sure all the info is available I ran kill $(pidof wpa_supplicant) as killall is not on this device, and I assume wpasupplicant was a typo (though I did check using pidof to see if it wasn't a typo). – TheBeardedQuack Feb 11 at 16:55
1

I also asked the device manufacturer if they had any suggestions a few days ago, while it took a bit for them to respond, their suggestion appears to be working perfectly.

The basic /etc/network/interfaces that I have is fine, but there was 1 line that I was missing when I was trying all the various options in /etc/wpa_supplicant/wpa_supplicant.conf which is disable_scan_offload=1... With ap_scan=1.

Final config:

# Enable WiFi scanning on network disconnect.
ap_scan=1
autoscan=periodic:10
disable_scan_offload=1
# This above line is crucial for making wpa_supplicant do the scan instead of relying
# on the driver, which in this case didn't appear to be scanning to reconnect.

# Users saved network list
network={
        ssid="1+ Benji"
        psk="REDACTED"
        key_mgmt=WPA-PSK
}
#network={...}
#network={...}
| improve this answer | |
  • It appears the solution might be specific to a ... specific device. But I can't find in the question or answer which device it is. It might be useful to state at least chipset and kernel driver name (I can only guess it's a Marvell brand from the interface name). – A.B Feb 23 at 1:45
  • @A.B if you could guide me (or point me to a guide) on how to find that information I'll be happy to share it for anyone else running into the same problem. The device itself is an Owasys owa43A, and I did try and include as much information as I could, I'm just not sure how to obtain a lot of it. – TheBeardedQuack Feb 24 at 15:36
  • @A.B Correct with your guess of Marvell... I've added the info I've found to the original question to help others in future. – TheBeardedQuack Feb 24 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.