文档/故障排查5 分钟

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。
OpenWrt (root)bash
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

检查要点

  1. 1TUN:ls -l /dev/net/tun。
  2. 2空间:df -h /overlay(约需 6 MB)。
  3. 3时钟:date -u。
  4. 4日志:logread -e wantasticd | tail -n 50。
失败:缺少 kmod-tun,随后修复
$ root@OpenWrt:~# logread -e wantasticd | tail -n 1
daemon.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 status
Status Connected
  1. 1缺少 TUN 模块
安装 kmod-tun 并重启服务。

速查表

错误或现象最简单的修复方法
/dev/net/tun does not existopkg install kmod-tun。
could not remount … read-write以 root 身份运行;固件可能已锁定。
still not writable after remounting释放闪存空间。
procd service did not become healthykmod-tun,然后使用 genkey 认领。
wget failed / HTTP … downloading安装 wget-ssl 和 ca-bundle;校正时钟。
时钟停在 1970 年启用 NTP。

验证结果

wantasticd status 显示 Connected。
重启后设备处于 Online 状态。

错误与解决方法

缺少 TUN 设备。Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not existlogread (OpenWrt)
原因

未安装 kmod-tun。

解决方法

安装 kmod-tun 并重启服务。

Shell (root)bash
opkg update && opkg install kmod-tun
/etc/init.d/wantasticd restart
验证: logread 中出现 "Created TUN interface: wantastic0"。
安装期间闪存为只读。Error: could not remount <mount> read-write. Run as root or unlock the filesystem.install.sh
原因

固件为只读或已锁定,或你不是 root。

解决方法

以 root 身份登录并重新运行安装程序。在锁定的固件上,将二进制文件安装到可写分区并设置 WANTASTIC_CONFIG_DIR。

Shell (root)bash
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
验证: 安装程序输出 "Done."
闪存已满。Error: <dir> is still not writable after remounting <mount>install.sh
原因

/overlay 没有剩余空间。

解决方法

删除不用的软件包,然后重新运行安装程序。

Shell (root)bash
df -h /overlay
opkg list-installed
验证: 安装程序输出 "Done."
procd 服务状态异常。Error: procd service did not become healthyinstall.sh (OpenWrt)
原因

设备尚未认领,或缺少 kmod-tun。

解决方法

安装 kmod-tun,使用 genkey 认领设备,然后重启服务。

Shell (root)bash
opkg update && opkg install kmod-tun
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
/etc/init.d/wantasticd restart
验证: wantasticd status 显示 Connected。
HTTPS 下载失败。wget failed: <url>install.sh / 自动更新
原因

wget 不支持 HTTPS、缺少 CA 证书包,或时钟错误。

解决方法

安装 HTTPS 支持并设置时钟。

Shell (root)bash
opkg update && opkg install wget-ssl ca-bundle
ntpd -q -p pool.ntp.org
验证: wget -qO- https://get.wantastic.app/latest 输出版本号。
时钟停在 1970 年、认领被拒绝或出现 HTTPS 错误。没有电池时钟的设备
原因

设备没有实时时钟(RTC),且 NTP 尚未同步。认领要求时间误差在 30 秒以内。

解决方法

在开机时启用 NTP,然后重新认领。

Shell (root)bash
uci set system.ntp.enabled='1'
uci commit system
/etc/init.d/sysntpd restart
date -u
验证: date -u 显示当前时间。
BusyBox 设备在更新后运行了两个代理进程。BusyBox / inittab
原因

BusyBox 启动脚本忽略 restart,并启动了第二个副本。

解决方法

在服务命令中添加 --no-auto-update,然后手动更新。

Shell (root)bash
pgrep -a wantasticd
# edit /etc/init.d/wantasticd: exec <bin> connect --config <cfg> --no-auto-update
kill -HUP 1
验证: 只有一个 wantasticd 进程。
BusyBox 上循环重启。BusyBox / inittab
原因

由于设备尚未认领,inittab 会不断重启服务。

解决方法

使用 genkey 认领设备,按 Ctrl+C,然后停止旧进程。inittab 会重新启动它。

Shell (root)bash
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
killall wantasticd
验证: wantasticd status 显示 Connected。
OpenWrt 上的 DNS 提示。OpenWrt DNS is managed by the OpenWrt backendlogread
原因

这只是提示信息。OpenWrt 自行管理 DNS。

解决方法

无需操作。

验证: 域名解析正常。
仪表板中内存以 TB 为单位显示。控制台(旧版代理)
原因

旧版本中的单位错误。

解决方法

更新 wantasticd。

Shell (root)bash
wantasticd update
验证: 数值以 GB 为单位显示。
Quectel 模块在固件更新后丢失配置。Quectel RM520N-GL
原因

配置必须位于 /usrdata 中才能保留。

解决方法

检查 /usrdata/wantastic/etc/config.conf 是否存在。如果不存在,请运行快速安装并重新认领。

Shell (root)bash
ls -l /usrdata/wantastic/etc/config.conf
验证: 重启后设备处于 Online 状态。

继续阅读

仍然无法解决?

请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。

hello@wantastic.app