-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Add set_coil and set_register #37
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
Conversation
Robot Results
Passed Tests
|
|
@zhongys-c8y Can you run the formatting and linting and address any of the reported issues? just format
just lint |
rina23q
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be changed a bit.
|
Added |
|
Now the set_coil and set_register operations will be mapped from c8y/devicecontrol/notification topic to /te/device////cmd//# topic. Added a topics-subscriber in reader/reader.py which will react to these two topics and call operation/update_register.py and update_coil.py to write the register and coil. |
|
TODOs:
|
didier-wenzek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm the interactions between the plugin and thin-edge are correctly implemented
test.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this file? It doesn't seem to be providing any value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, also only for my local test, I should not publish it
Added set_coil.py and set_register.py under tedge_modbus for writing values to modbus. One for register, one for coil. In the reader.py, added on_message function to subscribe to the tedge local MQTT topics of child devices' operations. The operation payload was based on the internal docs 'cloud fieldbus specification'. The c8y operation will be first mapper from
c8y/devicecontrol/notificationstopic to tedge local topics by using tedge custom operation template.It was tested with the simulator in this project. It can successfully change the register and coil value.