使用搜索功能查看 Kepware 的信息库,其中包含 500 多篇知识库文章。缩小搜索结果范围,或在下面的搜索字段中输入您的查询。

或者,如果您无法找到解决方案,我们还有另一个资源:我们的 PTC eSupport Portal。 如果系统提示您登录 eSupport Portal,您可以使用“我的 Kepware”凭据。需要一个“我的 Kepware”帐户吗?在此处创建

搜索解决方案结果:
View All Solutions

Kepware Knowledge Base: Solution


Can I Set up a Mosquitto MQTT Broker to Receive KEPServerEX IoT Gateway Messages?


Last Update: 2019/3/18
Yes!
Setting up a Mosquitto MQTT Broker to Receive KEPServerEX IoT Gateway Messages
 
The KEPServerEX IoT Gateway Plug-in does not include an MQTT broker. A third-party broker, such as Mosquitto, may be configured to receive messages from the IoT Gateway Plug-in agent. Follow these instructions to setup Mosquitto on a Microsoft Windows computer or refer to the vendor instructions.
Tip: The Mosquitto broker may be installed on the machine running KEPServerEX and the IoT Gateway Plug-in.
 
Prerequisites:
Mosquitto relies on the Microsoft C++ 2015 resdistributable. The following should be installed before Mosquitto according to its documentation:
  • Microsoft Visual C++ 2015 Redistributables
    • Link: http://www.microsoft.com/en-us/download/details.aspx?id=48145
    • Install vcredist_x86.exe
Installation:
Install Mosquitto.
  • Link http://mosquitto.org/download/
  • Install the Windows Binary mosquitto-<version>-install-win32.exe (Native build, Windows Vista or higher)
Running Mosquitto:
  1. To start the broker, open a command prompt by clicking on Start | All Programs | Accessories | Command Prompt.
  2. In the command prompt, navigate to the Mosquitto root folder, such as C:\Program Files (x86)\mosquitto.
  3. Start the Mosquitto service by running the command: "net start mosquitto".
  4. Acknowledge the message: The Mosquitto Broker service was started successfully.
Connecting to the Mosquitto Broker:
  1. Follow the steps in the KEPServerEX IoT Gateway Plug-in help system to setup an MQTT agent.
  2. In the agent, the URL is tcp://<IP of the broker machine>:1883.
  3. Set the topic (user configurable).
  4. Set the publish rate to a reasonable number, such as 1000ms.
  5. Add a tag to the agent. This tag should change value at least once per the publish interval set in step 4 or be configured to send "every scan" to confirm function.
  6. Once the tag is added, confirm this event log message in KEPServerEX Configuration interface: "MQTT agent <agent> is connected to broker 'tcp://<IP of the broker machine>:1883'"
Verifying the Data:
  1. Open a command prompt by clicking on Start | All Programs | Accessories | Command Prompt.
  2. In the command prompt, navigate to the Mosquitto root folder, such as C:\Program Files (x86)\mosquitto.
  3. Start the Mosquitto subscription service by running the command: "mosquitto_sub.exe -t #" where " t #" instructs the mosquitto_sub program to display data published to all topics on the Mosquito broker.
  4. Verify the data IoT Gateway Plugin is publishing to the Mosquitto Broker appears in the command window.
Congratulations!