- Home
- Skills
- Zhanghandong
- Rust Skills
- Domain Iot
domain-iot_skill
- Shell
565
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill zhanghandong/rust-skills --skill domain-iot- SKILL.md4.3 KB
Overview
This skill captures IoT domain constraints and practical design guidance for building reliable, low-power, and secure IoT applications. It maps high‑level rules (network unreliability, power limits, security, OTA) into concrete design constraints and Rust implementation patterns. The guidance covers embedded (no_std) and gateway (std) environments, recommended crates, and common pitfalls to avoid.
How this skill works
The skill inspects domain rules and translates them into layered design implications: offline‑first buffering, power management, secure comms, and safe OTA. It recommends implementation patterns (store & forward, edge compute, sleep cycles), specific Rust crates for each environment, and example code patterns such as an MQTT client with retry and local persistence. It also highlights typical mistakes and corrective measures like exponential backoff and TLS.
When to use it
- Designing battery-powered sensors or actuators that must conserve energy.
- Building gateways that bridge constrained devices to cloud services.
- Implementing reliable telemetry where networks are intermittent.
- Planning secure OTA firmware updates and rollback strategies.
- Choosing crates and patterns for no_std embedded targets vs tokio-based gateways.
Best practices
- Adopt offline-first: persist a local queue and flush on connectivity with retry/backoff.
- Prioritize power: use sleep/wake cycles, minimize allocations, consider no_std where appropriate.
- Secure everything: use TLS, signed firmware, and authenticated topics for MQTT.
- Design for recovery: watchdogs, timeouts, and clear rollback paths for OTA.
- Prefer edge compute: filter/aggregate at the device to reduce network and cloud load.
Example use cases
- A battery sensor that buffers readings locally, sleeps between wakes, and uploads when the gateway is reachable.
- A Linux gateway that uses tokio and rumqttc to aggregate device telemetry and forward to cloud endpoints.
- An MCU implementing embassy and embedded-hal with defmt logging and no_std footprints.
- Firmware OTA pipeline that verifies signatures and supports rollback on failure.
- A hybrid edge setup that preprocesses data on gateways to reduce cloud costs and latency.
FAQ
Use AtLeastOnce (QoS 1) for telemetry to balance delivery guarantees and performance; use QoS 2 only when strict deduplication is required.
How do I handle network outages without losing data?
Persist messages locally in a queue, apply exponential backoff for retries, and drain the queue when connectivity returns.