juechafun/03-资源/执行脚本-工具技巧-USTONE清理红外指令.md

60 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#领域/工具技巧
#复盘/0
## 一句话描述
[____批量生成红外清理CMD指令____]
---
> 更新时间2026-05-25
# USTONE红外指令批量清理操作步骤
## 功能说明
通过配置 **IP** 地址与 **ids** 参数运行 Python 脚本,批量生成并导出 **curl** 命令行指令,用于快速清理 **USTONE植物墙红外开关门通道数据**
## 前置准备
- 已安装 Python 运行环境及终端执行权限
- 明确目标设备局域网 **IP 地址**(如 `192.168.0.180``192.168.0.181`
- 确认需清理的红外通道编号范围(如 `ir3``ir38`
## 执行步骤
1. 修改 Python 脚本参数,设定目标设备 IP 与红外 ID 范围:
```python
# ######## 参数设置 ########
IP = "192.168.1.180"
ids = []
ids.extend(range(3, 39))
# #########################
for id in ids:
code = """curl -X POST http://""" + IP + """/v3 -d "{\\"ir"""
code += str(id)
code += '\\":0}"'
print(code)
```
2. 运行脚本,程序将逐行输出对应的 **curl** 清理指令。选中控制台全部输出内容并复制。
3. 打开系统 CMD命令提示符窗口右键粘贴生成的指令集并回车执行。终端执行示例如下
```bash
# 清理植物墙左侧红外开关门指令
# ir7 开门 ir8 关门
curl -X POST http://192.168.0.180/v3 -d "{\"ir7\":0}"
curl -X POST http://192.168.0.180/v3 -d "{\"ir8\":0}"
# 清理植物墙右侧红外开关门指令
# ir7 开门 ir8 关门
curl -X POST http://192.168.0.181/v3 -d "{\"ir7\":0}"
curl -X POST http://192.168.0.181/v3 -d "{\"ir1\":2}"
```
## 结果验证
- CMD 终端无 `Could not resolve host` 或连接拒绝报错,各 **curl** 请求均正常发送。
- 对应设备端红外通道(如 `ir7`、`ir8`)状态已重置或清理完成,开门/关门指令缓存被清除。
# -------- RAG END -------