Product/components used and version/fix level:
thin edge latest, cumulocity platform
Question related to a free trial, or to a production (customer) instance?
customer instance
Detailed explanation of the problem:
Hello Cumulocity Community,
I have a question for SmartRest and custom SmartRest templates. We want to trigger an operation on the thinEdge edge device in a microservice to send data from the edge device to the cloud. Currently only one way works. We create an operation via the rest API with:
POST {{tenant_domain}}/devicecontrol/operations
Authorization: Basic {{user}} {{password}}
{
"deviceId": "...",
"description": "Execute maintenance command",
"MaintenanceInformation": {
"text": "maintenance command"
}
}
And the microservice receives the message via smart rest. Now we also want to send specific data upstream into the cloud.
Probably I am misunderstanding something, but when the operation is triggered only the “response” is called and not the “message” part of the smart rest template. I thought that when I trigger an operation via the rest API it would send a message and not the response part of the smart rest template:
What I tried for sending the appropriate message was using the mqtt messages:
mqtt pub c8y/s/uc/MaintenanceInformation 5557,9876543210,test
mqtt pub c8y/s/uc/MaintenanceInformation 9876543210,test
mqtt pub c8y/s/uc/MaintenanceInformation/9876543210 test
mqtt pub c8y/s/uc/MaintenanceInformation/thinEdge-ID 9876543210,test
mqtt pub c8y/s/uc/MaintenanceInformation 5557,9876543210,test
mqtt pub c8y/s/us 501,MaintenanceInformation,test
mqtt pub c8y/s/us 501,MaintenanceInformation,test
mqtt pub c8y/s/us 504,MaintenanceInformation,test
mqtt pub c8y/s/us 504,9876543210,test
mqtt pub c8y/s/us 502,MaintenanceInformation,test
mqtt pub c8y/s/us 5557,9876543210,test
mqtt pub c8y/s/us/MaintenanceInformation 5557,9876543210,test
mqtt pub c8y/s/us/MaintenanceInformation 9876543210,test
mqtt pub c8y/s/us 506,9876543210,test
mqtt pub c8y/s/us 506,5557,test
mqtt pub c8y/s/us 506,5557
mqtt pub c8y/s/us 506,9876543210
mqtt pub c8y/s/us 501,MaintenanceInformation
mqtt pub c8y/s/us 506,MaintenanceInformation
mqtt pub c8y/s/us 503,MaintenanceInformation,test
The messages for setting the status of the operation worked for the smart rest template id. But I did not see any message related to an answer or possible data I need in the c8y platform. Or should I configure the smart rest template to another rest endpoint e.g. measurement or event API? Or am I using the wrong mqtt message path? I tried us and uc.
Also is there a detailed explaination somewhere what the different channels mean? I tried to figure it out like “u” for upstream and “d” for downstream and “us” would be upstream static for static templates etc. but I am not 100% sure.
Thank you in advance!