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

shell_commands: include RSSI in ping output #11092

Merged
merged 1 commit into from Mar 15, 2019
Merged

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 4, 2019

I was looking for a quick way to gauge the link quality between two nodes, so I added the rssi to the output of the ping6 command.

Maybe this is generally useful to have.

2019-03-04 11:29:53,484 - INFO #  ping6 fe80::7841:4946:59b8:3d9c
2019-03-04 11:29:53,498 - INFO # 12 bytes from fe80::7841:4946:59b8:3d9c: icmp_seq=0 ttl=64 rssi=-51 dBm time=5.975 ms
2019-03-04 11:29:54,498 - INFO # 12 bytes from fe80::7841:4946:59b8:3d9c: icmp_seq=1 ttl=64 rssi=-51 dBm time=5.631 ms
2019-03-04 11:29:55,500 - INFO # 12 bytes from fe80::7841:4946:59b8:3d9c: icmp_seq=2 ttl=64 rssi=-49 dBm time=7.273 ms
2019-03-04 11:29:55,500 - INFO # 
2019-03-04 11:29:55,504 - INFO # --- fe80::7841:4946:59b8:3d9c PING statistics ---
2019-03-04 11:29:55,509 - INFO # 3 packets transmitted, 3 packets received, 0% packet loss
2019-03-04 11:29:55,515 - INFO # round-trip min/avg/max = 5.631/6.293/7.273 ms

@PeterKietzmann PeterKietzmann added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer labels Mar 4, 2019
maribu
maribu previously requested changes Mar 6, 2019
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

To me the RSSI info would be a nice addition to the ping info :-)
Please have a look at the inline comments.

sys/shell/commands/sc_gnrc_icmpv6_echo.c Outdated Show resolved Hide resolved
sys/shell/commands/sc_gnrc_icmpv6_echo.c Outdated Show resolved Hide resolved
I was looking for a quick way to gauge the link quality between two nodes,
so I added the rssi to the output of the ping6 command.

Maybe this is generally useful to have.
@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 6, 2019
@maribu maribu dismissed their stale review March 6, 2019 10:37

Changes addressed :-)

@maribu
Copy link
Member

maribu commented Mar 6, 2019

@benpicco: One remark for future PRs: Especially in bigger PRs it is helpful for the review to address the changes in separate commits and then squash one the reviewer acknowleged the changes were addressed. The work flow would be like this:

Lets assume you have commits 4242 and 1337 in your PR. First you would apply changes related to 4242, then you would do

git commit --fixup=4242

and similar the changes related to 1337 would be commited by git commit --fixup=1337. Once the reveiwer asks for squashing, you can do so by running git rebase -i --autosquash <ID>, where <ID> is the commit before your first commit, e.g. here one commit before 4242. This would integrated the fixups into the corresponding commits. (Of course, this would change the hash so a force push will be required.)

@maribu
Copy link
Member

maribu commented Mar 6, 2019

OK, it does not work for the MSB-A2 using "my" cc110x driver. The driver passes -35 dBm, but ping reports 2 dBm. I'll investigate later. Could be just as well my fault. (Also: The pings might end up being fragmented when 6LoWPAN is used. I wonder what the RSSI value will be in that case.)

@maribu
Copy link
Member

maribu commented Mar 6, 2019

@miri64: Please also have a look at this. The console output of ping6 is now fully identical to the output of the Linux ping6 (or at least for the busybox version of it). This PR would change this. I personally see no harm in that, as IMHO the output of ping6 is intended to be "parsed" by humans. Others might disagree on that and will end up with broken scripts.

(To be honest: When properly parsing the output of ping6 as a space separated list of key=value pairs, this should not break their scripts. So one could argue this would only break buggy scripts.)

@miri64
Copy link
Member

miri64 commented Mar 12, 2019

I'm fine with this. Most parsing scripts I'm aware of just parse the statistics in the end anyway.

@miri64
Copy link
Member

miri64 commented Mar 12, 2019

iputils's ping6 itself also can have different per-packet-output (e.g. with -f)

@SemjonWilke
Copy link
Member

If I checkout and try this on nrf52840dk i get a FAILED ASSERTION on

Probably rebase?

@benpicco
Copy link
Contributor Author

auto_init_gnrc_rpl() should run before any shell command is run and this doesn't touch anything outside sc_gnrc_icmpv6_echo.c, so I think it's unrelated.

@maribu
Copy link
Member

maribu commented Mar 15, 2019

I think @SemjonKerner is pointing out that this PR was created at a point in time the nrf driver was not yet included in RIOT's master. Rebasing this PR on top of the current master would allow using it.

I personally have no strong opinion about rebasing. The pro would be that testers would not need to rebase locally and the testing results are theoretically more trustful if the exact state of the PR is tested. The con is that force pushs during PRs would require the reviewers to look at the source code again to rule out some mistakes sneaked in - (this happens more frequently than one would guess and also happened to me).

Btw: Sorry for stalling with the cc110x test. As @bergzand referenced this PR to test the RSSI output of nrf802154, I guess the issue with the cc110x is unrelated to this PR. Maybe @bergzand can tick the testing label if I'm this did indeed work with another transceiver?

@maribu maribu 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: 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 Mar 15, 2019
@SemjonWilke
Copy link
Member

auto_init_gnrc_rpl() should run before any shell command is run and this doesn't touch anything outside sc_gnrc_icmpv6_echo.c, so I think it's unrelated.

Uhm, thats not really the problem. The nrf52840dk just got a 802.15.4 radio driver and your branch is not up to date with that.
When I rebase your branch onto master everything works as expected and RSSI is printed correctly.

@maribu
Copy link
Member

maribu commented Mar 15, 2019

When I rebase your branch onto master everything works as expected and RSSI is printed correctly.

@SemjonKerner: Thanks for testing!

@maribu maribu added Reviewed: 3-testing The PR was tested according to the maintainer guidelines CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 15, 2019
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

ACK. Once Murdock gives green light I'll hit merge

@maribu maribu merged commit 50e939e into RIOT-OS:master Mar 15, 2019
@benpicco benpicco deleted the rssi_ping branch March 15, 2019 12:53
@danpetry danpetry added this to the Release 2019.04 milestone Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer 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: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants