Cumulocity-IoT / cumulocity-lora

LoRa framework including implementations for TTN, Chirpstack, Kerlink Wanesy, Loriot, Actility, Objenious, Live Objects, Orbiwan as well as many codecs and still adding more, and lot of unique features such as user-friendly UI to send device commands, gateway management, codec IDE
Apache License 2.0
10 stars 2 forks source link

Device provisioning from C8Y to Objenious LNS fails #36

Closed phcrb closed 3 years ago

phcrb commented 3 years ago

Hello, When I create a new device in C8Y using Objenious connector, the device is not created in C8Y nor in Objenious

The following message is found in the objenious connector: https://lora-sandbox.dev.iot.greenflex.com/apps/administration/index.html#/applications/242/logs

2021-06-10 10:36:30.323 INFO 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Response code from GET https://api.objenious.com/v1/devices/lora:0018b20000001447: 404 2021-06-10 10:36:30.323 ERROR 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Error message from Objenious: 2021-06-10 10:36:30.323 ERROR 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Request was: Request{method=GET, url=https://api.objenious.com/v1/devices/lora:0018b20000001447, tags={class retrofit2.Invocation=lora.ns.objenious.rest.ObjeniousService.getDevice() [0018b20000001447]}} 2021-06-10 10:36:30.475 INFO 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Response code from POST https://api.objenious.com/v1/devices: 403 2021-06-10 10:36:30.475 ERROR 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Error message from Objenious: 2021-06-10 10:36:30.475 ERROR 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : Request was: Request{method=POST, url=https://api.objenious.com/v1/devices, tags={class retrofit2.Invocation=lora.ns.objenious.rest.ObjeniousService.createDevice() [class DeviceCreate { label: lora-field-20 deveui: 0018b20000001447 appeui: 0018b24441524632 appkey: c150015dc9cca58720db07cfbf9d7ee8 groupId: 4 profileId: 1 lat: null lng: null properties: null }]}} 2021-06-10 10:36:30.475 ERROR 14 --- [http-nio-80-exec-10] lora.ns.objenious.ObjeniousConnector : {"code":"FORBIDDEN","message":"Service forbidden"} 2021-06-10 10:36:30.482 INFO 14 --- [http-nio-80-exec-10] lora.common.C8YUtils : External ID 0018b20000001447 with type LoRa devEUI not found

phcrb commented 3 years ago

creating the device from cumulocity: image

The device is not created in the inventory nor in objenious side

I get these errors in the objenious µs logs: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "deprecated" (class lora.ns.objenious.rest.Profile), not marked as ignorable (5 known properties: "icon", "link", "id", "icon_name", "name"]) at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 61] (through reference chain: java.util.ArrayList[0]->lora.ns.objenious.rest.Profile["deprecated"])

See complete log in attached file: objenious.txt

cpoder commented 3 years ago

Added @JsonIgnoreProperties(ignoreUnknown = true) annotation on Profile class so this error should not appear anymore. This "deprecated" field is not documented in Objenious, so I'm ignoring it. The issue should be fixed now.

haraldmeyer commented 3 years ago

Has been fixed.