移远EC25EU 4G模块可防止RaspAP在没有GSM连接时启动



我有一个Raspberry Pi 4 B+,安装了Sixfab 4G/3G底座帽子和移远EC25-EU 4G/LTE PCIe模块。我运行了 RaspAP 的配置略有修改:

  • /var/www/html/rasp而不是/var/www/html为根文件夹
  • lighttpd位于端口803上,以免与nginx的实例相交,该实例在端口80上运行,并以/var/www/html作为根(这会有问题吗?
  • 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

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

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摄氏度,正好通过移远模块。覆盆子的运行温度高达71°C,但没有更热。 从Raspberry的角度来看,我不认为这是一个热量问题,因为它总是在启动时发生,但如果4G服务下降,也会在运行时发生,这可能是由于热量而发生的。欢迎任何证实这一假设的想法。我正在尝试解决这个问题!

解决方案似乎是编辑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 的电源问题,因为很多事情都是如此。

最新更新