Skip to content

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Feb 15, 2019

Contribution description

This PR adds a full LoRaWAN stack to RIOT originally based on the work with @fjmolinas in #6645 . Compared to the Semtech pkg, this offers some advantages:

  • Integrated to GNRC (uses netif (ifconfig, etc), netreg, etc)
  • Tickless MAC (low power friendly)
  • Lightweight (~4-5 kb less ROM, ~1.5 kb less RAM with proper GNRC_PKTBUF_SIZE value)
  • Asynchronous send and receive.
  • Notifications from the MAC layer (sort of WIP :)

Implemented features:

  • EU868 region
  • Class A
  • Join via OTAA and ABP
  • Link Check commands

To be implemented

  • Indication to know when the bands are free
  • Duty Cycle restrictions
  • Compliance Fopts
  • Class C
  • Other regions
  • RTC support for true low power support.

This PR adds an IEEE-like MAC with MCPS (Mac Common Part Sublayer) and MLME (Mac Layer Management Entity) for handling data and all kind of management (set keys, request link check, etc). Compared to other MACs this one is request-confirmation based and there's a bidirectional communication between the MAC and higher layers.

Higher layers can:

  • Request to send data (the MAC can either send it right now or wait until it's possible to send) end receive an asynchronous confirmation to that Request (e.g couldn't receive ACK from the network server, etc)
  • Request a MAC management operation (set a key, join the network, ask for connectivity status, etc). Same as before, this is confirmed asynchronously

MAC layer can:

  • Indicate the upper layer that data was received and pass all metadata (pkt, port, rssi, etc)
  • Indicate the upper layer about an interesting event (join was successful, a sub-band is free to be used again, etc)

This IEEE MAC layer is very useful in scenarios like Tisch or connection oriented MAC layers.

Testing procedure

Check the README.md file under tests/gnrc_lorawan

Issues/PRs references

Waiting for #11143, #11136, #11144 , #11736

@jia200x jia200x added the Area: LoRa Area: LoRa radio support label Feb 15, 2019
@jia200x
Copy link
Member Author

jia200x commented Feb 15, 2019

(ignore the commit messages, they will be squashed of course :)

miri64
miri64 previously requested changes Feb 26, 2019
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Some comments initial comments before I realized this PR is still WIP

@miri64 miri64 added Area: network Area: Networking State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented Type: new feature The issue requests / The PR implemements a new feature for RIOT and removed Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented labels Feb 26, 2019
@miri64
Copy link
Member

miri64 commented Feb 26, 2019

(needs rebase btw)

@RIOT-OS RIOT-OS deleted a comment Feb 26, 2019
@RIOT-OS RIOT-OS deleted a comment Feb 28, 2019
@RIOT-OS RIOT-OS deleted a comment Mar 1, 2019
@jia200x jia200x changed the title [WIP] gnrc_lorawan: add initial support for gnrc based LoRaWAN stack (v2) gnrc_lorawan: add initial support for gnrc based LoRaWAN stack (v2) Mar 5, 2019
@jia200x jia200x removed the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Mar 5, 2019
@jia200x
Copy link
Member Author

jia200x commented Mar 5, 2019

Not WIP anymore :)

@jia200x
Copy link
Member Author

jia200x commented Mar 5, 2019

(EUIs are in little endian. I will add it to the README)

@jia200x jia200x requested review from kYc0o and smlng March 5, 2019 16:25
@miri64
Copy link
Member

miri64 commented Mar 7, 2019

Please rebase and squash. >200 commits are impossible to keep track of.

@MichelRottleuthner MichelRottleuthner merged commit bf676d4 into RIOT-OS:master Nov 27, 2019
@smlng
Copy link
Member

smlng commented Nov 27, 2019

@aabadie IIRC porting this into a package of its own is still something @jia200x is working on.

@smlng
Copy link
Member

smlng commented Nov 27, 2019

great work, many thanks to @jia200x and everyone reviewing and testing! For the latter: keep on going.

@aabadie
Copy link
Contributor

aabadie commented Nov 27, 2019

Thanks, that's a good work @jia200x!

@jia200x
Copy link
Member Author

jia200x commented Nov 27, 2019

Awesome!! ❤️ Thanks to everybody!!! I will bake you a cake

@tcpipchip
Copy link

Hi, some news to AU915 or not

thanks

@jia200x
Copy link
Member Author

jia200x commented Jan 20, 2021

hi!

@akshaim is planning to port some regions.
@akshaim do you have plans to take the AU915 too?

@tcpipchip
Copy link

Hi @jia200x

I am tryng now to port! But not too much experience to understand the code! I am loosing a lot of time :)

@akshaim is the better one to port :)

Thanks

@tcpipchip
Copy link

i am testing on NRF52840
image

@jia200x
Copy link
Member Author

jia200x commented Jan 20, 2021

maybe we could synchronize here! it's indeed interesting to have new regions here. Maybe we could wait for @akshaim regarding plans about this region and see what we can do

@jia200x
Copy link
Member Author

jia200x commented Jan 20, 2021

you can also use the Semtech packet implementation if you need AU915 (see examples/lorawan). But this one is not integrated to GNRC.

@tcpipchip
Copy link

Yes! you are correct! We have to wait @akshaim

Should be better to GNRC :)

thanks @jia200x @

Are you from Portugal

@tcpipchip
Copy link

other question, must i use the D01, D02 and D03

@jia200x
Copy link
Member Author

jia200x commented Jan 20, 2021

Hi @tcpipchip

Are you from Portugal

No, but I speak spanish :)

other question, must i use the D01, D02 and D03

It depends on how far you are from the gateway. The lower the datarate the higher range, but increased Time on Air and energy consumption. Increased ToA means that the node would send data less frequently in order to respect the 1% Duty Cycle restriction

@akshaim
Copy link
Member

akshaim commented Jan 20, 2021

hi!

@akshaim is planning to port some regions.
@akshaim do you have plans to take the AU915 too?

Hey @jia200x. Yup, the plan as discussed before is to get ADR tested and working this month and US915 by mid-Feb.

@akshaim
Copy link
Member

akshaim commented Jan 20, 2021

NRF52840

Hey, but this is a BT SoC. Did you use an external radio such as RFM95W ?

@tcpipchip
Copy link

tcpipchip commented Jan 20, 2021

Yes, connected to RFM95W!
image
Only connected to NSS, RST, CLK, MISO, MOSI

NRF52840 already tested and Working with Arduino, Micropython and Circuitpython, using LoRaWAN AU915
Javascript worked with LoRa
Now i want to test using the gnrc_lorawan
Let me Know when ready to AU915. Used here in Brazil!
Thanks @akshaim

@akshaim
Copy link
Member

akshaim commented Jan 20, 2021

You should be able to use it with Semtech LoRaMAC for the time being. Can you please test the SX1276 driver ?

You may also want to copy some of the references from here to here

@tcpipchip
Copy link

do you mean make a new GIT on that github and compile your example

@tcpipchip
Copy link

image

@tcpipchip
Copy link

image

@tcpipchip
Copy link

tcpipchip commented Jan 20, 2021

looks that is reading the register!
About DIO0,DIO1,DIO2 and DIO3 sx1276 gpios, must i connect then to microcontroller NRF52840.
I dont know if you use them in your lib

@tcpipchip
Copy link

but, looks that is not transmiting and receiving! I always try with a LoRa Module LOM204 (WISOL)
image

@tcpipchip
Copy link

maybe we have to wait your LoRaWAN version with 915AU

@tcpipchip
Copy link

tcpipchip commented Jan 20, 2021

Hi,
I add the DIOx and...
image
LoRa FINE :)
works!

@jia200x
Copy link
Member Author

jia200x commented Jan 20, 2021

other question, must i use the D01, D02 and D03

Sorry man! I though you meant Data Rates, not DIOs...

Actually you only need to connect DIO0 and DIO1. All the rest are not used so far.

@tcpipchip
Copy link

no problem :)

@tcpipchip
Copy link

now, we have to wait the LoRaWAN :)

@akshaim
Copy link
Member

akshaim commented Jan 20, 2021

As you have started a new thread in forums. Let's move the discussion there.

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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines 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.