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

Ping to default gateways (per network) to see if local connection is … #1339

Merged
merged 1 commit into from
Dec 23, 2019

Conversation

tzachi-dar
Copy link
Contributor

…alive.

This helps to distinguish between the case that pi does not have connection to the phone,
and the case that connection to the phone exists but phone has no external IP connection.

Also in the case that both WiFi and BT tethering is enabled one can see which of them is used (the one with the lower metric).

Here is an example to the output (when both WiFi and BT are enabled.):

At Mon 23 Dec 2019 04:50:08 PM IST my local Bluetooth IP is: 192.168.44.226
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 0) passed
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 214) passed
At Mon 23 Dec 2019 04:50:11 PM IST ping to default gateway 192.168.3.1 (wlan0 metric = 302) passed
At Mon 23 Dec 2019 04:50:11 PM IST my public IP is: 37.26.149.235

Signed-off-by: Tzachi Dar tzachi.dar@gmail.com

…alive.

This helps to distinguish between the case that pi does not have connection to the phone,
and the case that connection to the phone exists but phone has no external IP connection.

Also in the case that both WiFi and BT tethering is enabled one can see which of them is used (the one with the lower metric).

Here is an example to the output (when both WiFi and BT are enabled.):

At Mon 23 Dec 2019 04:50:08 PM IST my local Bluetooth IP is: 192.168.44.226
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 0) passed
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 214) passed
At Mon 23 Dec 2019 04:50:11 PM IST ping to default gateway 192.168.3.1 (wlan0 metric = 302) passed
At Mon 23 Dec 2019 04:50:11 PM IST my public IP is: 37.26.149.235

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
Copy link
Contributor

@scottleibrand scottleibrand left a comment

Choose a reason for hiding this comment

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

This is intended to be solely diagnostic, right? It looks like it doesn’t change any behavior besides logging additional info.

@tzachi-dar
Copy link
Contributor Author

Yws, only diagnostics.

@scottleibrand scottleibrand merged commit c01674b into openaps:dev Dec 23, 2019
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.

2 participants