Skip to content

examples/opensensemap: Add example of TTN and openSenseMap integration#9862

Closed
leandrolanzieri wants to merge 4 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/opensensemap
Closed

examples/opensensemap: Add example of TTN and openSenseMap integration#9862
leandrolanzieri wants to merge 4 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/opensensemap

Conversation

@leandrolanzieri
Copy link
Copy Markdown
Contributor

@leandrolanzieri leandrolanzieri commented Aug 30, 2018

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

@jia200x jia200x added State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: LoRa Area: LoRa radio support labels Aug 30, 2018
@danpetry danpetry removed the State: waiting for other PR State: The PR requires another PR to be merged first label Sep 26, 2018
@danpetry
Copy link
Copy Markdown
Contributor

Before review could you please rebase, now the PR it depends on has been merged into master?

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Done

Copy link
Copy Markdown
Contributor

@danpetry danpetry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)\"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Contributor

@danpetry danpetry Oct 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

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.

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

Labels

Area: LoRa Area: LoRa radio support Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants