我有一个带有 Raspbian 的 Raspberry PI Zero W。我用它创建了一个 WLAN-AP。我可以使用我的 Windows 10 计算机访问它,没有任何问题,但使用我的 Android 8.1.0 手机则无法使用。手机在短时间内(最多 2 秒)后停止连接,且没有任何错误消息。
这些是AP的信息,当你用它扫描时sudo iw dev wlan0 scan
BSS b8:27:eb:64:ab:17(on wlan0)
TSF: 603438314 usec (0d, 00:10:03)
freq: 2422
beacon interval: 100 TUs
capability: ESS Privacy SpectrumMgmt ShortSlotTime (0x0511)
signal: -83.00 dBm
last seen: 0 ms ago
Information elements from Probe Response frame:
SSID: WLAN-AP
Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
DS Parameter set: channel 3
Country: DE Environment: Indoor/Outdoor
Channels [1 - 13] @ 20 dBm
Power constraint: 0 dB
TPC report: TX power: 17 dBm
ERP: Barker_Preamble_Mode
Extended supported rates: 6.0 9.0 12.0 48.0
RSN: * Version: 1
* Group cipher: CCMP
* Pairwise ciphers: CCMP
* Authentication suites: PSK
* Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
HT capabilities:
Capabilities: 0x21
RX LDPC
HT20
Static SM Power Save
RX HT20 SGI
No RX STBC
Max AMSDU length: 3839 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT RX MCS rate indexes supported: 0-7
HT TX MCS rate indexes are undefined
HT operation:
* primary channel: 3
* secondary channel offset: no secondary
* STA channel width: 20 MHz
* RIFS: 0
* HT protection: non-HT mixed
* non-GF present: 0
* OBSS non-GF present: 1
* dual beacon: 0
* dual CTS protection: 0
* STBC beacon: 0
* L-SIG TXOP Prot: 0
* PCO active: 0
* PCO phase: 0
Extended capabilities: Extended Channel Switching
我发现问题可能是 Android 通常不支持 Ad-Hoc-Wlan。当我明白的时候“iwlist wlan0 扫描”上的 n 模式是的,capability: ESS [...]
表明它不是临时的......
sudo iwconfig wlan0
展示:
wlan0 IEEE 802.11 Mode:Master Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
也许您有什么想法,有什么问题以及如何纠正?
(PS:DNS和DHCP已在Raspberry上设置并且正在工作)
isc-dhcp-server log
:
Dec 19 10:46:30 webcam dhcpd[646]: Wrote 1 leases to leases file.
Dec 19 10:46:31 webcam dhcpd[646]:
Dec 19 10:46:31 webcam dhcpd[646]: No subnet declaration for eth0 (192.168.0.56).
Dec 19 10:46:31 webcam dhcpd[646]: ** Ignoring requests on eth0. If this is not what
Dec 19 10:46:31 webcam dhcpd[646]: you want, please write a subnet declaration
Dec 19 10:46:31 webcam dhcpd[646]: in your dhcpd.conf file for the network segment
Dec 19 10:46:31 webcam dhcpd[646]: to which interface eth0 is attached. **
Dec 19 10:46:31 webcam dhcpd[646]:
Dec 19 10:46:31 webcam dhcpd[649]: Server starting service.
Dec 19 10:46:33 webcam isc-dhcp-server[628]: Starting ISC DHCPv4 server: dhcpd.
Dec 19 10:46:33 webcam dhcpd[704]: Wrote 0 NA, 0 TA, 0 PD leases to lease file.
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: No subnet6 declaration for eth0 (fe80::2e0:4eff:fe37:e6da).
Dec 19 10:46:33 webcam dhcpd[704]: ** Ignoring requests on eth0. If this is not what
Dec 19 10:46:33 webcam dhcpd[704]: you want, please write a subnet6 declaration
Dec 19 10:46:33 webcam dhcpd[704]: in your dhcpd.conf file for the network segment
Dec 19 10:46:33 webcam dhcpd[704]: to which interface eth0 is attached. **
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: No subnet6 declaration for wlan0 (fe80::ba27:ebff:fe64:ab17).
Dec 19 10:46:33 webcam dhcpd[704]: ** Ignoring requests on wlan0. If this is not what
Dec 19 10:46:33 webcam dhcpd[704]: you want, please write a subnet6 declaration
Dec 19 10:46:33 webcam dhcpd[704]: in your dhcpd.conf file for the network segment
Dec 19 10:46:33 webcam dhcpd[704]: to which interface wlan0 is attached. **
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: Not configured to listen on any interfaces!
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: If you think you have received this message due to a bug rather
Dec 19 10:46:33 webcam dhcpd[704]: than a configuration issue please read the section on submitting
Dec 19 10:46:33 webcam dhcpd[704]: bugs on either our web page at www.isc.org or in the README file
Dec 19 10:46:33 webcam dhcpd[704]: before submitting a bug. These pages explain the proper
Dec 19 10:46:33 webcam dhcpd[704]: process and the information we find helpful for debugging..
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: exiting.
Dec 19 10:46:35 webcam isc-dhcp-server[628]: Starting ISC DHCPv6 server: dhcpd6check syslog for diagnostics. ... failed!
dnsmasq.log
:
Dec 19 10:46:27 webcam systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Dec 19 10:46:27 webcam dnsmasq[507]: dnsmasq: syntax check OK.
Dec 19 10:46:28 webcam dnsmasq[544]: started, version 2.76 cachesize 150
Dec 19 10:46:28 webcam dnsmasq[544]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Dec 19 10:46:28 webcam dnsmasq[544]: DNS service limited to local subnets
Dec 19 10:46:28 webcam dnsmasq[544]: reading /run/dnsmasq/resolv.conf
Dec 19 10:46:28 webcam dnsmasq[544]: using nameserver 192.168.0.1#53
Dec 19 10:46:28 webcam dnsmasq[544]: read /etc/hosts - 6 addresses
Dec 19 10:46:29 webcam dnsmasq[545]: Too few arguments.
Dec 19 10:46:29 webcam systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
hostapd.log
:
Dec 19 10:46:28 webcam hostapd[509]: Starting advanced IEEE 802.11 management: hostapd.
Dec 19 10:46:44 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: associated
Dec 19 10:46:44 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: disassociated
Dec 19 10:52:54 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: associated
Dec 19 10:52:54 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: disassociated
答案1
isc-dhcp-服务器日志:
Dec 19 10:46:30 webcam dhcpd[646]: Wrote 1 leases to leases file.
Dec 19 10:46:31 webcam dhcpd[646]:
Dec 19 10:46:31 webcam dhcpd[646]: No subnet declaration for eth0 (192.168.0.56).
Dec 19 10:46:31 webcam dhcpd[646]: ** Ignoring requests on eth0. If this is not what
Dec 19 10:46:31 webcam dhcpd[646]: you want, please write a subnet declaration
Dec 19 10:46:31 webcam dhcpd[646]: in your dhcpd.conf file for the network segment
Dec 19 10:46:31 webcam dhcpd[646]: to which interface eth0 is attached. **
Dec 19 10:46:31 webcam dhcpd[646]:
Dec 19 10:46:31 webcam dhcpd[649]: Server starting service.
Dec 19 10:46:33 webcam isc-dhcp-server[628]: Starting ISC DHCPv4 server: dhcpd.
Dec 19 10:46:33 webcam dhcpd[704]: Wrote 0 NA, 0 TA, 0 PD leases to lease file.
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: No subnet6 declaration for eth0 (fe80::2e0:4eff:fe37:e6da).
Dec 19 10:46:33 webcam dhcpd[704]: ** Ignoring requests on eth0. If this is not what
Dec 19 10:46:33 webcam dhcpd[704]: you want, please write a subnet6 declaration
Dec 19 10:46:33 webcam dhcpd[704]: in your dhcpd.conf file for the network segment
Dec 19 10:46:33 webcam dhcpd[704]: to which interface eth0 is attached. **
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: No subnet6 declaration for wlan0 (fe80::ba27:ebff:fe64:ab17).
Dec 19 10:46:33 webcam dhcpd[704]: ** Ignoring requests on wlan0. If this is not what
Dec 19 10:46:33 webcam dhcpd[704]: you want, please write a subnet6 declaration
Dec 19 10:46:33 webcam dhcpd[704]: in your dhcpd.conf file for the network segment
Dec 19 10:46:33 webcam dhcpd[704]: to which interface wlan0 is attached. **
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: Not configured to listen on any interfaces!
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: If you think you have received this message due to a bug rather
Dec 19 10:46:33 webcam dhcpd[704]: than a configuration issue please read the section on submitting
Dec 19 10:46:33 webcam dhcpd[704]: bugs on either our web page at www.isc.org or in the README file
Dec 19 10:46:33 webcam dhcpd[704]: before submitting a bug. These pages explain the proper
Dec 19 10:46:33 webcam dhcpd[704]: process and the information we find helpful for debugging..
Dec 19 10:46:33 webcam dhcpd[704]:
Dec 19 10:46:33 webcam dhcpd[704]: exiting.
Dec 19 10:46:35 webcam isc-dhcp-server[628]: Starting ISC DHCPv6 server: dhcpd6check syslog for diagnostics. ... failed!
dnsmasq-日志:
Dec 19 10:46:27 webcam systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Dec 19 10:46:27 webcam dnsmasq[507]: dnsmasq: syntax check OK.
Dec 19 10:46:28 webcam dnsmasq[544]: started, version 2.76 cachesize 150
Dec 19 10:46:28 webcam dnsmasq[544]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Dec 19 10:46:28 webcam dnsmasq[544]: DNS service limited to local subnets
Dec 19 10:46:28 webcam dnsmasq[544]: reading /run/dnsmasq/resolv.conf
Dec 19 10:46:28 webcam dnsmasq[544]: using nameserver 192.168.0.1#53
Dec 19 10:46:28 webcam dnsmasq[544]: read /etc/hosts - 6 addresses
Dec 19 10:46:29 webcam dnsmasq[545]: Too few arguments.
Dec 19 10:46:29 webcam systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
hostapd 日志
Dec 19 10:46:28 webcam hostapd[509]: Starting advanced IEEE 802.11 management: hostapd.
Dec 19 10:46:44 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: associated
Dec 19 10:46:44 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: disassociated
Dec 19 10:52:54 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: associated
Dec 19 10:52:54 webcam hostapd: wlan0: STA 88:75:98:4b:ef:f2 IEEE 802.11: disassociated