TheThingsArchive / ttn

The Things Network Stack V2
https://www.thethingsnetwork.org
MIT License
461 stars 277 forks source link

Add at least location as part of device events #713

Closed johanstokking closed 6 years ago

johanstokking commented 6 years ago

This is a feature request for the backend.

What do you want to do?

Publish (at least) location as part of the device events.

This is especially relevant for the Collos integration, which updates the device registry and triggers a device update event. If we add the device's location as part of the payload, applications can subscribe to location updates through MQTT.

What went wrong or what is missing?

Data is nil, see https://github.com/TheThingsNetwork/ttn/blob/develop/core/handler/manager_server.go#L228

toruuetani commented 6 years ago

I think that Collos has three algorithm for resolving location. So I think that update events need not only location but also algorithm.

johanstokking commented 6 years ago

In V2 we have only one location per device in the registry.

Do note that the idea of Collos is that it resolves the best possible; in the order of WiFi, LoRa TDOA to LoRa RSSI. It is only for debugging purposes to have multiple endpoints enabled, but this is not supported in our device registry.

htdvisser commented 6 years ago

Some notes for @Sypheos:

toruuetani commented 6 years ago

OK, I understand. We are interested only in TDOA. I think that RSSI is TDOA's preliminary exercise.

johanstokking commented 6 years ago

If you use the Lora Wifi recipe, you'll get the fallback automatically. Just don't pass WiFi; https://apiportal.preview.collos.org/docs/services/localization-lora-recipes/operations/59e9b2a367ba551b780cd259?

toruuetani commented 6 years ago

OK, I understand.

toruuetani commented 6 years ago

What topic does this event send to ?

johanstokking commented 6 years ago

@toruuetani It will be part of the updated management event, see https://github.com/TheThingsNetwork/ttn/tree/develop/mqtt#management-events

toruuetani commented 6 years ago

OK, thanks.

Sypheos commented 6 years ago

@toruuetani Device data event now contain location PR #715 is merged

toruuetani commented 6 years ago

@Sypheos Great ! I'm looking forward to evaluate this feature.

htdvisser commented 6 years ago

I expect this to be deployed to production early next week 👍

toruuetani commented 6 years ago

OK, I will wait for update. Thank you !

toruuetani commented 6 years ago

How is progress?

htdvisser commented 6 years ago

The updates are currently being rolled out. All regions with ttn- prefix are already updated.