Conversation
closes #12
Now using Error subclasses to separate different response types instead of a homebrew `err.code` check. This allows to move the selection of errortype from the calling promise chain to the throwing function, improving consistency and readability.
TODO: authentication. right now theres an IP whitelist. proper
authentication would allow queries directly from the
oSeM frontend, which would provide a smoother integration
in the end..
| const p = box.integrations.ttn.port; | ||
|
|
||
| return (p === port || p === undefined); | ||
| })[0]; |
There was a problem hiding this comment.
The app_id and dev_id are not enforced to be unique on the model schema. You should add the requirement to the main project
There was a problem hiding this comment.
Indeed, the app_id, dev_id, port tuple is assumed to be unique..
lib/ttn.js
Outdated
| const log = createLogger('ttn'); | ||
|
|
||
| const onUplinkMessage = function onUplinkMessage (dev_id, message) { | ||
| const { app_id, port } = message; |
There was a problem hiding this comment.
Duplicate code to the httpIntegrationHandler ?
There was a problem hiding this comment.
This is because the response handling is different & I wanted to have different loggers for each protocol, and I didn't consider 10 duplicated lines to be worth an additional abstraction
|
Just pushed a docker image of this branch to |
|
Running the image results in a |
|
I have this dependency in See TheThingsArchive/node-app-sdk@e1eca3f, it seems the babel people (™) have messed with semver or something. |
|
Also, I can finally test this with actual LoRa hardware in the next days. Will add end-to-end tests then |
|
Very good! |
removes need to set the dev_id at all for mqtt boxes
|
@ubergesundheit Hey, this is ready, implementation wise. If required I can add comprehensive documentation on the required changes, a short list is in the TODO at the top of this PR already. |
|
Alright! Are there any changes to the angular app needed? |
|
yeah. the user should be able to select between his own TTN device with http integration (current solution), or the auto-creation of a device with our application. |
|
alternatively, a full integration with a Lora sketch containing the Lora keys comes to mind. |
|
With the new senseBox MCU in the pipeline, a LoRa Bee addon is planned. The generation of a full working sketch should be possible then. |
implements the feature that was suggested in #8.
Also featuring a rewrite of error handling code
Things to consider (@ubergesundheit):
TODO
box.integrations.ttn.dev_eui, makeapp_id, dev_id, porttuple uniqueGET ttnintegration/v1.1/ttndevice/:boxIdatPUT & POST mainapi/boxes/:boxIdhandler