mappers-go icon indicating copy to clipboard operation
mappers-go copied to clipboard

启动后没有正确解析deviceProfile.json

Open dafanshu opened this issue 3 years ago • 1 comments

  • 版本 kubeedge: 1.8.2 mapper-go: 分支release-1.8

  • 问题描述: 启动后没有将modbus协议的点位解析出来,导致后面设置desire的代码永远都不会执行 `

mappers-go\mappers\modbus\configmap\parse.go

for j = 0; j < len(deviceProfile.Protocols); j++ { if instance.ProtocolName == deviceProfile.Protocols[j].Name { instance.PProtocol = deviceProfile.Protocols[j] break } } if j == len(deviceProfile.Protocols) { err = errors.New("Protocol not found") return err }

if instance.PProtocol.Protocol != "modbus" { continue } ` instance.ProtocolName 这里的 ProtocolName 其实在deviceProfile.json中并不存在 在云端发布设备实例之后,在congfigmap中的deviceProfile.json里面,只有一个叫Protocol的字段来标识协议名称

dafanshu avatar Jan 19 '22 07:01 dafanshu

Do you refer to the example device instance and device model files?

sailorvii avatar Mar 24 '22 07:03 sailorvii