What product/components do you use and which version/fix level?
Backend: 1011.0.12
UI: 1011.0.12
Are you using a free trial or a product with a customer license?
What are trying to achieve? Please describe in detail.
I need to register a custom template for sending some custom numerical values.
For this I have referred the C++sdk. There’s an example by the name ‘ex-03-measurement’ which I referred. This example tells us about how we can send dummy CPU workload to a device on Cumulocity IoT. I have tried this example and its works fine.
I referred the above mentioned example and a document named ‘Reference Guide’ topic SmartREST > Registration Process. Using these 2 sources as reference I created a template as follows,
can you also share the headers of your request. Each template, which you create, will be added to a SmartRest template collection. This collection is identified by the custom header X-Id. Might be that a template already exists for the current template collection, which has the same id you also provided for your request to create a new template.
You could also try to change the value for the X-Id header.
As you suggested I changed the X-Id to a random number ‘1234’ in the header and the registration worked. In response I received the following message: 20,765539.
Now I need to use this template to send the ‘My_Cov’ numerical values from the example ‘ex-03-measurement’ which I referred from the C++ sdk.
There’s this function in the sdk where we assign the template id to the agent.send function,
In the above function tried sending 120 (my custom template’s id) instead of the 103 as seen in the example. But it is not working. I might be missing something here.
My requirement is very small.
I want to use the ‘ex-03-measurement’ example from the C++ sdk.
This example sends a CPU workload using a template Id 103.
Instead of template Id103 I want to use my custom registered template Id 120 and see the custom measurement on a device registered on Cumuloicty IoT.
I am still not able to send a custom measurement by registering a custom template.
I have provided a detailed explanation of what I am doing in the above comment
Please suggest where I am going wrong.
I’m not familiar with the C++ SDK. Did you follow the steps as described in the guide? In particular, the section which describes how to manage to the X-Id header?
It is important to mention that you must store the correct SmartREST X-ID and device’s Cumulocity IoT ID in the inherited member variables xid and id respectively. They will be used by SrAgent after the integrate process for initializing the corresponding internal variables.
Did you set the xid variable at some point in your code?