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

pkg/cayenne-lpp: add support for Cayenne LPP format #8809

Merged
merged 2 commits into from
Mar 28, 2018

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Mar 21, 2018

Contribution description

This PR adds support for generating payload compatible with Cayenne, a web IoT dashboard builder.
To nicely integrate into Cayenne, the payload must be compatible with the Cayenne Low Power Payload (LPP) format. This format mainly targets LoRaWAN networks and details about the format are available online here: https://mydevices.com/cayenne/docs_stage/lora/#lora-cayenne-low-power-payload

The payload format is generated using an external library on github: https://github.com/aabadie/cayenne-lpp and this PR just imports it in RIOT as a package.

A basic test application is provided.

Issues/PRs references

None

@aabadie aabadie added Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 21, 2018
@aabadie aabadie force-pushed the pr/pkg/cayenne-lpp branch from 21e27d5 to d75b624 Compare March 21, 2018 11:20
@aabadie aabadie changed the title pkg/cayenne_lpp: add support for Cayenne LPP format pkg/cayenne-lpp: add support for Cayenne LPP format Mar 21, 2018
@aabadie
Copy link
Contributor Author

aabadie commented Mar 21, 2018

Maybe this PR will interest @jia200x or @dylad

@jia200x
Copy link
Member

jia200x commented Mar 21, 2018

@aabadie! Great! Looking forward to it :)

@aabadie aabadie force-pushed the pr/pkg/cayenne-lpp branch from d75b624 to 8bf0be0 Compare March 21, 2018 14:38
{
puts("Cayenne LPP test application");

cayenne_lpp_add_temperature(&lpp, 3, 27.2);
Copy link
Member

Choose a reason for hiding this comment

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

Just a minor thing... maybe add labels to the numeric values? Just to make them easier to read and understand params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe add labels to the numeric values?

I don't understand. Do you mean adding a comment beside the values ?

Copy link
Member

Choose a reason for hiding this comment

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

I meant via #define.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll add a comment because these values doesn't come from nowhere, these are the values given as example in the cayenne lpp documentation. Then it's easy to verify that the generated payload is correct.

Copy link
Member

Choose a reason for hiding this comment

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

ok, perfect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied the same values given as example, but they don't give the exact same result. I don't know where the issue come from (cayenne-lpp library or their doc).

Copy link
Member

Choose a reason for hiding this comment

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

@aabadie so, if it's working in TTN, do you think this could be an issue with their documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you think this could be an issue with their documentation?

Could be. The first buffer (2 temperature sensors) works, the 2 others differ slightly. The C library is very simple, so I doubt there's an issue there.

@jia200x
Copy link
Member

jia200x commented Mar 21, 2018

tested in native and samr21-xpro. Works as expected.

.PHONY: all

all: git-download
"$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.${PKG_NAME}
Copy link
Contributor

Choose a reason for hiding this comment

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

please stick to one variable brace type (-> $(PKG_NAME))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@aabadie
Copy link
Contributor Author

aabadie commented Mar 21, 2018

Tested with Cayenne integration in TheThingsNetwork: works like a charm :)
(I adapted #8789 to achieve this)

@aabadie aabadie force-pushed the pr/pkg/cayenne-lpp branch from 41755e0 to fc4b485 Compare March 23, 2018 07:54
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK.

@kaspar030 kaspar030 merged commit 39fec30 into RIOT-OS:master Mar 28, 2018
@aabadie aabadie deleted the pr/pkg/cayenne-lpp branch June 8, 2018 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants