Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full integration via TTN api & MQTT #8

Open
noerw opened this issue May 6, 2017 · 3 comments
Open

full integration via TTN api & MQTT #8

noerw opened this issue May 6, 2017 · 3 comments

Comments

@noerw
Copy link
Member

noerw commented May 6, 2017

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.

proposed workflow

  1. user provides TTN config at oSeM (decoding profile + options only?)
  2. oSeM pushes notification to ttn-osem-integration (or ttn-osem-integration polls for changes)
  3. ttn-osem-integration creates new device in TTN
  4. ttn-osem-integration subscribes to new device, and decodes as is implemented so far
@noerw
Copy link
Member Author

noerw commented May 8, 2017

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()

@ubergesundheit
Copy link
Member

The integration is a really good idea! The the random String for identifying the senseBox is also a good idea for the main API

@noerw
Copy link
Member Author

noerw commented Oct 12, 2017

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants