Then import it and initialize it with the required packages. Of course, you’ll want to replace DEVICE_ID and DEVICE_TOKENwith your actual device credentials which you can find under your device settings on Qubitro Portal.
Add the following code to the top of your page
package main
import(
"encoding/json"
"fmt"
"time"
mqtt "github.com/eclipse/paho.mqtt.golang"
)
Define Variables
var jsonData []byte
var deviceId string="PASTE_DEVICE_ID_HERE"
var deviceToken string="PASTE_DEVICE_TOKEN_HERE"
var brokerHost string="tls://broker.qubitro.com:8883"