---
title: "OpenWrt 与嵌入式设备错误 | Wantastic Docs"
description: "路由器和模块上的 kmod-tun、只读闪存、procd、闪存已满、时钟错误和 BusyBox 问题。"
url: "https://wantastic.app/zh/docs/errors-openwrt-embedded"
category: "Troubleshooting"
reading_time: "5 分钟"
---

# OpenWrt 与嵌入式设备错误

路由器和模块上的 kmod-tun、只读闪存、procd、闪存已满、时钟错误和 BusyBox 问题。

> **Outcome:** wantasticd 作为服务运行，重启后仍然运行，且设备处于 Online 状态。

## Before you start

- 设备上的 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. TUN：ls -l /dev/net/tun。
2. 空间：df -h /overlay（约需 6 MB）。
3. 时钟：date -u。
4. 日志：logread -e wantasticd | tail -n 50。

*失败：缺少 kmod-tun，随后修复: 安装 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 exist
$ root@OpenWrt:~# opkg update && opkg install kmod-tun
$ root@OpenWrt:~# /etc/init.d/wantasticd restart
$ root@OpenWrt:~# wantasticd status
Status      Connected
```

## 速查表

| 错误或现象 | 最简单的修复方法 |
| --- | --- |
| /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。 |

## Verify the result

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

## Common issues

### 缺少 TUN 设备。

```
Failed to start agent: create device: create tun: CreateTUN("wantastic0") failed; /dev/net/tun does not exist
```

- **Where:** logread (OpenWrt)
- **Likely cause:** 未安装 kmod-tun。
- **Fix:** 安装 kmod-tun 并重启服务。

Shell (root):

```bash
opkg update && opkg install kmod-tun
/etc/init.d/wantasticd restart
```

- **Verify:** logread 中出现 "Created TUN interface: wantastic0"。

### 安装期间闪存为只读。

```
Error: could not remount <mount> read-write. Run as root or unlock the filesystem.
```

- **Where:** install.sh
- **Likely cause:** 固件为只读或已锁定，或你不是 root。
- **Fix:** 以 root 身份登录并重新运行安装程序。在锁定的固件上，将二进制文件安装到可写分区并设置 WANTASTIC_CONFIG_DIR。

Shell (root):

```bash
wget -qO- https://get.wantastic.app/install.sh | sh; wantasticd genkey
```

- **Verify:** 安装程序输出 "Done."

### 闪存已满。

```
Error: <dir> is still not writable after remounting <mount>
```

- **Where:** install.sh
- **Likely cause:** /overlay 没有剩余空间。
- **Fix:** 删除不用的软件包，然后重新运行安装程序。

Shell (root):

```bash
df -h /overlay
opkg list-installed
```

- **Verify:** 安装程序输出 "Done."

### procd 服务状态异常。

```
Error: procd service did not become healthy
```

- **Where:** install.sh (OpenWrt)
- **Likely cause:** 设备尚未认领，或缺少 kmod-tun。
- **Fix:** 安装 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
```

- **Verify:** wantasticd status 显示 Connected。

### HTTPS 下载失败。

```
wget failed: <url>
```

- **Where:** install.sh / 自动更新
- **Likely cause:** wget 不支持 HTTPS、缺少 CA 证书包，或时钟错误。
- **Fix:** 安装 HTTPS 支持并设置时钟。

Shell (root):

```bash
opkg update && opkg install wget-ssl ca-bundle
ntpd -q -p pool.ntp.org
```

- **Verify:** wget -qO- https://get.wantastic.app/latest 输出版本号。

### 时钟停在 1970 年、认领被拒绝或出现 HTTPS 错误。

- **Where:** 没有电池时钟的设备
- **Likely cause:** 设备没有实时时钟（RTC），且 NTP 尚未同步。认领要求时间误差在 30 秒以内。
- **Fix:** 在开机时启用 NTP，然后重新认领。

Shell (root):

```bash
uci set system.ntp.enabled='1'
uci commit system
/etc/init.d/sysntpd restart
date -u
```

- **Verify:** date -u 显示当前时间。

### BusyBox 设备在更新后运行了两个代理进程。

- **Where:** BusyBox / inittab
- **Likely cause:** BusyBox 启动脚本忽略 restart，并启动了第二个副本。
- **Fix:** 在服务命令中添加 --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
```

- **Verify:** 只有一个 wantasticd 进程。

### BusyBox 上循环重启。

- **Where:** BusyBox / inittab
- **Likely cause:** 由于设备尚未认领，inittab 会不断重启服务。
- **Fix:** 使用 genkey 认领设备，按 Ctrl+C，然后停止旧进程。inittab 会重新启动它。

Shell (root):

```bash
wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
killall wantasticd
```

- **Verify:** wantasticd status 显示 Connected。

### OpenWrt 上的 DNS 提示。

```
OpenWrt DNS is managed by the OpenWrt backend
```

- **Where:** logread
- **Likely cause:** 这只是提示信息。OpenWrt 自行管理 DNS。
- **Fix:** 无需操作。

- **Verify:** 域名解析正常。

### 仪表板中内存以 TB 为单位显示。

- **Where:** 控制台（旧版代理）
- **Likely cause:** 旧版本中的单位错误。
- **Fix:** 更新 wantasticd。

Shell (root):

```bash
wantasticd update
```

- **Verify:** 数值以 GB 为单位显示。

### Quectel 模块在固件更新后丢失配置。

- **Where:** Quectel RM520N-GL
- **Likely cause:** 配置必须位于 /usrdata 中才能保留。
- **Fix:** 检查 /usrdata/wantastic/etc/config.conf 是否存在。如果不存在，请运行快速安装并重新认领。

Shell (root):

```bash
ls -l /usrdata/wantastic/etc/config.conf
```

- **Verify:** 重启后设备处于 Online 状态。

## Continue with

- [Troubleshooting: start here](https://wantastic.app/zh/docs/troubleshooting): Fix most problems in 3 steps. If that does not work, find your exact error in the table and open the matching guide.
- [Install on OpenWrt](https://wantastic.app/zh/docs/install-openwrt): Install wantasticd on an OpenWrt router in 2 minutes over SSH: add the TUN driver, run one wget command, scan a QR code, click Claim Device.
- [Install on BusyBox / embedded Linux](https://wantastic.app/zh/docs/install-embedded-busybox): Install wantasticd on minimal BusyBox devices without systemd, procd or OpenRC: one wget command, scan a QR code, click Claim Device.
- [Install on Quectel RM520N-GL](https://wantastic.app/zh/docs/install-quectel-rm520n): Install wantasticd on a Quectel RM520N-GL or other Qualcomm SDX 5G module over ADB in 2 minutes: one command, scan a QR code, click Claim Device.
- [Install on MIPS routers](https://wantastic.app/zh/docs/install-mips-routers): Install wantasticd on MIPS routers and boards: one command tells you the CPU type, then copy the matching install block and claim the router with a QR code.
- [Connect and runtime errors](https://wantastic.app/zh/docs/errors-connect-runtime): Fix service start failures, config errors, TUN problems, missing handshakes and DNS warnings.
