MQTT Quick Start

Connect your OWON devices โ€” gateways, WiFi meters, and 4G cellular devices โ€” to the OWON MQTT broker.

1. Broker Connection

Parameter Value Notes
Hostmqtt.owon-iot.comGlobal endpoint
Port (TLS)8883Mandatory โ€” no plaintext port
ProtocolMQTT 3.1.1 / 5.0Both versions supported
QoS0, 1, 2Use QoS 1 for reliable delivery
Keep Alive60sRecommended interval

2. Gateway MQTT Setup

OWON ZigBee/WiFi gateways connect to the cloud via MQTT. Each gateway bridges multiple sub-devices and publishes their data to a structured topic namespace.

Topic Structure

gw/{gateway_id}/devices/{device_id}/data โ† Device telemetry (upstream)

gw/{gateway_id}/devices/{device_id}/command โ†’ Device control (downstream)

gw/{gateway_id}/status โ† Gateway online/offline

gw/{gateway_id}/ota โ†’ OTA firmware push

Python example โ€” subscribe to gateway data:

import paho.mqtt.client as mqtt
import json, ssl

# OWON Gateway MQTT Configuration
BROKER = "mqtt.owon-iot.com"
PORT = 8883
GATEWAY_ID = "GW-XXXXXX"
ACCESS_TOKEN = "your_access_token_here"

def on_connect(client, userdata, flags, rc):
    print(f"Connected (rc={rc})")
    client.subscribe(f"gw/{GATEWAY_ID}/devices/+/data")
    client.subscribe(f"gw/{GATEWAY_ID}/status")

def on_message(client, userdata, msg):
    payload = json.loads(msg.payload)
    topic_parts = msg.topic.split("/")
    device_id = topic_parts[3]
    print(f"[{device_id}] Power: {payload['power']}W | Energy: {payload['energy_kwh']}kWh")

client = mqtt.Client(client_id=GATEWAY_ID)
client.username_pw_set(ACCESS_TOKEN)
client.tls_set(cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLS)
client.on_connect = on_connect
client.on_message = on_message
client.connect(BROKER, PORT, keepalive=60)
client.loop_forever()

3. WiFi Device MQTT Setup

WiFi-enabled devices (PC321-TY, PCT513) connect directly to the MQTT broker without a gateway. Each device uses its MAC address as the client ID.

Topic Format

owon/{device_mac}/telemetry โ† Data report

owon/{device_mac}/command โ†’ Control

// OWON WiFi Device (e.g. PC321-TY) MQTT Topics
// When connected directly via WiFi (no gateway):

// Device publishes telemetry to:
//   owon/{device_mac}/telemetry
// Example payload:
{
  "device_mac": "A4:C1:38:xx:xx:xx",
  "model": "PC321-TY",
  "voltage": 220.5,
  "current": 12.3,
  "power": 2712.15,
  "energy_kwh": 1847.6,
  "timestamp": "2026-07-10T08:30:00Z"
}

// Device subscribes to control commands:
//   owon/{device_mac}/command
// Example: Toggle relay
{
  "cmd": "relay",
  "value": 1
}

4. 4G Cellular Device MQTT Setup

4G devices use cellular networks (LTE Cat.1 or NB-IoT). APN configuration is required before the device can connect to the MQTT broker. Devices are identified by IMEI.

# OWON 4G Device MQTT Configuration (Cat.1 / NB-IoT)

# 4G devices connect via cellular โ€” APN must be configured
# Supported bands: LTE Cat.1 (B1/B3/B5/B8/B20)

# Device publishes to:
#   owon/4g/{imei}/telemetry

# Required: Set APN via device config tool or MQTT command
# Example:
mosquitto_pub -h mqtt.owon-iot.com -p 8883 \
  -u "YOUR_ACCESS_TOKEN" -P "YOUR_PASSWORD" \
  -t "owon/4g/86XXXXXXXXXXXXXX/config" \
  -m '{"apn":"internet","mqtt_host":"mqtt.owon-iot.com"}' \
  --cafile /etc/ssl/certs/ca-certificates.crt

# Data reporting interval: configurable (default 15 min)
# Supports: voltage, current, power, energy, temperature readings

5. MQTT Configuration Apps

Use our mobile apps to configure MQTT parameters (broker, credentials, topics) on WiFi and 4G devices.

๐ŸŽ

OWON Device Config โ€” iOS

MQTT parameter setup, device diagnostics, firmware check

Download on App Store โ†’
๐Ÿค–

OWON Device Config โ€” Android

MQTT parameter setup, device diagnostics, firmware check

Download APK โ†’

Need MQTT credentials or integration support?

Our engineering team provisions MQTT access tokens and provides onboarding assistance.

Contact Engineering Team โ†’