//+------------------------------------------------------------------+ //| info //+------------------------------------------------------------------+ Subscribing to topic peres/# means every subtopic is subscribed to. Send a message to topic peres/livingroom, and message will automatically be placed in table cell. Browser connect to websocket MQTT Server, not all server have ws that. But the Arduino client only need a normal tcp MQTT connection to publish. To add ws to your Mosquitto server, add this to configuration file: listener 80 protocol websockets Use fullversion of mqttws31.js to get message.destinationName To connect with user and password use: client.connect({ onSuccess: onConnect, userName : "x", password : "x" }); Instead of: client.connect({onSuccess:onConnect}); //+------------------------------------------------------------------+ //| links to read up on //+------------------------------------------------------------------+ Pago homepage: https://www.eclipse.org/paho/clients/js/ Mqtt info: https://www.hivemq.com/blog/mqtt-client-library-encyclopedia-paho-js Javascript output: https://www.w3schools.com/js/js_output.asp div og span html: https://www.computerhope.com/issues/ch001709.htm ahmad siteblog: https://ahmadsiteblog.wordpress.com/2017/05/15/realtime-data-with-mqtt-node-js-mqttclient-js-and-socket-io/ mqtt 3.3.0 vs 3.3.1: https://github.com/mqtt/mqtt.github.io/wiki/Differences-between-3.1.0-and-3.1.1 sync