修改:1、mqttEmqx上报服务中Username字段改成UserName适配web页面 2、软件版本改成V0.3.1

This commit is contained in:
pengwang 2021-08-04 22:42:53 +08:00
parent b93113a381
commit b82cb09966
4 changed files with 7 additions and 5 deletions

View File

@ -27,7 +27,7 @@ func MQTTEmqxGWLogin(param ReportServiceGWParamEmqxTemplate, publishHandler MQTT
opts := MQTT.NewClientOptions().AddBroker(param.IP + ":" + param.Port)
opts.SetClientID(param.Param.ClientID)
opts.SetUsername(param.Param.Username)
opts.SetUsername(param.Param.UserName)
//hs256 := sha256.New()
//hs256.Write([]byte("zhsHrx123456@"))
//password := hs256.Sum(nil)

View File

@ -40,7 +40,7 @@ type ReportServiceGWParamEmqxTemplate struct {
ReportErrCnt int
Protocol string
Param struct {
Username string
UserName string
Password string
ClientID string
}

View File

@ -44,14 +44,16 @@ func MQTTHuaweiGWPropertyPost(client MQTT.Client, gw MQTTHuaweiRegisterTemplate,
propertyPostTopic := "$oc/devices/" + gw.DeviceID + "/sys/properties/report"
setting.Logger.Infof("gw property post topic: %s", propertyPostTopic)
setting.Logger.Debugf("gw property post msg: %v", sJson)
setting.Logger.Infof("huawei gw property post topic: %s", propertyPostTopic)
setting.Logger.Debugf("huawei gw property post msg: %v", sJson)
if client != nil {
token := client.Publish(propertyPostTopic, 1, false, sJson)
if token.WaitTimeout(2*time.Second) == true {
MsgID = 0
setting.Logger.Debugf("huawei gw property post msg sucess")
} else {
MsgID = 1
setting.Logger.Debugf("huawei gw property post msg fail")
}
}

View File

@ -46,7 +46,7 @@ var SystemState = SystemStateTemplate{
Name: "openGW",
SN: "22005260001",
HardVer: "openGW-V.A",
SoftVer: "V0.2.0",
SoftVer: "V0.3.1",
SystemRTC: "2020-05-26 12:00:00",
RunTime: "0",
DeviceOnline: "0",