Skip to content

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Dec 14, 2017

Contribution description

This PR imports the Semtech LoRaMAC reference implementation as a package and proposes a simple API for interacting with a LoRaWAN network.

What has been tested so far:

  • OTAA and ABP activation
  • Emission and reception of confirmed and unconfirmed messages
  • Message reception sent from the LoRaWAN backend
  • Adaptive datarate

This PR also provides a test application for setting/getting some LoRaMAC parameters, joining to a network and sending/receiving data to/from the network.

This PR has been tested with SX1272 and SX1276 devices, using Nucleo 64 boards and the b-l072z-lrwan1 board.

Of course there's room for improvement:

  • better management for errors/problems
  • adaption to netdev is missing and it's still unclear to me how to achieve this
  • add other LoRaWAN functionnalities: more parameters (RX2 delays, etc), link check and LoRaWAN compliance tests

Issues/PRs references

refs #7331

This PR is based on #7592 and #8261

@aabadie aabadie added Area: LoRa Area: LoRa radio support Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: pkg Area: External package ports labels Dec 14, 2017
@PeterKietzmann
Copy link
Member

Is this an alternative to #6645?

@aabadie
Copy link
Contributor Author

aabadie commented Dec 14, 2017

Is this an alternative to #6645?

Not really. #6645 doesn't use the semtech loramac as a package but reimplement everything in gnrc. It's also totally outdated (still using netdev2, etc).

The PR here doesn't provide the netdev/netif adaption but this can be done in follow-up PRs.

@aabadie
Copy link
Contributor Author

aabadie commented Dec 14, 2017

I also forgot to mention that this PR is an adaption of an initial work from @jia200x. So most of the credits go to him.

@aabadie aabadie force-pushed the pkg_semtech-loramac branch 2 times, most recently from 55a595c to 83d5d4f Compare December 14, 2017 12:54
@miri64
Copy link
Member

miri64 commented Dec 14, 2017

I also forgot to mention that this PR is an adaption of an initial work from @jia200x. So most of the credits go to him.

Why doesn't the commit authorship then? ;-)

@aabadie
Copy link
Contributor Author

aabadie commented Dec 14, 2017

Why doesn't the commit authorship then? ;-)

Lot's of refactoring adaption so it was not easily possible. But I kept the credits in the files headers.

@miri64
Copy link
Member

miri64 commented Dec 14, 2017

As long as @jia200x is fine with that, I don't mind.

@aabadie aabadie force-pushed the pkg_semtech-loramac branch 3 times, most recently from fbd88e2 to 771914f Compare December 14, 2017 15:19
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 14, 2017
@aabadie aabadie force-pushed the pkg_semtech-loramac branch 2 times, most recently from f2c7bee to e89cf1b Compare December 14, 2017 15:35
@aabadie aabadie requested a review from dylad December 14, 2017 16:40
@aabadie aabadie force-pushed the pkg_semtech-loramac branch from e89cf1b to 1b65657 Compare December 14, 2017 16:45
@aabadie
Copy link
Contributor Author

aabadie commented Dec 14, 2017

@kaspar030 @smlng any idea why Murdock is failing here ? because locally it builds fine for me. I'm wondering if some git caching could be involved.

@dylad
Copy link
Member

dylad commented Dec 14, 2017

Is there a way to test this without setting up the whole TTN stuff ? Can we test it with Semtech tools on a gateway ?

@aabadie
Copy link
Contributor Author

aabadie commented Dec 14, 2017

Is there a way to test this without setting up the whole TTN stuff ?

There are other LoRaWAN providers (Actility, LoRiot, etc) and I think you can also setup your own LoRaWAN server (see here).

Can we test it with Semtech tools on a gateway ?

Maybe yes but I have to admit that I don't know how. Looking at loraserver.io, they also provide a LoRa gateway bridge application that can run on the gateway itself. That looks interesting.

@aabadie aabadie force-pushed the pkg_semtech-loramac branch 4 times, most recently from df8a2bb to f52d27a Compare December 15, 2017 09:09
@aabadie
Copy link
Contributor Author

aabadie commented Dec 15, 2017

any idea why Murdock is failing here ?

I found the problem, it was in the package Makefile. Now there are only platform related issues remaining.

@aabadie aabadie force-pushed the pkg_semtech-loramac branch from f52d27a to 03f8a58 Compare December 15, 2017 09:23
@aabadie
Copy link
Contributor Author

aabadie commented Dec 15, 2017

Ci is now fixed ! I had to blacklist the MSP430 based boards because of the following issue:

semtech_loramac_crypto.a(aes.o):(.debug_loc+0x596): relocation truncated to fit: R_MSP430_16_BYTE against `no symbol'
collect2: ld a retourné 1 code d'état d'exécution

Not sure how and if it can be fixed.

@aabadie
Copy link
Contributor Author

aabadie commented Jan 18, 2018

comments addressed @kaspar030, directly squashed and rebased. @miri64 is it ok for you ?

@aabadie aabadie force-pushed the pkg_semtech-loramac branch from 30fcaa7 to 85df39b Compare January 18, 2018 08:19
@@ -0,0 +1,5 @@
MODULE := semtech_loramac_mac

CFLAGS += -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare
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 just moved this CFLAGS rules here and here so that it's not applied globally to the package module

@aabadie aabadie force-pushed the pkg_semtech-loramac branch from 07aac76 to f5957f7 Compare January 18, 2018 08:24
@aabadie
Copy link
Contributor Author

aabadie commented Jan 18, 2018

07aac76 is improving the CFLAGS use in the package modules

@aabadie aabadie force-pushed the pkg_semtech-loramac branch 4 times, most recently from d2ee3ee to ae2c023 Compare January 18, 2018 09:40
@kaspar030
Copy link
Contributor

There's a typo in one of the commit messages (remane). Otherwise the code looks good now.

@smlng
Copy link
Member

smlng commented Jan 18, 2018

typo in one of the commit messages (remane)

@aabadie please fix on short notice, @kYc0o had pointed that out too, see above.

@aabadie aabadie force-pushed the pkg_semtech-loramac branch from ae2c023 to e3ff143 Compare January 18, 2018 14:31
@aabadie
Copy link
Contributor Author

aabadie commented Jan 18, 2018

There's a typo in one of the commit messages

Damn, I fixed it yesterday but on another personal computer and this morning I forced a push from my Inria laptop... overriding the change.
Btw, this is fixed now. @miri64 do you ACK?

@smlng smlng dismissed miri64’s stale review January 18, 2018 16:36

no response in time to get this into release 2018.01.

@smlng smlng merged commit 0352681 into RIOT-OS:master Jan 18, 2018
@kYc0o
Copy link
Contributor

kYc0o commented Jan 18, 2018

no response in time to get this into release 2018.01.

Anyways, congrats @aabadie !

@jia200x
Copy link
Member

jia200x commented Jan 18, 2018

Congratz @aabadie!!

@dylad
Copy link
Member

dylad commented Jan 18, 2018

Wonderful job @aabadie !

@aabadie
Copy link
Contributor Author

aabadie commented Jan 18, 2018

Wow !! This really makes my day :D
And many thanks to all people involved, mainly @jia200x and @fjmolinas for the initial work, but also reviewers!

@fjmolinas
Copy link
Contributor

Congrats @aabadie !!

@miri64
Copy link
Member

miri64 commented Jan 18, 2018

Congrats @aabadie. But

no response in time to get this into release 2018.01.

I also had no time to check this... It leaves a bitter taste that my concerns about the architecture are just dismissed like that, just so that a (because of that potentially unstable) feature makes it into the release. As far as I can see my concerns are addressed, but I'm still not sure they actually are...

@aabadie
Copy link
Contributor Author

aabadie commented Jan 19, 2018

It leaves a bitter taste that my concerns about the architecture are just dismissed like that

Don't worry, your concerns are WIP in another branch. I'll continue to work on that.

a [...] potentially unstable feature makes it into the release

I understand your concerns but I would rather see it as a first step. Maybe we can just mention in the release notes that this is an experimental integration of LoRaWAN into RIOT ?
Also notice that the actual version of the package points to the latest release of Loramc-node and it'll have to be adapted to the coming one (that should be released soon).

@miri64
Copy link
Member

miri64 commented Jan 19, 2018

I understand your concerns but I would rather see it as a first step. Maybe we can just mention in the release notes that this is an experimental integration of LoRaWAN into RIOT ?

Agreed.

@aabadie aabadie deleted the pkg_semtech-loramac branch February 26, 2018 10:31
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 Area: network Area: Networking 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 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.

9 participants