OpenWrt 与嵌入式设备错误
路由器和模块上的 kmod-tun、只读闪存、procd、闪存已满、时钟错误和 BusyBox 问题。
wantasticd 作为服务运行,重启后仍然运行,且设备处于 Online 状态。
开始之前
- 设备上的 root shell(SSH)。
- 设备可以访问互联网。
开始之前
大多数问题是缺少 TUN 模块、闪存已满、缺少 HTTPS 支持或时钟停在 1970 年。以下步骤可解决常见情况。
- 日志:logread -e wantasticd | tail -n 50。
- Alpine:使用 rc-service wantasticd restart 重启。BusyBox:运行 killall wantasticd,inittab 会重新启动它。
- Quectel RM520N-GL 将配置保存在 /usrdata/wantastic/etc/config.conf。
ntpd -q -p pool.ntp.org
opkg update && opkg install kmod-tun
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart检查要点
- 1TUN:ls -l /dev/net/tun。
- 2空间:df -h /overlay(约需 6 MB)。
- 3时钟:date -u。
- 4日志:logread -e wantasticd | tail -n 50。
$ root@OpenWrt:~# logread -e wantasticd | tail -n 1daemon.err wantasticd[2210]: Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist1$ root@OpenWrt:~# opkg update && opkg install kmod-tun$ root@OpenWrt:~# /etc/init.d/wantasticd restart$ root@OpenWrt:~# wantasticd statusStatus Connected
- 1缺少 TUN 模块
速查表
| 错误或现象 | 最简单的修复方法 |
|---|---|
| /dev/net/tun does not exist | opkg install kmod-tun。 |
| could not remount … read-write | 以 root 身份运行;固件可能已锁定。 |
| still not writable after remounting | 释放闪存空间。 |
| procd service did not become healthy | kmod-tun,然后使用 genkey 认领。 |
| wget failed / HTTP … downloading | 安装 wget-ssl 和 ca-bundle;校正时钟。 |
| 时钟停在 1970 年 | 启用 NTP。 |
验证结果
错误与解决方法
缺少 TUN 设备。Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not existlogread (OpenWrt)
未安装 kmod-tun。
安装 kmod-tun 并重启服务。
opkg update && opkg install kmod-tun
/etc/init.d/wantasticd restart安装期间闪存为只读。Error: could not remount <mount> read-write. Run as root or unlock the filesystem.install.sh
固件为只读或已锁定,或你不是 root。
以 root 身份登录并重新运行安装程序。在锁定的固件上,将二进制文件安装到可写分区并设置 WANTASTIC_CONFIG_DIR。
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey闪存已满。Error: <dir> is still not writable after remounting <mount>install.sh
/overlay 没有剩余空间。
删除不用的软件包,然后重新运行安装程序。
df -h /overlay
opkg list-installedprocd 服务状态异常。Error: procd service did not become healthyinstall.sh (OpenWrt)
设备尚未认领,或缺少 kmod-tun。
安装 kmod-tun,使用 genkey 认领设备,然后重启服务。
opkg update && opkg install kmod-tun
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restartHTTPS 下载失败。wget failed: <url>install.sh / 自动更新
wget 不支持 HTTPS、缺少 CA 证书包,或时钟错误。
安装 HTTPS 支持并设置时钟。
opkg update && opkg install wget-ssl ca-bundle
ntpd -q -p pool.ntp.org时钟停在 1970 年、认领被拒绝或出现 HTTPS 错误。没有电池时钟的设备
设备没有实时时钟(RTC),且 NTP 尚未同步。认领要求时间误差在 30 秒以内。
在开机时启用 NTP,然后重新认领。
uci set system.ntp.enabled='1'
uci commit system
/etc/init.d/sysntpd restart
date -uBusyBox 设备在更新后运行了两个代理进程。BusyBox / inittab
BusyBox 启动脚本忽略 restart,并启动了第二个副本。
在服务命令中添加 --no-auto-update,然后手动更新。
pgrep -a wantasticd
# edit /etc/init.d/wantasticd: exec <bin> connect --config <cfg> --no-auto-update
kill -HUP 1BusyBox 上循环重启。BusyBox / inittab
由于设备尚未认领,inittab 会不断重启服务。
使用 genkey 认领设备,按 Ctrl+C,然后停止旧进程。inittab 会重新启动它。
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
killall wantasticdOpenWrt 上的 DNS 提示。OpenWrt DNS is managed by the OpenWrt backendlogread
这只是提示信息。OpenWrt 自行管理 DNS。
无需操作。
仪表板中内存以 TB 为单位显示。控制台(旧版代理)
旧版本中的单位错误。
更新 wantasticd。
wantasticd updateQuectel 模块在固件更新后丢失配置。Quectel RM520N-GL
配置必须位于 /usrdata 中才能保留。
检查 /usrdata/wantastic/etc/config.conf 是否存在。如果不存在,请运行快速安装并重新认领。
ls -l /usrdata/wantastic/etc/config.conf继续阅读
仍然无法解决?
请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。