Bulk registration on 10.15 for LWM2M

What product/components do you use and which version/fix level are you on?

Backend: 1015.0.218
UI: 1015.0.218

Is your question related to the free trial, or to a production (customer) instance?

What are you trying to achieve? Please describe it in detail.

To register our devices we POST the CSV file to devicecontrol/bulkNewDeviceRequests
On tenants with 1013 there is no problem. On tenants with 1015 this does not work anymore for LWM2M devices.
The POST returns no error, but all LWM2M-Bootstrap-Parameter in the UI are empty and this error is shown:

Fields used in the csv file:

ID;
IDTYPE;
CREDENTIALS;
NAME;
TYPE;
SHELL;
com_cumulocity_model_Agent;
endpoint id;
bootstrap psk_id;
bootstrap psk_key;
lwm2m server uri;
securityMode;
lwm2m psk_id;
lwm2m psk_key;
security instance id;
serverPublicKey;
external-c8y_BootstrapPskId;
registrationLifetime;
Path

Do you get any error messages? Please provide a full error message screenshot and log file.

There is no error returned by the API on devicecontrol/bulkNewDeviceRequests.
When uploading the file through the UI for LWM2M bulk registration a internal Server error is returned with the message “Unsupported file format”

Have you installed all the latest fixes for the products and systems you are using?

Can you post an example of the csv file here?

I’m apparently not allowed to attach files here. The content of the UTF-8 encoded file is this:

ID;IDTYPE;CREDENTIALS;NAME;TYPE;SHELL;com_cumulocity_model_Agent;endpoint id;bootstrap psk_id;bootstrap psk_key;lwm2m server uri;securityMode;lwm2m psk_id;lwm2m psk_key;security instance id;serverPublicKey;external-c8y_BootstrapPskId;registrationLifetime;Path
350195682583939;c8y_Id;3TdBI2wb90&4;350195682583939;c8y_lwm2m;1;1;350195682583939;847090176;C4601CA6DDEC06A3B6;coaps://lwm2m.eu-latest.cumulocity.com:5784;PSK;847090176;C4601CA6DDEC06A3B6;1;;847090176;60;SMARTbox-cubeIO

As far as I can see ‘bulkNewDeviceRequests’ is not intended for LWM2M registration.
https://cumulocity.com/api/core/10.13.0/#operation/postBulkNewDeviceRequestCollectionResource
It’s for basic device detials, not the more detailed LWM2M details such as ‘bootstrap psk_id’.
At 10.15 the LWM2M bulk registration is through the GUI.
https://cumulocity.com/guides/protocol-integration/lwm2m/#migration-of-the-lwm2m-devices
“Starting from version 10.15.0, the new device registration for LWM2M is introduced”
I’ve used your example data as a basis for a csv file which uploads in my 10.15 tenant successfully.

Please also note that certain column headings have changed e.g TYPE should be type.

The documentation to 1013 states something different:
https://cumulocity.com/guides/10.13.0/protocol-integration/lwm2m/#register-device

To register a LWM2M device in Cumulocity IoT, upload a CSV file with registration data in the bulk registration dialog in Devices > Registration > Register device > Bulk device registration

I changed the TYPE heading to type and it still gives me an error. I will check the other headings.

As we are registering thousands of devices each year, this is not a suitable solution. Is there documentation on the endpoint that is used by this functionality?

Bulk registration is still possible in the UI for LWM2M devices.

Dev Tools shows that this performs this call…

…/service/lwm2m-agent/deviceRegistration/bulk

…but this is not an officially supported REST API call.

So the changes to bulkNewDeviceRequests in 10.15 for uploading the csv are breaking the established functionality.
How can we register LWM2M devices using the API on 10.15?

It has all changed at 10.5, the most convenient way to bulk register lwm2m devices from csv is in the UI
Do you see the option I sent in the previous screenshot?

That option ultimately uses this endpoint…

…/service/lwm2m-agent/deviceRegistration/bulk

…but this is not an officially supported REST API call.

I see the option in the screenshot, but as stated earlier, this is not a feasible option for hundreds or thousands of devices that get potentially onboarded each on a different tenant. We cannot use the UI for this, as we have automated the onboarding process to use the API. This is part of our production pipeline, where no user is able to enter anything in the UI and the device is only powered for the duration of the onboarding.

You CAN use the ‘new’ endpoint because it’s generic approach for extensible device registration feature and documented here…

https://cumulocity.com/guides/concepts/applications/#api-specification-1

So it’s POST …/service/lwm2m-agent/deviceRegistration/bulk

It’s not part of the official REST API but it is part of the device registration API specification.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.