Skip to content
Snippets Groups Projects
Commit 1dd19826 authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Added debug

parent 962d5daa
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ package main
import (
"flag"
"fmt"
"log/slog"
"gitlab.imt-atlantique.fr/xaal/code/go/core/xaal"
)
......@@ -16,12 +17,13 @@ func main() {
return
}
xaal.SetupLogger()
client := setupMQTT(*mqttBroker, 1883)
// client.Publish("zigbee2mqtt/0x70b3d52b600f89d3/set", 0, false, `{"state": "toggle"}`)
xaal.SetupLogger()
eng := xaal.NewEngine()
GetGW().engine = eng
eng.Run()
client.Disconnect(250)
slog.Debug("MQTT disconnected")
}
......@@ -190,6 +190,7 @@ func setupMQTT(mqttBroker string, port int) MQTT.Client {
SetDefaultPublishHandler(publishHander).SetAutoReconnect(true)
client := MQTT.NewClient(opts)
slog.Debug("Connected to ", "client", client)
if token := client.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment