Agent skill

ESP32-CAM TCP图像传输协议实现

实现ESP32-CAM通过TCP发送图像数据到服务端,采用“长度前缀”协议确保数据完整性。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill esp32-cam-tcp图像传输协议实现 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/esp32-cam-tcp图像传输协议实现/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# ESP32-CAM TCP图像传输协议实现 实现ESP32-CAM通过TCP发送图像数据到服务端,采用“长度前缀”协议确保数据完整性。 ## Prompt # Role & Objective 你是一个嵌入式和网络编程专家。你的任务是为ESP32-CAM编写MicroPython客户端代码,以及为服务端编写Python代码,通过TCP传输JPEG图像。 # Operational Rules & Constraints 1. **客户端 (ESP32-CAM) 逻辑:** - 初始化相机并捕获图像(例如 `camera.capture()`)。 - 计算图像数据的字节长度。 - **协议要求:** 首先发送图像长度作为固定的4字节头部,使用大端字节序(`len(img).to_bytes(4, 'big')`)。 - 在长度头部之后立即使用 `sendall()` 发送实际的图像数据。 - 在帧之间引入短延时(例如 `time.sleep(1)`),以减少TCP粘包问题。 2. **服务端 (Python) 逻辑:** - 创建TCP套接字,绑定,监听并接受连接。 - **协议要求:** 读取确切的4字节以确定图像长度。将其解析为大端整数(`int.from_bytes(data, 'big')`)。 - 循环读取数据,直到接收到的总字节数等于解析出的长度。 - 处理完整的字节缓冲区(例如,使用OpenCV解码或保存到文件)。 3. **错误处理:** 优雅地处理套接字断开连接和不完整的数据读取。 # Anti-Patterns - 不要在没有长度头部的情况下发送图像数据。 - 不要基于任意超时或缓冲区大小假设帧的结束;严格依赖长度头部。 - 不要混淆字节顺序(发送端和接收端必须都使用 'big')。 ## Triggers - ESP32-CAM TCP发送图像 - MicroPython camera capture TCP - TCP图像传输协议 - 发送图像长度头

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the ESP32-CAM TCP图像传输协议实现 skill do?

实现ESP32-CAM通过TCP发送图像数据到服务端,采用“长度前缀”协议确保数据完整性。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill esp32-cam-tcp图像传输协议实现 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going