Skip to content

IoTMI Hub SDK — Code Walkthrough

The IoTMI Hub SDK is a modular smart-home hub platform that bridges cloud services (AWS IoT) with local wireless devices (Zigbee, Z-Wave, WiFi). At its core, an IPC framework connects independent processes — a cloud-facing MQTT Proxy, a Device Agent that translates cloud commands, and a CDMB router that dispatches work to protocol-specific plugins. These plugins talk to middleware daemons built on the ACE framework, which drive radios through a HAL abstraction. Everything rests on shared configuration, logging, and certificate utilities.

5,668 source files analyzed across 10 core abstractions.

📄 Download the SDK Architecture Overview (PDF)

Architecture Overview

graph TD
    Config["Configuration, Logging<br>& Certificates"] --> |"provides config/logging"| IPC["IPC Framework"]
    IPC --> |"transports MQTT traffic"| MQTT["MQTT Proxy"]
    MQTT --> |"delivers cloud messages"| Agent["Device Agent"]
    Agent --> |"sends commands via IPC"| CDMB["CDMB"]
    CDMB --> |"routes to protocol plugins"| Plugins["Protocol CDMB Plugins<br>(Zigbee & Z-Wave)"]
    Plugins --> |"calls middleware APIs"| MWServices["Middleware Protocol<br>Services & HAL"]
    MWServices --> |"built on"| ACE["ACE Middleware Framework"]
    MQTT --> |"used for fleet provisioning"| HubOnboard["Hub Onboarding"]
    HubOnboard --> |"reads certs and config"| Config
    LPW["LPW Provisioner"] --> |"coordinates over IPC"| IPC
    LPW --> |"publishes status via"| MQTT

    style Config fill:#e8f5e9
    style ACE fill:#e3f2fd
    style IPC fill:#fff3e0
    style MWServices fill:#e3f2fd
    style MQTT fill:#fff3e0
    style HubOnboard fill:#fce4ec
    style CDMB fill:#f3e5f5
    style Plugins fill:#f3e5f5
    style Agent fill:#fff9c4
    style LPW fill:#fce4ec

Chapters

# Chapter Description
1 Configuration, Logging & Certificate Management Foundational utilities — key-value config, pluggable logging, certificate lifecycle
2 ACE Middleware Framework OSAL, AIPC shared-memory RPC, EventMgr pub/sub, Dispatcher work queues
3 IPC Framework NNG-based Unix domain socket communication between SDK processes
4 Middleware Protocol Services & HAL Zigbee/Z-Wave/WiFi daemons, HAL abstraction, protocol gateways
5 MQTT Proxy Single-connection cloud multiplexer with client registration
6 Hub Onboarding & Fleet Provisioning Hub registration with AWS IoT Core (FP and JITR)
7 Common Data Model Bridge (CDMB) JSON command router with eNId-prefix protocol dispatch
8 Protocol CDMB Plugins Zigbee ZCL and Z-Wave CC translators
9 Device Agent Cloud↔device orchestrator with dual AWS/Matter data models
10 LPW Provisioner Device onboarding coordinator with RadioInterface plugin pattern

Reading Order

The chapters are ordered pedagogically — each builds on concepts from previous chapters:

  1. Foundations (Ch 1-2): Config, logging, certificates, and the ACE framework
  2. Communication (Ch 3-5): IPC, middleware services, and MQTT cloud connectivity
  3. Cloud Integration (Ch 6): Hub's own registration with AWS IoT Core
  4. Device Control (Ch 7-8): Command routing and protocol translation
  5. Orchestration (Ch 9-10): The Agent that ties it all together, and device onboarding

End-to-End Data Flow

Cloud (AWS IoT Core)
    ↕ MQTT
MQTT Proxy (single connection multiplexer)
    ↕ IPC (NNG Unix sockets)
Device Agent (AWS↔Matter model translation)
    ↕ IPC
CDMB (routes by eNId prefix: zw./zb./mt.)
    ↕ function call
Protocol Plugin (Zigbee ZCL / Z-Wave CC translation)
    ↕ AIPC (shared memory RPC)
Middleware Service (protocol daemon with HSM)
    ↕ HAL
Protocol Gateway (zware / Z3 Gateway)
    ↕ Serial/SPI/USB
Radio Hardware (Z-Wave chip / Zigbee chip / WiFi)

Generated from 5,668 source files across the IoTMI Hub SDK codebase.