简体   繁体   中英

Mosquitto and PHP

I am having problem scripting in PHP to subscribe topics on Mosquitto MQTT. I am publishing from and Arduino and I can subscribe just fine from shell with mosquitto_sub, but when I am trying to subscribe from PHP script it just keeps stuck and does not show anything or if it does then it takes a million years. I tried everything available for PHP. It's the same always. I compiled my apache and php separately.

Anyone any similar experience? Any idea? Oh and all this I am doing in Raspberry-pi

Have you got the latest JS client? http://www.eclipse.org/paho/

Here is an example of a html/js file to check everything is working, https://gist.github.com/matbor/9825309

Also, here is a simple Python WebSockets proxy for a MQTT broker. See bottom of http://goo.gl/EBFxSQ that might run a bit better on a pi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM