5

I'm using hostapd to share another wifi connection through my raspberry pi zero w bult in wifi card. After the raspberry pi boot I can see my SSID in my phone and even connect to it and use it for some seconds. Then the SSID simply disappears.

The status of hostapd shows nothing wrong:

pi@raspberrypi:~ $ sudo service hostapd status
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
   Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
   Active: active (running) since Sun 2018-08-05 16:55:06 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 557 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/hostapd.service
           └─597 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Aug 05 16:55:04 raspberrypi systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Aug 05 16:55:06 raspberrypi hostapd[557]: Starting advanced IEEE 802.11 management: hostapd.
Aug 05 16:55:06 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.

Here's my dmesg:

[    9.951912] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[   10.988983] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   11.023394] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[   11.023812] usbcore: registered new interface driver brcmfmac
[   11.550743] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[   11.551907] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14 
[   12.469798] Indeed it is in host mode hprt0 = 00001101
[   14.180038] uart-pl011 20201000.serial: no DMA platform data
[   14.366758] usb 1-1: reset high-speed USB device number 2 using dwc_otg
[   14.366994] Indeed it is in host mode hprt0 = 00001101
[   16.080543] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[   16.161385] mt7601u 1-1:1.0: ASIC revision: 76010001 MAC revision: 76010500
[   16.252009] mt7601u 1-1:1.0: Warning: unsupported EEPROM version 0d
[   16.252028] mt7601u 1-1:1.0: EEPROM ver:0d fae:00
[   16.771510] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   16.776815] usbcore: registered new interface driver mt7601u
[   18.456287] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   18.625722] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   18.625756] brcmfmac: power management disabled
[   18.753324] Bluetooth: Core ver 2.22
[   18.753500] NET: Registered protocol family 31
[   18.753508] Bluetooth: HCI device and connection manager initialized
[   18.753534] Bluetooth: HCI socket layer initialized
[   18.753548] Bluetooth: L2CAP socket layer initialized
[   18.753612] Bluetooth: SCO socket layer initialized
[   18.781182] Bluetooth: HCI UART driver ver 2.3
[   18.781197] Bluetooth: HCI UART protocol H4 registered
[   18.781202] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   18.786141] Bluetooth: HCI UART protocol Broadcom registered
[   19.362969] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   19.362997] Bluetooth: BNEP filters: protocol multicast
[   19.363027] Bluetooth: BNEP socket layer initialized
[   20.245972] wlan1: authenticate with 48:ee:0c:1f:d8:73
[   20.308671] wlan1: send auth to 48:ee:0c:1f:d8:73 (try 1/3)
[   20.310399] wlan1: authenticated
[   20.313517] wlan1: associate with 48:ee:0c:1f:d8:73 (try 1/3)
[   20.317906] wlan1: RX AssocResp from 48:ee:0c:1f:d8:73 (capab=0x411 status=0 aid=7)
[   20.362268] wlan1: associated
[   21.491599] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   32.303384] nf_conntrack version 0.5.0 (7168 buckets, 28672 max)
[   33.692972] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan1 is the wireless in which the raspberry pi is connected to. wlan0 is the raspberry's own built in wifi. I see no errors.

Here's /var/log/syslog:

Aug  5 16:55:06 raspberrypi kernel: [   33.692972] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Aug  5 16:55:06 raspberrypi hostapd[557]: Starting advanced IEEE 802.11 management: hostapd.
Aug  5 16:55:06 raspberrypi dnsmasq[599]: started, version 2.76 cachesize 150
Aug  5 16:55:06 raspberrypi systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.
Aug  5 16:55:06 raspberrypi dnsmasq[599]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Aug  5 16:55:06 raspberrypi dnsmasq-dhcp[599]: DHCP, IP range 192.168.4.2 -- 192.168.4.20, lease time 1d
Aug  5 16:55:06 raspberrypi dnsmasq[599]: reading /run/dnsmasq/resolv.conf
Aug  5 16:55:06 raspberrypi dnsmasq[599]: using nameserver 192.168.25.1#53
Aug  5 16:55:06 raspberrypi dnsmasq[599]: read /etc/hosts - 5 addresses
Aug  5 16:55:06 raspberrypi dnsmasq[600]: Too few arguments.
Aug  5 16:55:06 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Multi-User System.
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Graphical Interface.
Aug  5 16:55:06 raspberrypi systemd[1]: Starting Update UTMP about System Runlevel Changes...
Aug  5 16:55:06 raspberrypi systemd[1]: Reached target Host and Network Name Lookups.
Aug  5 16:55:06 raspberrypi systemd[1]: Started Update UTMP about System Runlevel Changes.
Aug  5 16:55:06 raspberrypi systemd[1]: Startup finished in 1.995s (kernel) + 32.367s (userspace) = 34.362s.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::ba27:ebff:feaa:1f8.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: New relevant interface wlan0.IPv6 for mDNS.
Aug  5 16:55:07 raspberrypi avahi-daemon[188]: Registering new address record for fe80::ba27:ebff:feaa:1f8 on wlan0.*.
Aug  5 16:55:28 raspberrypi systemd[1]: Time has been changed
Aug  5 16:55:28 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 27min 26.673226s random time.
Aug  5 16:55:28 raspberrypi systemd-timesyncd[173]: Synchronized to time server [2a01:4f8:110:30e1::9]:123 (2.debian.pool.ntp.org).
Aug  5 16:55:28 raspberrypi systemd[1]: apt-daily.timer: Adding 7h 36min 12.296585s random time.
Aug  5 17:01:05 raspberrypi systemd[1]: Created slice User Slice of pi.
Aug  5 17:01:05 raspberrypi systemd[1]: Started Session c1 of user pi.
Aug  5 17:01:05 raspberrypi systemd[1]: Starting User Manager for UID 1000...
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent and passphrase cache.
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent (access for web browsers).
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Timers.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Paths.
Aug  5 17:01:06 raspberrypi systemd[668]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Sockets.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Basic System.
Aug  5 17:01:06 raspberrypi systemd[668]: Reached target Default.
Aug  5 17:01:06 raspberrypi systemd[668]: Startup finished in 178ms.
Aug  5 17:01:06 raspberrypi systemd[1]: Started User Manager for UID 1000.
Aug  5 17:02:40 raspberrypi wpa_supplicant[373]: wlan1: WPA: Group rekeying completed with 48:ee:0c:1f:d8:73 [GTK=CCMP]

I also see no errors

UPDATE: The problem seems to happen only after someone connects to the network. The last messages on syslog are

Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: associated
Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 RADIUS: starting accounting session 5B672BEA-00000000
Aug  5 17:39:27 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: pairwise key handshake completed (RSN)
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPDISCOVER(wlan0) 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPOFFER(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPREQUEST(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:39:27 raspberrypi dnsmasq-dhcp[599]: DHCPACK(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 17:41:35 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated
Aug  5 17:41:35 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated

But I see no errors.

UPDATE:

Here's my /etc/hostapd/hostapd.conf file:

interface=wlan0
driver=nl80211
ssid=NameOfNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

UPDATE:

Here's hostapd with more verbosity:

Aug  5 18:21:22 raspberrypi systemd[1]: Started User Manager for UID 1000.
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: associated
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: event 1 notification
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: start authentication
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: unauthorizing port
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 1/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: EAPOL-Key timeout
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 1/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: received EAPOL-Key frame (2/4 Pairwise)
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: sending 3/4 msg of 4-Way Handshake
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: received EAPOL-Key frame (4/4 Pairwise)
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: authorizing port
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 RADIUS: starting accounting session 5B674006-00000000
Aug  5 18:21:40 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: pairwise key handshake completed (RSN)
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPDISCOVER(wlan0) 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPOFFER(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPREQUEST(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:40 raspberrypi dnsmasq-dhcp[599]: DHCPACK(wlan0) 192.168.4.16 38:80:df:35:8a:d3
Aug  5 18:21:54 raspberrypi systemd[664]: Time has been changed
Aug  5 18:21:54 raspberrypi systemd[1]: Time has been changed
Aug  5 18:21:54 raspberrypi systemd[1]: apt-daily.timer: Adding 10h 13min 39.087355s random time.
Aug  5 18:21:54 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 28min 49.504522s random time.
Aug  5 18:22:27 raspberrypi systemd[1]: Time has been changed
Aug  5 18:22:27 raspberrypi systemd[1]: apt-daily.timer: Adding 55min 40.693498s random time.
Aug  5 18:22:27 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 23min 53.062642s random time.
Aug  5 18:22:27 raspberrypi systemd[664]: Time has been changed
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 WPA: event 2 notification
Aug  5 18:24:06 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.1X: unauthorizing port
Aug  5 18:24:14 raspberrypi hostapd: wlan0: STA 38:80:df:35:8a:d3 IEEE 802.11: disassociated

UPDATE:

I had previously setted up this raspberry pi with USB ethernet. I now reinstalled a fresh image and just configured the necessary for the wireless AP functionality. The problem still happens. It also still happens after sudo apt update && sudo apt upgrade -y so it looks more like a bug than a wrong configuration.

Does anybody has any idea on how to debug it?

6
  • Everything looks ok until the STA disassociates, for some reason twice. That looks fishy. Enable debug log messages with logger_syslog_level=0 in hostapd.conf and see if this gives a more detailed picture of what happens.
    – dirkt
    Aug 5, 2018 at 18:15
  • @dirkt I updated the question, please take a look Aug 5, 2018 at 18:25
  • Hm, I don't see anything obvious. Can you look what happens on the client side, and why the client diassociates after 2 mins? You can also get debug message output from wpa_supplicant, if necessary (though I'm not sure how to do that with systemd). If you have it, you can also use a third computer and WLAN monitor mode to capture frames, that would show when the SSID beacons stop. If the beacons stop directly after association, I'd supect a bug in the kernel driver.
    – dirkt
    Aug 5, 2018 at 19:07
  • @dirkt the client doesn't dissociate, it's the SSID that is gone, because it goes away on other clients too. That is, it stops appearing even though they didn't even interact with it. Aug 5, 2018 at 19:21
  • @dirkt ok, actually it doesn't go away on other devices, but they won't connect after the dissociation of the first device Aug 5, 2018 at 19:25

2 Answers 2

1

By adding or modifying these params in /etc/hostapd/hostapd.conf solved the issue for me:

channel=6
ieee80211n=1
wmm_enabled=1
2
  • 1
    Setting them where?
    – muru
    Dec 10, 2019 at 1:44
  • @muru - this topic is about a hostapd issue. so in the config of your hostapd - which is located in your router/machine - and use sudo to modify that file
    – laplasz
    Dec 10, 2019 at 13:25
0

I can see my SSID in my phone and even connect to it and use it for some seconds. Then the SSID simply disappears.

In your /etc/hostapd/hostapd.conf you have this default:

# Send empty SSID in beacons and ignore probe request frames that do not 
# specify full SSID, i.e., require stations to know SSID. 
# default: disabled (0) 
# 1 = send empty (length=0) SSID in beacon and ignore probe request for 
#     broadcast SSID 
# 2 = clear SSID (ASCII 0), but keep the original length (this may be required 
#     with some clients that do not support empty SSID) and ignore probe 
#     requests for broadcast 
SSID ignore_broadcast_ssid=0

Ensure that it's disabled and not altered.

Also, this Raspberry.PI article: "Getting wifi to work with a hidden network" recommends:

"You have to add the scan_ssid=1 to the /etc/wpa_supplicant/wpa_supplicant.conf file.".

Example:

network={
ssid="bigboss"
scan_ssid=1
psk="mypassword"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
5
  • You're saying that I should make my raspberry pi transmit a hidden network? Also, I updated the question with my configuration, could you take a look? Aug 5, 2018 at 17:56
  • I really needed this SSID to be public Aug 5, 2018 at 17:57
  • Comment #1: No, not hidden. Thanks for adding that, it looks OK. Do you have a /etc/wpa_supplicant/wpa_supplicant.conf file? to add, and does it contain the suggested addition? --- PS: As a matter of principle don't post passwords (not that most of us are within range but someone might be), please obscure private info. This is not a request for personal info. Back in 1/2 an hour.
    – Rob
    Aug 5, 2018 at 18:06
  • Do you mean the wpa_supplicant of my computer or the raspberry? If it's for the raspberry, I see no reason because wpa_supplicant is for the configuration of the wlan1, which does not enter AP mode, only wlan0 does. If it's in my compter, then I'd prefer not do to this way because I also have phone and other things that will connect to it. Also, this password is from the raspberry pi tutorial, not my own, thanks for the advice anyways :) Aug 5, 2018 at 18:10
  • I addd SSID in front of ignore_broadcast_ssid=0 and the SSID won't even appear Aug 5, 2018 at 18:19

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.