This commit is contained in:
HaiMD 2020-04-22 14:16:17 +07:00
parent daa3e0660d
commit cf09ee5fe9
2 changed files with 6 additions and 5 deletions

BIN
GPIO/GPIO

Binary file not shown.

View File

@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"time"
@ -150,7 +151,7 @@ func LoadConfig(path string) {
}
func main() {
// Bat debug
//mqtt.DEBUG = log.New(os.Stderr, "DEBUG ", log.Ltime)
mqtt.DEBUG = log.New(os.Stderr, "DEBUG ", log.Ltime)
fmt.Println("======== START MAIN ==========")
time.Sleep(1 * time.Second)
if state_read_ecf == false {
@ -232,10 +233,10 @@ func mqtt_begin() {
}
}
opts_cms_bi.OnConnect = func(c mqtt.Client) {
fmt.Printf("Client connected, subscribing to: " + CMS_TOPIC_IN)
c.Subscribe(CMS_TOPIC_IN, 0, mqtt_messageHandler)
}
// opts_cms_bi.OnConnect = func(c mqtt.Client) {
// fmt.Printf("Client connected, subscribing to: " + CMS_TOPIC_IN)
// c.Subscribe(CMS_TOPIC_IN, 0, mqtt_messageHandler)
// }
}