Gio : ```
Thanks for the directions. Very useful. I tried this too but I can’t write new values … I tried with this example:
`const mqtt = require('async-mqtt')`
`var PORT = 8883;`
`var HOST2 = '7a7************[a.s1.eu](http://a.s1.eu).hivemq.cloud';`
`var TOPIC = "message";`
`var options = {`
`clientId:"mqttjs012345",`
`protocol:'mqtts',`
`host: HOST2,`
`port: PORT,`
`username:"********1234",`
`password:"********1234",`
`//clean:true,`
`rejectUnauthorized : false,`
`};`
`const client = mqtt.connect(options);`
`// When passing async functions as event listeners, make sure to have a try catch block`
`const doStuff = async () => {`
`console.log("Starting...");`
`try {`
`await client.publish(TOPIC, "It works!");`
`// This line doesn't run until the server responds to the publish`
`await client.end();`
`// This line doesn't run until the client has disconnected without error`
`console.log("Done");`
`} catch (e){`
`// Do something about it!`
`console.log(e.stack);`
`process.exit();`
`}`
`}`
`client.on("connect", doStuff);`
Gio : ```
The result is always this:
Connecting…
ACTIVE_HANDLEThis step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: GetAddrInfoReqWrap, Learn more: Running asynchronous code)