Change mqtt broker
This commit is contained in:
parent
4808cf57ba
commit
7ba8fb5a36
2
sauna.go
2
sauna.go
@ -81,7 +81,7 @@ func http_endpoint_sauna(w http.ResponseWriter, r *http.Request) {
|
|||||||
func connect() mqtt.Client {
|
func connect() mqtt.Client {
|
||||||
// MQTT connection
|
// MQTT connection
|
||||||
opts := mqtt.NewClientOptions()
|
opts := mqtt.NewClientOptions()
|
||||||
opts.AddBroker("tcp://nuc:1883")
|
opts.AddBroker("tcp://p5:1883")
|
||||||
opts.SetClientID("apiservice/sauna/" + strconv.Itoa(rand.Int()))
|
opts.SetClientID("apiservice/sauna/" + strconv.Itoa(rand.Int()))
|
||||||
opts.SetDefaultPublishHandler(messagePubHandler)
|
opts.SetDefaultPublishHandler(messagePubHandler)
|
||||||
opts.OnConnect = connectHandler
|
opts.OnConnect = connectHandler
|
||||||
|
Loading…
Reference in New Issue
Block a user