Questions tagged [phpmqtt]

a simple php class to connect/publish/subscribe to a MQTT broker

A simple PHP class to connect/publish/subscribe to an MQTT broker.

Source: https://github.com/bluerhinos/phpMQTT

30 questions
5
votes
1 answer

php MQTT subscribe not work

I have installed MQTT broker on my windows machine from https://mosquitto.org/download/. I am using https://github.com/bluerhinos/phpMQTT/tree/master/examples for publish and subscribe. Publish works as expected but subscribe did not work. I did…
Hkachhia
  • 4,463
  • 6
  • 41
  • 76
1
vote
1 answer

How to run MQTT subscribe in the background in Laravel

I am trying to put MQTT subscribe into a job saved in the database, but I get an error message that the job has failed instead of running for an infinite time. I would like to know if my approach is even possible and if there are any better…
Luke
  • 11
  • 3
1
vote
1 answer

Laravel MQTT subscription - Undefined index: qos

I try to subscribe to a topic, I get below mentioned error: Undefined array key "qos" My code: `try { $mqtt = new Mqtt(); $mqtt->ConnectAndSubscribe('myTopic', function ($topic, $msg) { Log::info("Mqtt Msg Received"); }); } catch (\Exception…
K.S.Kumar
  • 11
  • 2
1
vote
1 answer

Symfony not updating a column in Command ORM

I am using php-mqtt, and its working great. The below subscribe has no issues. It has a "loop forever" for the MQTT and it runs forever as it should. As devices connect, the setMqttLastConnectedAt() always works. But, the setMqttConnectedServer()…
TDawg
  • 833
  • 2
  • 8
  • 24
1
vote
0 answers

phpMQTT non-blocking publish & recieve

I am writing a program connecting a web service in PHP to an MQTT broker. The broker is running Mosquitto on a Raspberry Pi. The idea is to have the web service send a request (a form is submitted) and then send a publish to the MQTT broker and then…
ludohl
  • 11
  • 2
1
vote
1 answer

Why Maximum execution time of 30 seconds exceeded in phpMQTT file

I have faced a problem when I get data from cloudmqtt. I have downloaded project from this link GitHub. subscribe.php In my subscribe.php file a function name proc called from phpMQTT.php file. This is subscribe.php file code $topics['sensor_data']…
A.A Noman
  • 5,244
  • 9
  • 24
  • 46
1
vote
0 answers

solution of mqttlens auto zoom in windows 8.1

I have installed mqttlens from google chorme apps. It worked quite well for a couple of week, but recently it appears in zoom when I start it. How can I fix it? .
1
vote
1 answer

Rabbit MQTT client in PHP?

I am new to MQTT. Can anyone help how to use Rabbitmq mqtt in PHP, I have MQTT broker in cloud so I want to develop based on PHP in my local system. Any library we want to download? Can anyone help on that in Ubuntu?
mohan
  • 11
  • 1
  • 2
1
vote
0 answers

Comunication beetwen MQTT and AMQP on RabbitMQ

Im having problems with mqtt and amqp comunication The point is: I have a RabbitMQ instance with the MQTT plugin, i have a mqtt producer/consumer and an AMQP producer/consumer too (using php-amqplib on the symfony RabbitMqBundle) The RabbitMQ…
Ciro Vargas
  • 422
  • 1
  • 5
  • 16
1
vote
1 answer

Object not available in function

I have an application in which I subscribe to a topic on a MQTT broker. When a message is received I need to process the data in the message and post it back to the same broker, on a different topic. I am using the Lightning branch of PHPMQTT as it…
Mikkel
  • 43
  • 7
1
vote
1 answer

Php mosquitto mqtt client identify client onDisconnect

I am working on PHP project using mosquitto client, I need to check when some user disconnects, and identify the user. I am using code callback function which only contains the reason for disconnect. onDisconnect($callback) function so that I can…
Mostafa Khattab
  • 554
  • 6
  • 18
1
vote
1 answer

Keep a MQTT Client Connection always active

I am using CloudMQTT as a MQTT broker in my Pub-Sub based application. I am using my publisher to publish data to the CloudMQTT server over a topic, and I plan to subscribe to the broker on my webpage to recieve the transmitted information. I am…
Ayush Gupta
  • 8,716
  • 8
  • 59
  • 92
1
vote
2 answers

How to get messages published from a client connected to broker on different ports

We are developing a Mosquitto broker based POC where 3 different MQTT client being used i.e. C, Python and phpMQTT and we need to pass messages between these clients. But phpMQTT client does not implement SSL/TLS which is limiting us to enable SSL…
Dilip
  • 628
  • 2
  • 10
  • 23
0
votes
1 answer

Laravel-MQTT: TLS connection configuration - php-mqtt/laravel-client

I try to connect my [laravel] web application to the [mqtt] broker eclipse-mosquitto. The broker run on a different server then the application. I'm wondering how I can configure the .env file in my web application. Actually, I'm only able to…
Steven
  • 1
  • 1
0
votes
0 answers

I am trying to subscribe to a specific topic in MQTT and I am getting the bellow error message:

Undefined array key "qos" My code use Salman\Mqtt\MqttClass\Mqtt; public function SubscribetoTopic() { $mqtt = new Mqtt(); $client_id = '123'; $topic ='testdata1'; $mqtt->ConnectAndSubscribe($topic, function($topic, $msg){ …
1
2