You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create a client instance
client = new Paho.MQTT.Client("b37.mqtt.one", 8083,"client_id");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
var options = {
//timeout: 3,
useSSL: true,
userName: "260fqs693",
password: "469efgijsu",
onSuccess:onConnect,
onFailure:doFail
}
// connect the client
client.connect(options);
// called when the client connects
function onConnect() {
// Once a connection has been made, make a subscription and send a message.
console.log("onConnect");
client.subscribe("260fqs693/Entrant");
message = new Paho.MQTT.Message("Hello");
message.destinationName = "260fqs693/Sortant";
client.send(message);
}
function doFail(e){
console.log(e);
}
// called when the client loses its connection
function onConnectionLost(responseObject) {
if (responseObject.errorCode !== 0) {
console.log("onConnectionLost:"+responseObject.errorMessage);
}
}
// called when a message arrives
function onMessageArrived(message) {
console.log("onMessageArrived:"+message.payloadString);
}
</script>
The message on console :
The text was updated successfully, but these errors were encountered:
**Hello
Here is my code that generates the following error message in my browser console. Thanks very much to help me !**
The code :
<title>MQTT</title> <script src="mqttws31.js" type="text/javascript"></script>-->Connexion MQTT :
<script type="text/javascript">The message on console :
The text was updated successfully, but these errors were encountered: