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

[LoRaWAN] Major rework #1204

Merged
merged 24 commits into from
Sep 10, 2024
Merged

[LoRaWAN] Major rework #1204

merged 24 commits into from
Sep 10, 2024

Conversation

StevenCellist
Copy link
Collaborator

@StevenCellist StevenCellist commented Sep 2, 2024

@jgromes best of luck... :)
Culmination of a whole summer of development.

Totally non-exhaustive list of changes in somewhat random order of importance:

  • Implement LoRaWAN v1.0.4 (for real), alongside v1.1
  • Implement Regional Parameters v1.0.4 (v1.1 now only available as fallback)
  • Rework MAC command processing ...
    • ... repeated MAC commands are now implemented (until downlink is received)
    • ... not tied anymore to arbitrary payload length and queue length (sacrificing some ease of use, but some optional MAC commands completely invalidated the previous system with a length of up to 26 bytes)
    • ... ADR is now pre- and post-processed into a complete channel mask and processes & responds as required for both v1.0.4 and v1.1 on dynamic and fixed bands (this was honestly a hell)
    • ... configurations are now only applied if the whole MAC command succeeded
    • ... and some misc bugs
  • Equally use all available channels by keeping track of used channels
  • Support frame retransmission as part of ADR
  • Implement TR013 = CSMA = LBT (for real)
  • Remove uplink() and downlink() as this separation is not possible with ADR and LBT
  • Don't receive downlinks that are (much) longer than allowed
  • Prevent stack crashes in case of slight user error (resolves RADIOLIB_ERR_UPLINK_UNAVAILABLE (-1108) on TIG stack sensor in the field (LoraWan/TTN/InfluxDB/Grafana) #1175)
  • Implement actual Rx1-datarate lookup table as RP 1.0.4 doesn't allow being smart
  • Fix maximum payload calculation
  • Add option to schedule Join/Uplink at specific time
  • Add virtual tag to some functions to allow a derived class
  • Slights hints of FSK and LR-FHSS modem, requires PhysicalLayer::setModem() to be implemented before completely working

Additional changes:

  • Return Rx window number (0 for no downlink, > 0 for downlink) instead of NO_DOWNLINK or ERR_NONE - this is a 'breaking' change.
  • Also use getMaxPayloadLen() for non-dwell-time bands for ease of use under ADR.
  • Update some return codes to reflect error state.

@HeadBoffin
Copy link
Collaborator

Add option to schedule Join/Uplink at specific time

Is this required by some corner case on the spec - because it's the simplest way to DDOS a gateway - have all your nodes set to uplink at the top of the hour ...

It also contradicts TR007 with jitter - randomisation of uplink time - I usually use ±60 seconds for deployment.

Making the function inconspicuous is fine.

@StevenCellist
Copy link
Collaborator Author

It's not in TS001, it is in another TS.. but I can surely make it private.

@StevenCellist
Copy link
Collaborator Author

Edited original post to reflect additional change.

src/TypeDef.h Outdated Show resolved Hide resolved
@StevenCellist
Copy link
Collaborator Author

@jgromes all done (plus minor edit of original post)

@jgromes jgromes merged commit f7f0b62 into master Sep 10, 2024
30 checks passed
@jgromes
Copy link
Owner

jgromes commented Sep 10, 2024

Merged - great job @StevenCellist! I ran the full CI manually and it still fails in couple of places, but that's unrelated to this PR, so I will fix it later.

@jgromes jgromes deleted the lorawan-rework branch September 10, 2024 19:12
@StevenCellist
Copy link
Collaborator Author

Woohoo! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants