diff --git a/main.go b/main.go index 52547b3..637cf90 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,4 @@ +// TODO: Optimisation: only log dt1, dt2, rt1, rt2, g on change. package main import ( @@ -65,6 +66,7 @@ func main() { opts.AddBroker(os.Getenv("MQTT_BROKER")) opts.SetUsername(os.Getenv("MQTT_USERNAME")) opts.SetPassword(os.Getenv("MQTT_PASSWORD")) + opts.SetAutoReconnect(true) // Connect to MQTT broker client := mqtt.NewClient(opts)