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
12 stars 2 forks source link

Device provisioning from C8Y to TTN LNS fails #26

Closed phcrb closed 3 years ago

phcrb commented 3 years ago

Hi when I setup a device on C8Y side, it does not appear in inventory, and of course is not pushed to ttn Some java errors in app logs see attached log file see screenshot

Caused by: java.lang.NullPointerException: null at lora.ns.DeviceProvisioning.validate(DeviceProvisioning.java:198) at lora.ns.LNSIntegrationService.provisionDevice(LNSIntegrationService.java:230) at lora.rest.LNSRestController.provisionDevice(LNSRestController.java:62)

phcrb commented 3 years ago

lora-ns-ttn-scope-t2244816-deployment-84bbd76cb9-phx8r.log createNewDevice

cpoder commented 3 years ago

Hi,

Sorry, the UI needs to be updated as it should now allow choosing between OTAA and ABP registration. Defaulting provisioningMode parameter to "OTAA" should resolve this issue.

cpoder commented 3 years ago

Should be fixed with current UI version.

haraldmeyer commented 3 years ago

@cpoder According to @phcrb the problem still exists:

"I cannot create a lora device in C8Y, and indeed not pushed to the LNS"

phcrb commented 3 years ago

Hi here are some more details: I try to create a new device in c8y, bound to ttn

the device is not created in cumulocity and no more pushed to ttn

java.lang.IllegalArgumentException: com.google.common.io.BaseEncoding$DecodingException: Unrecognized character: b see complete log: issue26.txt issue26

cpoder commented 3 years ago

Hi, Internally app key, app EUI and dev EUI are stored in lower case, even if you put them in upper case in the UI... But TTN needs them in upper case. I updated TTN microservice so it now use upper case values.

phcrb commented 3 years ago

checked june-18 creating a device in C8Y image

The device is pushed to ttn image

But it appears to be configured with APB instead of OTAA The external Join server is checked image and the Network Server and Application server addresses are not filled

phcrb commented 3 years ago

Hi, there is still an issue

Here are the settings that work when setting up a device from ttn: image

cpoder commented 3 years ago

This is now fixed with the latest commit. Additionally it is now possible to configure device provisioning addtional parameters per LNS type. Example: TTN connectors now have the following addtional parameters when provisioning devices: MAC Version, PHY Version and Frequency Plan.