注意这个代码的坑,非常的坑
php代码如下:
$connectionSettings = new ConnectionSettings();
$abc=$connectionSettings
->setUsername(‘test1’)
->setPassword(‘123456’)
->setKeepAliveInterval(60);
$mqtt = new MqttClient($this->config['server'], $this->config['port'], $clientId); $mqtt->connect($abc, $this->config['clean_session']); $mqtt->publish($topic, json_encode($payload), $qos, $retain); $mqtt->disconnect();
发表评论 取消回复