tertiarycourses/C852-Agentic-AI-for-IoT

GitHub: tertiarycourses/C852-Agentic-AI-for-IoT

一套教授如何使用ESP8266、IoTFlow和n8n构建受治理的物联网智能体系统的实操课程及配套实验。

Stars: 0 | Forks: 0

# 用于 IoT 的 Agentic AI [![课程](https://img.shields.io/badge/Course-C852-1f6feb?style=for-the-badge)](https://www.tertiarycourses.com.sg/agentic-ai-for-iot.html) [![ESP8266](https://img.shields.io/badge/Edge-ESP8266-E7352C?style=for-the-badge&logo=espressif&logoColor=white)](https://www.espressif.com/en/products/socs/esp8266) [![IoTFlow](https://img.shields.io/badge/IoT_Platform-IoTFlow-0ea5e9?style=for-the-badge)](https://iot.tertiaryinfotech.com/) [![n8n](https://img.shields.io/badge/Workflow-n8n-EA4B71?style=for-the-badge&logo=n8n&logoColor=white)](https://n8n.io/) [![许可证](https://img.shields.io/badge/License-Educational-fbbf24?style=for-the-badge)](#license) **用于构建受治理的 Agentic IoT 系统的实操课程和配套实验室 —— 涵盖从 ESP8266 传感、IoTFlow 遥测到有边界的 n8n 决策与行动循环。** [📘 课程页面](https://www.tertiarycourses.com.sg/agentic-ai-for-iot.html) · [📖 分步实验室](labs/README.md) · [🐛 报告 Bug](https://github.com/tertiarycourses/C852-Agentic-AI-for-IoT/issues) · [💡 请求功能](https://github.com/tertiarycourses/C852-Agentic-AI-for-IoT/issues)
## 实验室活动 **实验 1 — [定义温室守护者合约并验证工具链](labs/lab-01-define-the-greenhouse-guardian-contract-and-verify-the-toolchain.md)** · 定义职责、安全边界、停止条件和版本;验证 ESP8266 和 Node.js 工具链。 **实验 2 — [在 IoTFlow 中注册 ESP8266 并验证遥测](labs/lab-02-register-the-esp8266-in-iotflow-and-prove-telemetry.md)** · 注册温室节点 A,发送经过认证的遥测数据,并验证 IoTFlow 中稳定的数据合约。 **实验 3 — [连接 DHT11 并流式传输经过验证的 TLS 遥测数据](labs/lab-03-wire-the-dht11-and-stream-validated-tls-telemetry.md)** · 构建物理或模拟传感器节点,在发布有序遥测数据之前验证读数。 **实验 4 — [添加安全的 IoTFlow 下行链路和执行器故障保护](labs/lab-04-add-a-safe-iotflow-downlink-and-actuator-fail-safe.md)** · 添加允许列表的虚拟引脚命令、幂等状态处理和本地自动关闭故障保护。 **实验 5 — [构建并进行温室策略 Agent 边界测试](labs/lab-05-build-and-boundary-test-the-greenhouse-policy-agent.md)** · 在回放数据上运行透明的有状态策略,并证明其在边界处的提议和停止决策。 **实验 6 — [将 IoTFlow 事件连接到 n8n Agent 工作流](labs/lab-06-connect-iotflow-events-to-an-n8n-agent-workflow.md)** · 将经过认证的 IoTFlow 事件路由到 n8n,标准化观测结果,并生成可审计的有界提议。 **实验 7 — [设计安全的多设备部署与故障处理手册](labs/lab-07-design-the-secure-multi-device-deployment-and-failure-runbook.md)** · 为由三台设备组成集群定义设备范围、secret 引用、监控、分阶段推出和恢复方案。 **实验 8 — [部署并验证端到端 Agentic IoT 循环](labs/lab-08-deploy-and-verify-the-end-to-end-agentic-iot-loop.md)** · 部署受控的 node-A 循环,将决策与物理反馈匹配,并演示回滚到提议模式和 OFF 状态。 ## 关于 此仓库包含由 Tertiary Courses / Tertiary Infotech 提供的 **Agentic AI for IoT (C852)** 的完整配套包:培训师和学员幻灯片、学员指南、课程计划、八个配套实验室和可重用的实验资源。实践工作逐步构建一个**温室守护者**,从设备合约和 ESP8266 传感器节点,演变为使用 IoTFlow、n8n 和可验证反馈的受治理 Agentic IoT 部署。 ### 你将学到什么 | # | 实验室 | 概念 | |---|-----|----------| | **1** | **合约与工具链** | Agentic IoT 职责、信任边界、停止条件、ESP8266 设置 | | **2** | **IoTFlow 注册和遥测** | 设备身份、经过认证的 HTTP、指标 schema、仪表板、secret 管理 | | **3** | **经过验证的传感器数据流** | DHT11 接线、采样、验证、序列和质量字段、基于 TLS 的 MQTT | | **4** | **安全的下行链路和执行器** | 命令允许列表、虚拟引脚、幂等性、本地自动关闭和故障保护状态 | | **5** | **有边界的策略 Agent** | 目标、状态、滞后、新鲜度、回放测试、提议和审计日志 | | **6** | **IoTFlow 到 n8n 的工作流** | 经过认证的 webhook、标准化、决策状态、固定的工具边界 | | **7** | **安全集群设计** | 部署 manifest、secret 引用、监控、分阶段推出和运行手册 | | **8** | **受控的端到端循环** | 命令门控、相关性证据、反馈验证、回滚和恢复 | ## 技术栈 | 类别 | 技术 | |----------|------------| | **边缘硬件** | ESP8266 开发板、DHT11 传感器和内置 LED 执行器 | | **固件** | Arduino IDE 2.x、Arduino/C++、ESP8266 core、PubSubClient、DHT 和 ArduinoJson 库 | | **IoT 平台** | [IoTFlow](https://iot.tertiaryinfotech.com/) 用于设备身份、遥测、仪表板、事件、自动化和下行链路状态 | | **协议** | 经过认证的 HTTPS 和基于经过证书验证的 TLS 的 MQTT | | **Agent 工作流** | [n8n](https://n8n.io/) Webhook、Code、IF、Respond 和 HTTP Request 节点 | | **策略与验证** | Node.js 20+、确定性 JSON 策略、JSONL 回放和集群模拟 | | **模型咨询** | 可选的经培训师批准的 OpenAI 兼容 endpoint;物理命令仍受策略门控 | | **课程材料** | PowerPoint/PDF 幻灯片、Word/PDF 学员指南和课程计划、Markdown 实验指南 | ## 架构 ``` DAY 1 — Connect, Sense and Act DHT11 / replay ─▶ ESP8266 validation ─▶ authenticated HTTP or MQTT ─▶ IoTFlow telemetry IoTFlow V1 command ─▶ firmware allowlist ─▶ LED actuator ─▶ local 30-second auto-off DAY 2 — Decide, Govern and Deploy IoTFlow event ─▶ authenticated n8n webhook ─▶ normalize + state + policy ├─▶ OBSERVE / STOP └─▶ PROPOSE_ON / PROPOSE_OFF approved controlled mode ─▶ command gate ─▶ fixed IoTFlow device path ─▶ ESP8266 next telemetry ─▶ actuator and environmental feedback ─▶ correlation evidence ``` ## 项目结构 ``` C852-Agentic-AI-for-IoT/ ├── README.md ├── labs/ │ ├── README.md # Lab sequence and setup │ ├── lab-01-*.md … lab-08-*.md # Eight connected learner labs │ └── resources/ # Firmware, policies, workflows and simulators │ ├── courseware/ │ ├── Agentic AI for IoT (C852)-v1.0.pptx # Trainer slides (+ PDF learner copy) │ ├── LG-Agentic AI for IoT (C852).docx # Learner Guide (+ PDF) │ └── LP-Agentic AI for IoT (C852).docx # Lesson Plan (+ PDF) │ ├── reference/SOURCES.md # Authoritative authoring sources └── .agents/skills/non-wsq-courseware-build/ └── build/ # Single-source content and build pipeline ``` ## 入门指南 ### 前置条件 - 一台 Windows 或 Mac 笔记本电脑,配备当前的浏览器、PowerShell 7 和 Node.js 20 或更高版本 - Arduino IDE 2.x 以及 ESP8266 Boards Manager 软件包 - 一块 ESP8266 开发板、DHT11 模块、面包板、跳线和一条支持数据传输的 USB 线;当硬件不可用时,实验室提供模拟替代方案 - PubSubClient、Adafruit DHT 传感器库、Adafruit Unified Sensor 和 ArduinoJson - 一个免费的 [IoTFlow](https://iot.tertiaryinfotech.com/) 账号,以及用于实时工作流实验的课堂 n8n 实例的访问权限 - 培训师发出的入站 webhook secret,以及用于实时工作流实验的经批准的认证事件传递方法 ### 1. 克隆仓库 ``` git clone https://github.com/tertiarycourses/C852-Agentic-AI-for-IoT.git cd C852-Agentic-AI-for-IoT ``` ### 2. 验证工具链 ``` pwsh --version node --version ``` 打开 Arduino IDE,安装 ESP8266 开发板支持和所需的库,然后验证是否可以使用正确的开发板和端口。切勿提交真实的 Wi-Fi 密码、设备 token、webhook secret 或 API key。 ### 3. 按顺序完成实验室 打开[实验索引](labs/README.md),创建那里显示的 `greenhouse-workspace` 文件夹,并在编辑之前将提供的资源复制到工作区中。每个实验室都会产生下一个实验室所需的检查点。 ### 4. 重新生成配套的课程材料 在 Windows 上使用 Git Bash: ``` COURSE_REPO="$(pwd)" bash .agents/skills/non-wsq-courseware-build/build/build_courseware.sh ``` 讲义、学员指南、课程计划和实验都读取相同的 `course_data.py` 和 `data_domain*.py` 模块,因此课程标识、学习成果、主题顺序和实验顺序保持一致。 ## 许可证 本材料作为 **Agentic AI for IoT (C852)** 的一部分,仅供**教育用途**。© Tertiary Infotech Pte. Ltd. 保留所有权利。 ## 开发者 **Tertiary Infotech Pte. Ltd.** — [Tertiary Courses](https://www.tertiarycourses.com.sg/)
课程:[Agentic AI for IoT (C852)](https://www.tertiarycourses.com.sg/agentic-ai-for-iot.html) ## 鸣谢 - [Espressif](https://www.espressif.com/) 和 ESP8266 Arduino 社区 — 边缘硬件和固件平台 - [IoTFlow](https://iot.tertiaryinfotech.com/) — 设备身份、遥测、仪表板、事件和控制 - [n8n](https://n8n.io/) — 工作流编排 - C852 的课程培训师和学员
⭐ **如果这帮助你学习了 Agentic IoT,请为仓库点个 Star!** 由 [Tertiary Infotech Academy Pte Ltd](https://www.tertiaryinfotech.com/) 提供支持 [📘 课程页面](https://www.tertiarycourses.com.sg/agentic-ai-for-iot.html) · [📖 分步实验室](labs/README.md)
标签:ESP8266, MITM代理, n8n, 工作流自动化, 底层编程, 教程, 物联网