Skip to content

pkg/semtech-loramac: improve TX status management after sending a message#10903

Merged
aabadie merged 4 commits intoRIOT-OS:masterfrom
aabadie:pr/pkg/semtech-loramac_improve_send
Jan 30, 2019
Merged

pkg/semtech-loramac: improve TX status management after sending a message#10903
aabadie merged 4 commits intoRIOT-OS:masterfrom
aabadie:pr/pkg/semtech-loramac_improve_send

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Jan 30, 2019

Contribution description

This PR is an attempt to fix #10352. The idea is to better manage the TX status returned by the MAC right after a send.

The caller code has to take care of this return code (ok, error, mac_busy, dutycycle_restriction, etc) and not call the receive function in not ok.

To achieve a status returned by the send function, I fixed a missing management of the status IPC messages returned from the MAC. Now all cases are correctly taken into account. This improves things.

The examples/lorawan and tests/pkg_semtech-loramac have been adapted accordingly to the change.

The doxygen documentation of the send/recv functions has also been adapted.

Testing procedure

  • Run the tests/pkg_semtech-loramac application, configure the device, join a network (OTAA or ABP) and send frames using different datarates. The node should always be responsive after a receive or after an error happens with the send (dutycycle for example).
  • Configure and run the examples/lorawan, it should work smoothly.

Issues/PRs references

Probably fixes #10352

@aabadie aabadie added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking Area: pkg Area: External package ports Area: LoRa Area: LoRa radio support labels Jan 30, 2019
@leandrolanzieri
Copy link
Copy Markdown
Contributor

Testing now, will get back with the results.

@kfessel
Copy link
Copy Markdown
Contributor

kfessel commented Jan 30, 2019

seems to work since 7d49dff

2019-01-30 16:49:33,537 - INFO # [semtech-loramac] Transmission completed
2019-01-30 16:49:33,540 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:34,509 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:35,515 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:36,522 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:37,526 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:37,531 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:37,615 - INFO # [semtech-loramac] MLME confirm event
2019-01-30 16:49:37,618 - INFO # [semtech-loramac] join succeeded
2019-01-30 16:49:37,622 - INFO # [semtech-loramac] loramac join notification msg
2019-01-30 16:49:37,625 - INFO # Join procedure succeeded
2019-01-30 16:49:37,627 - INFO # Sending: This is RIOT!
2019-01-30 16:49:37,630 - INFO # [semtech-loramac] loramac cmd msg
2019-01-30 16:49:37,633 - INFO # [semtech-loramac] send frame This is RIOT!
2019-01-30 16:49:37,638 - INFO # [semtech-loramac] MCPS request: confirmed TX
2019-01-30 16:49:37,644 - INFO # [semtech-loramac] MCPS request: dutycycle restricted
2019-01-30 16:49:37,647 - INFO # [semtech-loramac] received TX status
2019-01-30 16:49:37,652 - INFO # [semtech-loramac] forward TX status to caller thread
2019-01-30 16:49:37,657 - INFO # Cannot send message 'This is RIOT!', ret code: 11
2019-01-30 16:49:56,843 - INFO # Sending: This is RIOT!
2019-01-30 16:49:56,846 - INFO # [semtech-loramac] loramac cmd msg
2019-01-30 16:49:56,849 - INFO # [semtech-loramac] send frame This is RIOT!
2019-01-30 16:49:56,853 - INFO # [semtech-loramac] MCPS request: confirmed TX
2019-01-30 16:49:56,862 - INFO # [semtech-loramac] MCPS request: OK
2019-01-30 16:49:56,865 - INFO # [semtech-loramac] received TX status
2019-01-30 16:49:56,870 - INFO # [semtech-loramac] forward TX status to caller thread
2019-01-30 16:49:56,924 - INFO # [semtech-loramac] Transmission completed
2019-01-30 16:49:57,864 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:57,873 - INFO # [semtech-loramac] MAC timer timeout
2019-01-30 16:49:57,967 - INFO # [semtech-loramac] MCPS confirm event
2019-01-30 16:49:57,971 - INFO # [semtech-loramac] MCPS confirm event OK
2019-01-30 16:49:57,975 - INFO # [semtech-loramac] MCPS confirm event: CONFIRMED
2019-01-30 16:49:57,979 - INFO # [semtech-loramac] MCPS indication event
2019-01-30 16:49:57,983 - INFO # [semtech-loramac] MCPS indication Unconfirmed
2019-01-30 16:49:57,986 - INFO # [semtech-loramac] MCPS indication: TX done
2019-01-30 16:49:57,990 - INFO # [semtech-loramac] received TX status
2019-01-30 16:49:57,995 - INFO # [semtech-loramac] forward TX status to caller thread
2019-01-30 16:49:57,998 - INFO # [semtech-loramac] MAC reply received: 6
2019-01-30 16:50:17,187 - INFO # Sending: This is RIOT!

Copy link
Copy Markdown
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

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

LGTM. Tested on b-l072z-lrwan1 and lobaro-lorabox boards: lorawan example and pkg test - Receiving and sending on different DR. Also it seems to fix @fesselk 's issue (though I could not reproduce it). ACK.

@aabadie Please squash

@leandrolanzieri leandrolanzieri added 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 labels Jan 30, 2019
@aabadie aabadie force-pushed the pr/pkg/semtech-loramac_improve_send branch from 7d49dff to bb8bdad Compare January 30, 2019 17:58
@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 Jan 30, 2019
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jan 30, 2019

@leandrolanzieri, thanks a lot for your sensible review and testing!

@aabadie aabadie added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Jan 30, 2019
@leandrolanzieri
Copy link
Copy Markdown
Contributor

@aabadie thank you for this fix!

@aabadie aabadie added this to the Release 2019.01 milestone Jan 30, 2019
@aabadie aabadie merged commit fd2ffd9 into RIOT-OS:master Jan 30, 2019
@aabadie aabadie deleted the pr/pkg/semtech-loramac_improve_send branch July 4, 2019 17:03
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 Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch 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: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lorawan-example not working

3 participants