examples/opensensemap: Add example of TTN and openSenseMap integration#9862
examples/opensensemap: Add example of TTN and openSenseMap integration#9862leandrolanzieri wants to merge 4 commits intoRIOT-OS:masterfrom
Conversation
|
Before review could you please rebase, now the PR it depends on has been merged into master? |
9e984c7 to
bb9823e
Compare
|
Done |
danpetry
left a comment
There was a problem hiding this comment.
Have included some general comments on the high level design. Also, requires a makefile change in order to build.
| FEATURES_REQUIRED += periph_rtc | ||
|
|
||
| CFLAGS += -DREGION_$(REGION) | ||
| CFLAGS += -DDEVEUI=\"$(DEVEUI)\" -DAPPEUI=\"$(APPEUI)\" -DAPPKEY=\"$(APPKEY)\" |
There was a problem hiding this comment.
You need to update this for recent semtech package changes. I.e. just apply the same change as here.
| */ | ||
| lora_serialization_write_temperature(&serialization, 25.3); | ||
| lora_serialization_write_uint8(&serialization, 82); | ||
| lora_serialization_write_humidity(&serialization, 50.2); |
There was a problem hiding this comment.
I see that this is very similar to the lorawan example. My thoughts are however that this example could be designed more towards presenting a clean, extensible interface to the user. Personally I like the structure of e.g. the gcoap and dtls-echo examples - they put a simple interface to the program in main.c. Then, if people want to change other aspects of how the program responds, they can go into the other .c files.
I would suggest finding a program structure so that in main.c they can do something like:
- add measurements to be sent in a declarative manner in a simple macro or function (for Sensebox this could also add the drivers at compile time, not sure whether this would require a separate macro/function or whether it could be done automatically). They could perhaps specify that the application sends dummy data (as above), or direct from sensor, or from a custom function
- change the frequency of data sending
Then in another file (loramac_send.c?)
- asyncronous data sending stuff incl thread definition perhaps
- arrays storing keys
Basically the philosophy I'm suggesting is to present a really simple API to a user in main.c which allows them to quickly, easily and flexibly define what data is going to be sent. As easy as possible. E.g. as little as possible above just plugging together their sensebox and loading this application.
|
Discussed offline with @danpetry and it would be better if this takes the form of an application on the Applications repo adding some sensor reading with SAUL. |
Contribution description
This is an example of how to integrate The Things Network with openSenseMap using lora serialization helper to encode the information sent to the gateway.
Testing procedure
Follow the instructions provided in the README.md file.
Issues/PRs references
Depends on
#9863