小米盒子 4C Armbian 安装与 WiFi MAC 修复记录
设备信息
· 型号:小米盒子 4C (MDZ-20-AA)
· 芯片:Amlogic S905L
使用的固件与方式
· 固件:Armbian_26.05.0_amlogic_s905l_noble_6.12.87_server_2026.05.15.img.gz
· 方式:U盘 + 有线键盘 + USB分线器(主动供电)
遇到的问题与解决方法
参考了 issue #3520 中 Youjar 大佬的办法,修改设备树为 /dtb/amlogic/meson-gxl-s905l-venz-v10.dtb。U盘启动后遇到无法联网的问题,MAC 地址全为 ff:ff:ff:ff:ff:ff。折腾了几天,通过以下流程解决:
- 临时设置 MAC 并联网
sudo ip link set wlan0 address 02:11:22:33:44:55
sudo ip link set wlan0 up
sudo systemctl restart NetworkManager
sleep 3
sudo nmcli device set wlan0 managed yes
sudo nmcli radio wifi on
sudo nmcli device wifi rescan
sudo nmcli device wifi list
sudo nmcli device wifi connect "你的WiFi名称" password "你的WiFi密码"
ip -4 addr show wlan0 | grep inet
-
尝试永久化(U盘环境有效,但刷入 eMMC 后失效)
最初我尝试用 base64 解码生成 systemd 服务,在 U盘运行时重启不会掉网。但刷入 eMMC 后(使用的是 116 版本),由于启动时序问题,网络再次断开,旧方法执行无果。
-
eMMC 环境最终修复方案(推荐)
后来在 Minimax M3 的指导下,通过编写独立的等待脚本并调整 systemd 依赖时序,彻底解决了问题。为了避免终端复制粘贴长命令导致文件写入失败,强烈建议使用 nano 编辑器来创建以下文件。
步骤 1:创建修复脚本
在终端输入以下命令打开编辑器:
sudo nano /usr/local/bin/wifi-mac-fix.sh
进入编辑器后,将以下代码完整复制并粘贴进去:
#!/bin/bash
LOG_PREFIX="wifi-mac-fix:"
MAC_ADDR="02:11:22:33:44:55"
# 等待 wlan0 设备就绪(最长 30 秒)
for i in (seq 1 30); do
if [ -e /sys/class/net/wlan0 ]; then
# 检查无线网卡驱动是否加载完成
if [ "(cat /sys/class/net/wlan0/operstate 2>/dev/null)" != "" ] || \
[ -d /sys/class/net/wlan0/phy80211 ]; then
# 设置 MAC 地址并启动接口
/sbin/ip link set wlan0 down 2>/dev/null
/sbin/ip link set wlan0 address "MAC_ADDR"
/sbin/ip link set wlan0 up
# 记录成功日志
logger "LOG_PREFIX MAC set to (ip link show wlan0 | awk '/ether/ {print 2}')"
exit 0
fi
fi
sleep 1
done
# 超时未找到设备,记录错误日志
logger "LOG_PREFIX wlan0 not ready after 30s, giving up!"
exit 1
保存并退出:按 Ctrl + O 保存,按 Enter 确认,然后按 Ctrl + X 退出。
步骤 2:赋予脚本执行权限(关键!)
sudo chmod +x /usr/local/bin/wifi-mac-fix.sh
步骤 3:创建 Systemd 服务
在终端输入以下命令打开编辑器:
sudo nano /etc/systemd/system/wifi-mac-fix.service
(注意:如果里面已有旧的错误内容,请全部删除后,再粘贴以下新内容)
[Unit]
Description=Fix WiFi MAC for Xiaomi Box 4C (Post-NM Fix)
After=systemd-udevd.service systemd-modules-load.service network.target NetworkManager.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/wifi-mac-fix.sh
RemainAfterExit=yes
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
保存并退出:按 Ctrl + O 保存,按 Enter 确认,然后按 Ctrl + X 退出。
步骤 4:重载并启用服务
sudo systemctl daemon-reload
sudo systemctl enable wifi-mac-fix.service
sudo systemctl restart wifi-mac-fix.service
步骤 5:验证服务状态
systemctl status wifi-mac-fix.service
如果看到绿色的 active (exited),且日志显示 MAC set to 02:11:22:33:44:55,说明修复成功!重启设备后 WiFi 也会自动连接。
当前状态
· 系统启动成功
· SSH 连接正常
· WiFi 连接正常
致谢
· 感谢 ophub 大佬的辛勤维护,让这些电视盒子得以重生!
· 感谢 Youjar 大神撰写的运行记录,为我的工作提供了莫大帮助与参考价值。为了表示敬意,我使用了和他一样的 issue 格式。再次致谢!
· 附:本人纯小白,第一次折腾这么复杂的项目,一步步问着 AI 来的。特别推荐 Minimax M3,先后���了 DeepSeek 和 Qwen 都没解决这个时序问题,最后靠它搞定了。
Xiaomi Box 4C Armbian Installation & WiFi MAC Fix Record
Device Information
· Model: Xiaomi Box 4C (MDZ-20-AA)
· Chipset: Amlogic S905L
Firmware and Method
· Firmware: Armbian_26.05.0_amlogic_s905l_noble_6.12.87_server_2026.05.15.img.gz
· Method: USB drive + wired keyboard + USB hub (externally powered)
Issues Encountered and Solutions
Referring to issue #3520, I followed the method by user Youjar to change the device tree to /dtb/amlogic/meson-gxl-s905l-venz-v10.dtb. After booting from the USB drive, I encountered a network issue: the MAC address was all ff:ff:ff:ff:ff:ff. After several days of troubleshooting, I managed to connect using the following steps:
- Temporary MAC setting and connection
sudo ip link set wlan0 address 02:11:22:33:44:55
sudo ip link set wlan0 up
sudo systemctl restart NetworkManager
sleep 3
sudo nmcli device set wlan0 managed yes
sudo nmcli radio wifi on
sudo nmcli device wifi rescan
sudo nmcli device wifi list
sudo nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD"
ip -4 addr show wlan0 | grep inet
-
Attempted permanent fix (Worked on USB, failed on eMMC)
Initially, I tried using base64 decoding to generate a systemd service. It worked when rebooting from the USB drive. However, after flashing to eMMC (using version 116), the network dropped again due to boot timing issues, and the old method failed.
-
Final fix for eMMC environment (Recommended)
Later, under the guidance of Minimax M3, I completely solved the problem by writing a standalone waiting script and adjusting the systemd dependency timing. To avoid file writing failures caused by copy-pasting long commands in the terminal, it is highly recommended to use the nano editor to create the following files.
Step 1: Create the fix script
Open the editor by typing:
sudo nano /usr/local/bin/wifi-mac-fix.sh
Copy and paste the following code into the editor:
#!/bin/bash
LOG_PREFIX="wifi-mac-fix:"
MAC_ADDR="02:11:22:33:44:55"
# Wait for wlan0 device to be ready (up to 30 seconds)
for i in (seq 1 30); do
if [ -e /sys/class/net/wlan0 ]; then
# Check if the wireless driver has finished loading
if [ "(cat /sys/class/net/wlan0/operstate 2>/dev/null)" != "" ] || \
[ -d /sys/class/net/wlan0/phy80211 ]; then
# Set MAC address and bring up the interface
/sbin/ip link set wlan0 down 2>/dev/null
/sbin/ip link set wlan0 address "MAC_ADDR"
/sbin/ip link set wlan0 up
# Log success
logger "LOG_PREFIX MAC set to (ip link show wlan0 | awk '/ether/ {print 2}')"
exit 0
fi
fi
sleep 1
done
# Timeout, log error
logger "LOG_PREFIX wlan0 not ready after 30s, giving up!"
exit 1
Save and exit: Press Ctrl + O to save, press Enter to confirm, then press Ctrl + X to exit.
Step 2: Grant execute permission (Crucial!)
sudo chmod +x /usr/local/bin/wifi-mac-fix.sh
Step 3: Create Systemd service
Open the editor by typing:
sudo nano /etc/systemd/system/wifi-mac-fix.service
(Note: If there is any old/incorrect content inside, delete it all before pasting the new content below)
[Unit]
Description=Fix WiFi MAC for Xiaomi Box 4C (Post-NM Fix)
After=systemd-udevd.service systemd-modules-load.service network.target NetworkManager.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/wifi-mac-fix.sh
RemainAfterExit=yes
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Save and exit: Press Ctrl + O to save, press Enter to confirm, then press Ctrl + X to exit.
Step 4: Reload and enable the service
sudo systemctl daemon-reload
sudo systemctl enable wifi-mac-fix.service
sudo systemctl restart wifi-mac-fix.service
Step 5: Verify service status
systemctl status wifi-mac-fix.service
If you see a green active (exited) and the log shows MAC set to 02:11:22:33:44:55, the fix is successful! WiFi will connect automatically after rebooting.
Current Status
· System boots successfully
· SSH connection is normal
· WiFi connection is normal
Thanks
· Thanks to ophub for the great work, giving these TV boxes a second life!
· Thanks to Youjar for writing the operation log, which provided tremendous help and reference value for my work. As a token of respect, I formatted my issue in the same style. Thanks again!
· P.S. I'm a complete beginner, and this is my first time tackling such a complex project. I've been asking AI for help step by step. I highly recommend Minimax M3 — I tried DeepSeek and Qwen first, but neither of them could solve this timing issue. Finally got it done with its help.

小米盒子 4C Armbian 安装与 WiFi MAC 修复记录
设备信息
· 型号:小米盒子 4C (MDZ-20-AA)
· 芯片:Amlogic S905L
使用的固件与方式
· 固件:Armbian_26.05.0_amlogic_s905l_noble_6.12.87_server_2026.05.15.img.gz
· 方式:U盘 + 有线键盘 + USB分线器(主动供电)
遇到的问题与解决方法
参考了 issue #3520 中 Youjar 大佬的办法,修改设备树为 /dtb/amlogic/meson-gxl-s905l-venz-v10.dtb。U盘启动后遇到无法联网的问题,MAC 地址全为 ff:ff:ff:ff:ff:ff。折腾了几天,通过以下流程解决:
尝试永久化(U盘环境有效,但刷入 eMMC 后失效)
最初我尝试用 base64 解码生成 systemd 服务,在 U盘运行时重启不会掉网。但刷入 eMMC 后(使用的是 116 版本),由于启动时序问题,网络再次断开,旧方法执行无果。
eMMC 环境最终修复方案(推荐)
后来在 Minimax M3 的指导下,通过编写独立的等待脚本并调整 systemd 依赖时序,彻底解决了问题。为了避免终端复制粘贴长命令导致文件写入失败,强烈建议使用 nano 编辑器来创建以下文件。
步骤 1:创建修复脚本
在终端输入以下命令打开编辑器:
进入编辑器后,将以下代码完整复制并粘贴进去:
保存并退出:按 Ctrl + O 保存,按 Enter 确认,然后按 Ctrl + X 退出。
步骤 2:赋予脚本执行权限(关键!)
步骤 3:创建 Systemd 服务
在终端输入以下命令打开编辑器:
(注意:如果里面已有旧的错误内容,请全部删除后,再粘贴以下新内容)
保存并退出:按 Ctrl + O 保存,按 Enter 确认,然后按 Ctrl + X 退出。
步骤 4:重载并启用服务
sudo systemctl daemon-reload sudo systemctl enable wifi-mac-fix.service sudo systemctl restart wifi-mac-fix.service步骤 5:验证服务状态
如果看到绿色的 active (exited),且日志显示 MAC set to 02:11:22:33:44:55,说明修复成功!重启设备后 WiFi 也会自动连接。
当前状态
· 系统启动成功
· SSH 连接正常
· WiFi 连接正常
致谢
· 感谢 ophub 大佬的辛勤维护,让这些电视盒子得以重生!
· 感谢 Youjar 大神撰写的运行记录,为我的工作提供了莫大帮助与参考价值。为了表示敬意,我使用了和他一样的 issue 格式。再次致谢!
· 附:本人纯小白,第一次折腾这么复杂的项目,一步步问着 AI 来的。特别推荐 Minimax M3,先后���了 DeepSeek 和 Qwen 都没解决这个时序问题,最后靠它搞定了。
Xiaomi Box 4C Armbian Installation & WiFi MAC Fix Record
Device Information
· Model: Xiaomi Box 4C (MDZ-20-AA)
· Chipset: Amlogic S905L
Firmware and Method
· Firmware: Armbian_26.05.0_amlogic_s905l_noble_6.12.87_server_2026.05.15.img.gz
· Method: USB drive + wired keyboard + USB hub (externally powered)
Issues Encountered and Solutions
Referring to issue #3520, I followed the method by user Youjar to change the device tree to /dtb/amlogic/meson-gxl-s905l-venz-v10.dtb. After booting from the USB drive, I encountered a network issue: the MAC address was all ff:ff:ff:ff:ff:ff. After several days of troubleshooting, I managed to connect using the following steps:
Attempted permanent fix (Worked on USB, failed on eMMC)
Initially, I tried using base64 decoding to generate a systemd service. It worked when rebooting from the USB drive. However, after flashing to eMMC (using version 116), the network dropped again due to boot timing issues, and the old method failed.
Final fix for eMMC environment (Recommended)
Later, under the guidance of Minimax M3, I completely solved the problem by writing a standalone waiting script and adjusting the systemd dependency timing. To avoid file writing failures caused by copy-pasting long commands in the terminal, it is highly recommended to use the nano editor to create the following files.
Step 1: Create the fix script
Open the editor by typing:
Copy and paste the following code into the editor:
Save and exit: Press Ctrl + O to save, press Enter to confirm, then press Ctrl + X to exit.
Step 2: Grant execute permission (Crucial!)
Step 3: Create Systemd service
Open the editor by typing:
(Note: If there is any old/incorrect content inside, delete it all before pasting the new content below)
Save and exit: Press Ctrl + O to save, press Enter to confirm, then press Ctrl + X to exit.
Step 4: Reload and enable the service
sudo systemctl daemon-reload sudo systemctl enable wifi-mac-fix.service sudo systemctl restart wifi-mac-fix.serviceStep 5: Verify service status
If you see a green active (exited) and the log shows MAC set to 02:11:22:33:44:55, the fix is successful! WiFi will connect automatically after rebooting.
Current Status
· System boots successfully
· SSH connection is normal
· WiFi connection is normal
Thanks
· Thanks to ophub for the great work, giving these TV boxes a second life!
· Thanks to Youjar for writing the operation log, which provided tremendous help and reference value for my work. As a token of respect, I formatted my issue in the same style. Thanks again!
· P.S. I'm a complete beginner, and this is my first time tackling such a complex project. I've been asking AI for help step by step. I highly recommend Minimax M3 — I tried DeepSeek and Qwen first, but neither of them could solve this timing issue. Finally got it done with its help.