How to Use MQTT in PHP

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • MQTT-Client-Examples

    MQTT Client Examples

  • require('vendor/autoload.php'); use \PhpMqtt\Client\MqttClient; use \PhpMqtt\Client\ConnectionSettings; $server = 'broker.emqx.io'; $port = 1883; $clientId = rand(5, 15); $username = 'emqx_user'; $password = null; $clean_session = false; $connectionSettings = new ConnectionSettings(); $connectionSettings ->setUsername($username) ->setPassword(null) ->setKeepAliveInterval(60) ->setLastWillTopic('emqx/test/last-will') ->setLastWillMessage('client disconnect') ->setLastWillQualityOfService(1); $mqtt = new MqttClient($server, $port, $clientId); $mqtt->connect($connectionSettings, $clean_session); printf("client connected\n"); $mqtt->subscribe('emqx/test', function ($topic, $message) { printf("Received message on topic [%s]: %s\n", $topic, $message); }, 0); for ($i = 0; $i< 10; $i++) { $payload = array( 'protocol' => 'tcp', 'date' => date('Y-m-d H:i:s'), 'url' => 'https://github.com/emqx/MQTT-Client-Examples' ); $mqtt->publish( // topic 'emqx/test', // payload json_encode($payload), // qos 0, // retain true ); printf("msg $i send\n"); sleep(1); } $mqtt->loop(true);

  • PHPT

    The PHP Interpreter

  • PHP is a widely-used open source multi-purpose scripting language, which can be embedded in HTML and is especially suitable for Web development.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How to share your TwigComponent with your team ?

    1 project | dev.to | 15 May 2024
  • Spring Tests with TestContainers

    2 projects | dev.to | 15 May 2024
  • React Native Testing Options Overview

    3 projects | dev.to | 14 May 2024
  • Integrating Testkube With Azure Pipelines For Continuous Testing

    2 projects | dev.to | 14 May 2024
  • Collecting JavaScript code coverage with Capybara in Ruby on Rails application

    6 projects | dev.to | 14 May 2024