Docs / Getting started / QuickstartQuickstart

Quickstart — 5 minut k první hodnotě

Quickstart — 5 minutes to your first reading

Tento návod vás vede od nula k živé Modbus telemetrii v cloudu. Předpokládá Docker, Modbus-TCP zařízení v dosahu a Azure subscription. Pokud něco z toho chybí, zavolejte.

This guide takes you from zero to live Modbus telemetry in the cloud. Assumes Docker, a reachable Modbus-TCP device, and an Azure subscription. Missing any of these? Call.

✓ Produkční · v1.17.7✓ Production · v1.17.7 5 min5 min Žádný formulářNo form

# 1 · Stáhnout edge modulPull the edge module

Image je veřejný na ACR. Stačí docker pull:

The image is public on ACR. Just docker pull:

bashpowershell
# Pull production edge module
docker pull eccregistry.azurecr.io/ecc-edge-module:1.1.1

# Run with your IoT Hub connection string
docker run -d --name ecc-edge \
  -e IOTHUB_DEVICE_CONNECTION_STRING="HostName=..." \
  eccregistry.azurecr.io/ecc-edge-module:1.1.1
Pozn:Note: ICO gateway nasazení obvykle používá Azure IoT Edge runtime místo přímého docker run. Pro ostré provozy doporučujeme. ICO gateway deployments typically use Azure IoT Edge runtime instead of plain docker run. Recommended for production.

# 2 · Definujte Modbus mapováníDefine Modbus mapping

Konfigurace edge modulu žije v Azure Device Twin. Push desired properties a modul se hot-reload <3 s.

Edge config lives in the Azure Device Twin. Push desired properties and the module hot-reloads in <3 s.

device-twin.jsonaz cli
{
  "ModbusConfig": {
    "devices": {
      "PCS_1": {
        "connection": {
          "host": "192.168.5.101",
          "port": 502,
          "unit_id": 1
        },
        "operations": [
          {
            "address": "32",
            "name": "ActivePower",
            "function_code": 3,
            "data_type": "Int32",
            "frequency": 30000,
            "unit": "0.1kW",
            "send_on_change": false
          }
        ]
      }
    }
  }
}

Parametry operations[]

operations[] parameters

FieldTypTypePopisDescription
addressstringModbus adresa (5/6-digit nebo přímá 0-based)Modbus address (5/6-digit or direct 0-based)
function_codeint3 = holding, 4 = input, 6 = write single3 = holding, 4 = input, 6 = write single
data_typeenumUInt16 · Int16 · UInt32 · Int32 · Float32 · String · Bitfield
frequencyintPerioda v ms (min 1 000, doporučeno 30 000)Period in ms (min 1 000, recommended 30 000)
unitstringJednotka se škálováním, např. "0.1kW"Unit with scale, e.g. "0.1kW"

# 3 · Ověřte první hodnotuVerify the first reading

Sledujte ingest na IoT Hub stream. Měli byste vidět JSON zprávu během ~30 sekund od push Twin:

Monitor the IoT Hub ingest stream. You should see a JSON message within ~30 seconds of the Twin push:

bash
# Stream incoming telemetry
az iot hub monitor-events \
  --hub-name ecc-iothub \
  --timeout 60

# Expected output:
#  "deviceId": "PCS_1",
#  "timestamp": "2026-06-12T12:34:18Z",
#  "data": { "ActivePower": 16.3 }

# 4 · Dotaz na telemetrii přes RESTQuery telemetry via REST

Telemetrie je dostupná přes FastAPI REST. JWT autentizace, multi-tenant scope na každém dotazu:

Telemetry exposes through FastAPI REST. JWT auth, multi-tenant scope on every query:

curlpythonnode
# Get a JWT
curl -X POST https://eccontrol.org/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@site.cz","password":"..."}'

# Fetch latest telemetry
curl https://eccontrol.org/api/v1/devices/PCS_1/telemetry \
  -H "Authorization: Bearer $JWT"

Dotaz nepasuje na váš stack?

Stuck on your stack?

Edge modul podporujeme s vámi krok za krokem po telefonu. Žádný gatekeeper.

We walk through the edge module step-by-step over the phone. No gatekeeper.

📞 +420 725 594 801

# 5 · Co dálWhat next