Skip to content

MQTT 数据转发 ​

Publish device data to your MQTT broker in real-time. MQTT forwarding enables seamless integration with IoT platforms, home automation systems, and industrial applications.

Overview ​

Device data is automatically published to your MQTT broker, allowing subscribers to receive updates instantly.

【配图占位:设备数据发布到 MQTT Broker 并被订阅端接收的数据流图】

Quick Start ​

Step 1: Prepare Your MQTT Broker ​

  1. Set up an MQTT broker (or use a cloud service like HiveMQ, EMQX)
  2. Create credentials for YenGear IoT Cloud
  3. Note your broker host, port, and topic

Step 2: Create a Forwarding Profile ​

  1. Go to Org → Data Forwarding
  2. Click + New Profile
  3. Select MQTT as the type
  4. Enter your broker details
  5. Click Save

【配图占位:MQTT 转发配置弹窗截图】

Configuration Options ​

OptionRequiredDescription
HostYesMQTT broker hostname
PortYesBroker port (1883 or 8883 for TLS)
TopicYesTopic to publish messages
UsernameNoAuthentication username
PasswordNoAuthentication password

Message Format ​

Messages are published as JSON:

json
{
  "project_id": "proj-xyz",
  "timestamp": 1709856000,
  "points": [
    {
      "point_id": "POINT_ID_FROM_PLATFORM",
      "value": 25.5,
      "unit": "°C"
    }
  ]
}

Security Tips ​

  • Use port 8883 with TLS encryption
  • Create a dedicated user with publish-only permissions
  • Use strong passwords

Troubleshooting ​

ProblemSolution
Connection refusedVerify broker host and port
Authentication failedCheck username and password
Messages not receivedVerify topic subscription pattern
TLS errorsEnsure TLS is properly configured

Use Cases ​

  • Real-time Monitoring: Subscribe to device updates instantly
  • Home Automation: Integrate with Home Assistant, OpenHAB
  • Industrial IoT: Connect to SCADA systems
  • Cloud Platforms: Stream to AWS IoT, Azure IoT Hub

Need Help? ​

Contact us at [email protected] for technical support.