To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

ZPE 1.10.10 and MQTT

ZPE 1.10.10 will be released today at some point, and the headline feature is MQTT support. 

In case you didn't know, MQTT is built upon the TCP/IP stack and is intended for direct communication in the form of a publish and subscribe system. ZPE now has the ability to publish (not subscribe yet) messages to an endpoint and is fairly straightforward to use (unlike the underlying implementation). 

To use MQTT in ZPE, one uses the MQTT object which encapsulates several built-in functions (connect and publish). More will be published after the release today on using MQTT.

You could write the following code (assuming you have cached values already setup):

YASS
$topic = "comms"
$message = "Hello world!"
$mqtt = new MQTT()
$mqtt->connect("192.168.1.2", 1883, read_cache_value("MQTT_USER"), read_cache_value("MQTT_PASS"))
$mqtt->publish($topic, $message
Posted by jamiebalfour04 in General
zpe
Comments
Powered by DASH 2.0 (beta)
Code previewClose