From owner-freebsd-net@freebsd.org Fri Jun 19 16:14:00 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C749E331B2D for ; Fri, 19 Jun 2020 16:14:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49pP4l6NjWz4RXC for ; Fri, 19 Jun 2020 16:13:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qk1-x72d.google.com with SMTP id w1so9440766qkw.5 for ; Fri, 19 Jun 2020 09:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=txl8BPkzMuBxSde6qWh/zFHF/NXZ8hzE1guM/KEUhrc=; b=Dbzy5U75cQG9wpNCDzp9ss8zDwLTq9x/r3yIGUZ0uiX+yjZGpLU+seku9ZtBRUq5wu KFOyUb/NGRy8iRtB3OyPvXanw1pqIOh1IYCFE9uPN3HGNSTTVGbMzOFGqg9H6VZhHn1q zoj2auE0ETHhExBq4J6ckFPciOlg9x0RrO5ISeY0CNJmoymYwq0kJEB9D0c4Xe/0fYEQ +8Hc4YAvawl43r33DWNhL3b194dHVyDdy9DvBuCRai0WzQpVdpQaV+f8OIrdfNntrGVd nchG9kzKFXqaX11t9Kxr9EwZQJyFxdSdSMAJ4mGXtUTEU1iFDS8pBQXV6E3JdRwsCOKU amlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=txl8BPkzMuBxSde6qWh/zFHF/NXZ8hzE1guM/KEUhrc=; b=kYO+WRwjypsQRJtR1K5CEskAYQ5Zp5J5R+mOf8rh2H8c2Lt7RVKlPH51LPbHnTnu5C Z0z5yiqVsLS6Od+Zt+6vHjs4hTMoBHP1ZpdkOHDOX6Nb3dVqRZdCvDx30XHsECTO0gZt n3/XMDObRfj5jWufFiGQqEjtZnOrOMaaYXGk7rKDwQ7TUMYTkrxGJ1dQwPg1AgByqT+D xUetsS+x5CxD6kjYkjFvZ6FpPcpHdfmFaxsqLaPuMOru96ivV+ZrkcTpAGHft+B8PEdh 6cg2W1N+nICaAIwvDoXaqtfsN7y5VpfcLMbBtaTVPrOjYEDwcOxbbMM2OEIr/THGvlUv u82Q== X-Gm-Message-State: AOAM531EFrQKzeyPuBRgz11+MlUhK7gkST0gVcpZqj8Ka+2oyhhjLZdR o+Xs+aShRpITSEuns6sR1bOT1oG4EHzYglypsF3m+A== X-Google-Smtp-Source: ABdhPJz3KiESglsHDOQKlA4VYYrjoyLL1XE23NUhsOrlkRJdXCsQVlWZH3jpcECTUnbeDEGyr3oioquoRgAEBXmmTtc= X-Received: by 2002:a05:620a:9c1:: with SMTP id y1mr3148702qky.152.1592583238725; Fri, 19 Jun 2020 09:13:58 -0700 (PDT) MIME-Version: 1.0 References: <07f4e7f5-095e-e89e-2c55-d283ca62149c@druid.net> In-Reply-To: <07f4e7f5-095e-e89e-2c55-d283ca62149c@druid.net> From: Adrian Chadd Date: Fri, 19 Jun 2020 09:13:46 -0700 Message-ID: Subject: Re: WiFi hotspot keeps dropping To: "D'Arcy Cain" Cc: FreeBSD Net X-Rspamd-Queue-Id: 49pP4l6NjWz4RXC X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Dbzy5U75; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::72d as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-3.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.029]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; NEURAL_HAM_LONG(-1.01)[-1.012]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72d:from]; NEURAL_HAM_SHORT(-0.08)[-0.079]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2020 16:14:00 -0000 On Thu, 18 Jun 2020 at 16:37, D'Arcy Cain wrote: > I have set up my FreeBSD box as a gateway. It used to work fine but > suddenly my hotspot keeps failing. It drops a few times a day. > Restarting hostapd gets it back up again but I really want to keep it > up. I am running FreeBSD 12.1-RELEASE-p1 GENERIC amd64. My WiFi card is: > > ath0@pci0:1:0:0: class=0x028000 card=0x30a4168c chip=0x002e168c > rev=0x01 hdr=0x00 > vendor = 'Qualcomm Atheros' > device = 'AR9287 Wireless Network Adapter (PCI-Express)' > class = network > Ah! AR9287! My favourite 2G only 11n NIC! > > It is a HP running Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz on 2 quads > and 16GB of memory. > > From my rc.conf: > > # Internal wifi network > wlans_ath0=wlan0 > create_args_wlan0="wlanmode hostap" > ifconfig_wlan0="inet 192.168.225.1 netmask 0xffffff00 ssid druid" > hostapd_enable=YES > DHCPD_INTERFACES="$DHCPD_INTERFACES wlan0" > > If I can't keep it running can someone suggest a system test I can do to > decide that hostapd needs to be restarted? > So, you shouldn't need to restart hostapd after a stuck beacon. It should recover. > > One thing I found was lots of log entries like this: > > ath0: stuck beacon; resetting (bmiss count 4) > So there's plenty of reasons for a stuck beacon. I've mostly fixed the programming problems and now it's typically really busy air. > From reading up on that it seems that it is just a cosmetic warning. > Could this be an indication of something that is killing the hotspot? > It's possible but it shouldn't be killing the interface. What you could try is forcing a full reset every time the NIC needs to reset. sysctl dev.ath.0.hal.force_full_reset=1 See if that helps. I can go whack an AR9287 into a laptop and set it up as a 2G hotspot. What I suggest you do is recompile your kernel/modules with the following options: IEEE80211_DEBUG ATH_DEBUG AH_DEBUG ATH_DIAGAPI Then you'll get access to a lot more debugging tools (ie, the stuff in tools/tools/ath/) which we can use to diagnose what's going on. -adrian