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

Provisioning from TTN to C8Y duplicates device #20

Closed phcrb closed 3 years ago

phcrb commented 3 years ago

Provisionning a physical device from ttn LNS

scenario:

  1. I setup a device in ttn side (physically, it's an adeunis lora field tester)

  2. I trigger (push the button) a data tx

    • the join procedure is processed (JR + JA visible in ttn logs)
    • the device is created twice in cumulocity
    • one with the external id corresponding to the deveui
    • the other with no external Id set
  3. I delete the 2 devices in C8Y side, then I trigger a new tx, the devices appear duped again in C8Y, both have external Id (the same = deveui)

phcrb commented 3 years ago

Precision:

  1. the first test did not show that behaviour
  2. the process was done with another device (adeunis modbus) with the same duplicated result
haraldmeyer commented 3 years ago

Should this also be fixed with the other changes?

cpoder commented 3 years ago

Could you check that you don't have more than 1 connection on TTN side to Cumulocity? This might also be solved by synchronizing the piece of code responsible for creating the device, but the reason that 2 uplinks are sent at the same time is mostly due to 2 connectors set on TTN, which is not good. This could have occurred with previous version of the framework where former connections were not properly updated/deleted upon microservice restarting.

phcrb commented 3 years ago

Indeed the ttn webhook was duplicated thanks for your analyze