Open noerw opened 7 years ago
Possible issue is authentication; how is ensured that only the correct physical LoRa device can submit measurements?
Assuming we choose app_id = 'opensensemap'
and dev_id = box._id
for all boxes,
these IDs are no secrets, and would allow anybody to submit measurements via LoRa.
idea: set dev_id = box._id + randomSalt()
The integration is a really good idea! The the random String for identifying the senseBox is also a good idea for the main API
Progress can be found on branch feature/mqtt
:
The integration now has its own TTN application, on which devices can be registered.
This registration is done by calling /v1.1/ttndevice/:boxId
, which then returns TTN device information for a given box.
This info can then be used to generate a sketch for example.
A subscription to messages from devices that were registered using this route is automatically set up via TTN MQTT broker.
TODOs:
I discovered that it is possible to automate device registration and LoRa-message subscription via APIs provided by TTN. This would free the user from the hassle of registering at 2 services, and keep the configuration state in sync. The current webhook could still be provided for users with existing TTN applications, sending data via the TTN HTTP Integration.
ttn-osem-integration
has its own TTNapp_id
, used to manage ALL devices from oSeMproposed workflow
ttn-osem-integration
(orttn-osem-integration
polls for changes)ttn-osem-integration
creates new device in TTNttn-osem-integration
subscribes to new device, and decodes as is implemented so far