Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dafanshu opened this issue Jan 19, 2022 · 1 comment
Open

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

dafanshu opened this issue Jan 19, 2022 · 1 comment

Comments

@dafanshu
Copy link

  • 版本
    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的字段来标识协议名称

@sailorvii
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants