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

drivers/at86rf2xx: support frame retry reporting on AT86RFR2 #14596

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

benpicco
Copy link
Contributor

Contribution description

AT86RFR2 doesn't report retries directly, but it can generate a TX start interrupt for each (re)try, so we can count manually.

Testing procedure

Currently retry count is not used anywhere in RIOT.
So you will either need #14448 or you manually add

--- a/drivers/at86rf2xx/at86rf2xx_netdev.c
+++ b/drivers/at86rf2xx/at86rf2xx_netdev.c
@@ -696,6 +696,8 @@ static void _isr_send_complete(at86rf2xx_t *dev, uint8_t trac_status)
                       AT86RF2XX_XAH_CTRL_2__ARET_FRAME_RETRIES_OFFSET;
 #endif
 
+    printf("retries: %d\n", dev->tx_retries);
+
     DEBUG("[at86rf2xx] EVT - TX_END\n");
 
     if (netdev->event_callback && (dev->flags & AT86RF2XX_OPT_TELL_TX_END)) {

to check that retries are reported correctly.

Issues/PRs references

Missing feature from #9172

@benpicco benpicco added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: drivers Area: Device drivers labels Jul 23, 2020
@benpicco benpicco requested review from aabadie and maribu July 23, 2020 17:58
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 25, 2020
@fjmolinas
Copy link
Contributor

@aabadie has the hardware and could test!

@aabadie aabadie self-assigned this Sep 8, 2020
@aabadie
Copy link
Contributor

aabadie commented Sep 8, 2020

Testing this PR with examples/gnrc_networking on atmega256rfr2-xpro (and after applying the diff above) and got this output when pinging an unreachable address:

> ping fe80::dd22:84f6:2f1f:2d58
2020-09-08 14:13:29,791 #  ping fe80::dd22:84f6:2f1f:2d58
2020-09-08 14:13:29,808 # retries: 3
2020-09-08 14:13:30,807 # retries: 3
2020-09-08 14:13:31,806 # retries: 3
2020-09-08 14:13:32,792 # 
2020-09-08 14:13:32,796 # --- fe80::dd22:84f6:2f1f:2d58 PING statistics ---

No idea if this is expected or not.

@benpicco
Copy link
Contributor Author

benpicco commented Sep 8, 2020

If it gets no ACK is will re-try as often as you have configured it to do.

@aabadie
Copy link
Contributor

aabadie commented Sep 8, 2020

If it gets no ACK is will re-try as often as you have configured it to do.

Thanks but sorry, I don't know about it that much. Do you have something more precise ?

@jia200x
Copy link
Member

jia200x commented Sep 8, 2020

I don't have the hardware with me, but conceptually makes sense to me

@benpicco
Copy link
Contributor Author

benpicco commented Sep 8, 2020

Thanks but sorry, I don't know about it that much. Do you have something more precise ?

The radio will send the the frame a number of times until it receives an ACK from the destination if the ACK requested flag is set.
The max. Retrans. in ifconfig will tell you how often it will attempt to re-transmit a packet before it gives up.

If you send a packet to a node that doesn't exist, the radio will try that many times to deliver the packet.

At86rfr2 doesn't report retries directly, but it can generate a TX start
interrupt for each (re)try, so we can count manually.
@benpicco benpicco force-pushed the drivers/at86rf2xx-retries branch from ea615e4 to 0871b69 Compare September 8, 2020 12:49
@aabadie
Copy link
Contributor

aabadie commented Sep 8, 2020

So I guess the output was correct.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

ACK

@aabadie aabadie added State: waiting for other PR State: The PR requires another PR to be merged first and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Sep 9, 2020
@aabadie aabadie merged commit fdaf7fd into RIOT-OS:master Sep 9, 2020
@benpicco benpicco deleted the drivers/at86rf2xx-retries branch September 9, 2020 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers 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.

4 participants