cumulocity

How to connect to Cumulocity services in order to add multiple devices data


I'm currently building a dotnet core project that receives data from multiple devices and has to send them over to Cumulocity.

So the flow of the app would be something similar to:

  1. dotnet core app receives new data
  2. connects to cumulocity account
  3. creates device with name according to data received
  4. sends data
  5. repeat for multiple devices

I've been doing this for the past week using this code. It works fine but then i noticed that calling the client.CreateDevice(...) was not creating new ones when presented with different data, it always hit the same one. This tells me that i'm probably doing this wrong, that this library is to be used only within devices and not this way.

So my question is, to handle/send multiple devices data to the platform which library should i be using (if any)?

Thank you.


Solution

  • I figured it out, when connecting to Cumulocity the ClientId value will identify the device, to create new ones i just map that property to my devices ID.

    Problem solved.