publish('myInTopic', 'foo', 1); // // $mqtt->subscribe('myInTopic', function (string $topic, string $message) { // // echo sprintf('Received QoS level 1 message on topic [%s]: %s', $topic, $message); // // }, 1); // $mqtt->loop(true); $mqtt = MQTT::connection(); $mqtt->subscribe('fromMobile', function(string $topic, string $message) { echo sprintf('Received message on topic [%s]: %s\n',$topic, $message); }); $mqtt->loop(true); return Command::SUCCESS; } }