2017 © Pedro Peláez
 

library laravel-mqtt-publish

A simple Laravel 5 mqtt publisher

image

luzhuqun/laravel-mqtt-publish

A simple Laravel 5 mqtt publisher

  • Monday, May 22, 2017
  • by luzhuqun
  • Repository
  • 1 Watchers
  • 8 Stars
  • 684 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 1 Versions
  • 37 % Grown

The README.md

Laravel Mqtt Publisher

Mqtt is used to publish messages from backend to andriod., (*1)

Getting start

composer require luzhuqun/laravel-mqtt-publish, (*2)

How to use

use Lzq\Mqtt\SamMessage;
use Lzq\Mqtt\SamConnection;

$conn = new SAMConnection();//create a new connection object

$conn->connect('mqtt', array('SAM_HOST' => '192.168.10.147', 'SAM_PORT' => '1883'));//start initialise the connection

$msgCpu = new SAMMessage('hehe');//create a new MQTT message with the output of the shell command as the body

$conn->send('topic://'.'tokudu/ab7867d9fd60db65', $msgCpu);//send the message on the topic cpu

$conn->disconnect();

Learn more

A complet mqtt service incluede publisher, service and subscriber., (*3)

service

mosquitto, (*4)

subscriber

AndroidPushNotificationsDemo, (*5)

The Versions

22/05 2017

dev-master

9999999-dev

A simple Laravel 5 mqtt publisher

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Avatar luzhuqun

laravel l5 service provider publish mqtt