0

我有一个安装了 Sixfab 4G/3G 基础帽和 Quectel EC25-EU 4G/LTE PCIe 模块的 Raspberry Pi 4 B+。我让 RaspAP 运行,配置稍作修改:

  • /var/www/html/rasp而不是/var/www/html作为根文件夹
  • lighttpd位于端口上803,以免与 的实例相交,该实例nginx在端口上运行80并以/var/www/htmlroot 身份运行(这可能有问题吗?)
  • 更改 SSID 和密码以适合我
  • dnsmasqdhcpcd配置是标准的 RaspAP 配置

问题: 当 4G 调制解调器没有服务时,RaspAP 在重新启动后几乎整整 10 分钟都无法启动。错误日志表明wlan0接口不可用。日志没有告诉我足够的信息。当我运行这个命令时:

sudo /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

它输出:

Configuration file: /etc/hostapd/hostapd.conf
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
nl80211: kernel reports: Match already configured
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/hostapd/wlan0' manually if it is not used anymore
Failed to setup control interface for wlan0
wlan0: Unable to setup interface.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED 
wlan0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface wlan0 wasn't started
nl80211: deinit ifname=wlan0 disabled_11b_rates=0

wlan0在设置 RaspAP 之前,我没有连接到任何无线互联网或更改任何设置。在 AP 启动之前的某个时间,运行dmesg会出现以下错误:

ieee80211 phy0: brcmf_cfg80211_stop_ap: setting AP mode failed -52

我还应该注意dmesg,每次启动时也会显示这一点,无论是否安装了 RaspAP:

[    9.639873] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

我用两个不同的帽子和调制解调器复制了这个问题,在两个不同的 Raspberry Pi 4B 上,我在第三个 Raspberry 上用两个调制解调器之一进行了测试,尽管没有任何 nginx,但它工作正常。我很难想象 nginx 可以做到这一点。到目前为止,我唯一的理论是基于这样一个事实,即在当前配置 ECM 模式之前,两个调制解调器都已配置为 PPP 和可能的 QMI 模式。我还没有找到“清理”他们的固件的方法,可能是旧配置与 Raspbian 的网络管理器相交,从而阻止了某些事情吗?

这些组件都在一个塑料外壳中。我测量了里面的温度,通过移远模块已经达到了 45 摄氏度。Raspberry 的运行温度高达 71 C,但不会更热。从 Raspberry 的角度来看,我认为这不是发热问题,因为它总是在启动时发生,但如果 4G 服务下降,也可能在运行时发生,这可能是由于发热而发生的。任何证实这一假设的想法都将受到欢迎。我想尽办法解决这个问题!

4

1 回答 1

0

解决方案似乎是编辑hostapd.service文件 ( /lib/systemd/system/hostapd.service) 并添加After=network-online.target到该[Unit]部分。这大致转化为在网络接口启动时等待,直到它们有一个地址(据我所知)。这里的好来源。

我已经在有和没有 GSM 服务的情况下对其进行了多次测试。重新启动后热点仅需要大约 10-20 秒即可显示在 Wifi 扫描中。我还没有排除热量起作用的可能性,如果它在操作期间而不是在启动时发生故障。

一个更粗劣的解决方案是添加ExecStartPre=/bin/sleep 15到该[Service]部分以强制操作系统延迟启动服务。似乎,由于某种原因我仍然不明白,如果hostapd启动得太早,它会挂起 10 分钟,因为wlan0界面还没有准备好。我怀疑这可能是 Pi 的电源问题,就像很多事情一样。

于 2021-04-27T10:57:36.060 回答