bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
770 stars 461 forks source link

Subscribe failing #15

Closed scargill closed 9 years ago

scargill commented 9 years ago

Hi

So I ran the PUBLISH to a simple unprotected MOSQUITTO broker running on a local PC, routed outside.... no problem - I can publish an item over and over and my local MQTT clients pick it up. However the SUBSCRIBE page seems to do nothing when given the same topic... and I publish something. The page just sits there and eventually times out.

Ideas?

The publisher is MARVELOUS as I want to send the time and some other stuff to one of my little wireless boards via MQTT on a regular basis... but it would be really nice if the subscribe page worked as well. My pages are on a paid server which hosts my PHP pages...

bluerhinos commented 9 years ago

The subscribe script is not meant to be run in page, as it is design to be background script, You can try retained topics which should report the last published value on subscription,