1
---
2
name: arduino-azure-iot-edge-integration
3
description: 'Design and implement Arduino integration with Azure IoT Hub and IoT Edge, including secure provisioning, resilient telemetry, command handling, and production guardrails.'
4
---
5
6
# Arduino Azure IoT Edge Integration
7
8
Use this skill when the user needs to connect Arduino-class devices to Azure IoT, especially in edge-heavy scenarios (gateways, intermittent networks, offline buffering, and local actuation).
9
10
## When to use it
11
12
Use this skill for requests such as:
13
14
- "I want to connect Arduino sensors to Azure"
15
- "How do I send MQTT telemetry to IoT Hub?"
16
- "I need an edge gateway for field devices"
17
- "I want cloud-to-device commands and OTA configuration updates"
18
19
## Mandatory documentation review
20
21
Before recommending an IoT Edge topology or runtime behavior, review:
22
23
- https://learn.microsoft.com/azure/iot-edge/
24
25
If documentation cannot be consulted, proceed with explicit assumptions and highlight them in a dedicated section.
26
27
## Official Arduino references and best practices (required)
28
29
Before proposing firmware, wiring, or communication implementation details, consult official Arduino sources first:
30
31
- https://www.arduino.cc/en/Guide
32
- https://docs.arduino.cc/
33
- https://docs.arduino.cc/language-reference/
34
- references/arduino-official-best-practices.md
35
36
When choosing between implementation alternatives, prioritize official Arduino guidance over community snippets unless there is a clear technical reason to deviate.
37
38
## Objectives
39
40
- Produce a secure end-to-end reference path from the Arduino device to cloud insights.
41
- Handle unstable links (store-and-forward, retries, idempotency).
42
- Define an actionable device and cloud backlog.
43
44
## Integration patterns
45
46
### Pattern A: Arduino direct to IoT Hub
47
48
Use when connectivity is stable and cloud latency is acceptable.
49
50
- Protocol: MQTT over TLS.
51
- Identity: per-device credentials (SAS or X.509).
52
- Telemetry payload: compact JSON with timestamp, device ID, metrics, and optional quality flags.
53
54
### Pattern B: Arduino to local gateway, then IoT Edge
55
56
Use when links are constrained, local control is required, or batching improves cost/reliability.
57
58
- Arduino communicates with a local gateway (serial, BLE, local MQTT, RS-485, Modbus bridge).
59
- The gateway publishes upstream through the IoT Edge runtime and routes data to IoT Hub.
60
- Local modules can filter, aggregate, and trigger actions even during cloud outages.
61
62
## Design flow
63
64
### 1) Device contract
65
66
Define:
67
68
- Sensor catalog and units.
69
- Sampling frequency and expected throughput.
70
- Message schema versioning strategy.
71
- Desired/reported device twin properties to control runtime behavior.
72
73
### 2) Security baseline
74
75
Require:
76
77
- Unique identity per device.
78
- No hardcoded secrets in source code or firmware artifacts.
79
- Credential rotation strategy.
80
- Signed firmware and a controlled update process when possible.
81
82
### 3) Reliability and offline behavior
83
84
Plan and document:
85
86
- Backoff with jitter.
87
- Local queue/buffer strategy with bounded size.
88
- Duplicate suppression or downstream idempotent processing.
89
- Fallback to last-known-good configuration.
90
91
### 4) Cloud and edge routing
92
93
Define routes for:
94
95
- Raw telemetry to cold storage.
96
- Curated telemetry to hot analytics.
97
- Alerts to operations channels.
98
- Commands and configuration back to edge/device.
99
100
### 5) Observability
101
102
Specify minimum operations telemetry:
103
104
- Device heartbeat and firmware version.
105
- Connectivity state transitions.
106
- Message send success/error counters.
107
- Gateway module health and restart reasons.
108
109
## Reuse other skills
110
111
When relevant, combine with:
112
113
- `azure-smart-city-iot-solution-builder` for city-wide architecture and phased rollout.
114
- `azure-resource-visualizer` for relationship diagrams.
115
- `appinsights-instrumentation` for app and service telemetry patterns.
116
117
Also use `references/arduino-official-best-practices.md` as a quality baseline for firmware and hardware recommendations, and `references/arduino-iot-checklist.md` before finalizing architecture or implementation guidance.
118
119
## Required output
120
121
Always provide:
122
123
1. Chosen connectivity pattern and rationale.
124
2. Message contract (fields, units, sample payload).
125
3. Security checklist for identity/credentials/updates.
126
4. Reliability plan (retry, buffering, dedupe).
127
5. Implementation backlog (firmware, gateway, cloud).
128
129
## Output template
130
131
1. Scenario and assumptions
132
2. Recommended architecture
133
3. Device and gateway contract
134
4. Security and reliability controls
135
5. Deployment plan and validation tests
136
137
## Guidelines
138
139
- Do not propose production deployments with shared credentials across devices.
140
- Do not assume always-on connectivity in field deployments.
141
- Do not omit command authorization and auditing in actuator scenarios.
142