Created
February 3, 2020 11:30
-
-
Save blackout314/2302c6874bf9303439c3c62252ab84a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// download phpMQTT from https://github.com/bluerhinos/phpMQTT | |
// | |
error_reporting(0); | |
require "phpMQTT.php"; | |
$server = "127.0.0.1"; | |
$port = 1883; | |
$username = ""; | |
$password = ""; | |
$client_id = ""; | |
$mqtt = new \Bluerhinos\phpMQTT($server, $port, $client_id); | |
if ($mqtt->connect(true, NULL, $username, $password)) { | |
echo 'Online\n'; | |
} else { | |
echo "Time out!\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment