MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.52k stars 1.27k forks source link

Ip addresses are reported too verbosely #160

Closed MatthewScholefield closed 8 years ago

MatthewScholefield commented 8 years ago

When only asking "what is your ip address" I think the response should be a single, best-guess answer such as 192.168.80.51 on eth0. Currently for each interface mycroft gives interface: eth0, I.P. Address : 10.42.0.15 followed by interface: wlan0, I.P. Address : No IP addr

clusterfudge commented 8 years ago

I think there's probably value in being more concise when there's no information (for example, excluding the wlan interface description in your example above). A "best guess" implementation would need to be extended to support specific interface querying, or listing interfaces, or listing connected interfaces, etc.

For example,

mycroft, what's my wireless ip address
MatthewScholefield commented 8 years ago

@clusterfudge I agree. Do you think it's reasonable to assume wlan[0-9] is wireless and eth[0-9] is ethernet?

And if the user only asks for its IP address and multiple have valid IPs I was thinking it would select the top one.

aatchison commented 8 years ago

One problem with that is that many wireless interfaces are enumerated as wlp3s0 or similar these days. I bet there is another way to discern what type of connection a NIC actually is.

aatchison commented 8 years ago

Even though this skill mostly exists to enable a user to configure a headless mycroft unit, I would say gather the info from the kernel. Also, there is no wlan0 in Windows or OSX

aatchison commented 8 years ago

On top of that: What if your unit was connected to a vpn, or some other means. This skill really seems mostly useful on the unit and more of a novelty on say, the desktop... Since the pi3 is always eth0 or wlan0, maybe that would work. It just seems to generic of a thing to me. If I want nic info I can use ifconfig and get all active interfaces, I don't mind the verbosity. If I connect a unit to ethernet, I want it's eth0 ip. If I connect it to wifi, I want it's wlan0 ip.

aatchison commented 8 years ago

Maybe the default route is the ticket!

MatthewScholefield commented 8 years ago

@aatchison What about having the only change be that interfaces without an IP address would be excluded?

aatchison commented 8 years ago

That sounds much more useful than empty IPs or local host, while not excluding connected interfaces, whatever they may be ;) On Jun 17, 2016 12:54 AM, "Matthew D. Scholefield" notifications@github.com wrote:

@aatchison https://github.com/aatchison What about having the only change be that interfaces without an IP address would be excluded?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MycroftAI/mycroft-core/issues/160#issuecomment-226686461, or mute the thread https://github.com/notifications/unsubscribe/AIJOO1Ta4LxfJrD9LsBgr24C3guUnswoks5qMjaNgaJpZM4I38TQ .

ryanleesipes commented 8 years ago

Exclude interfaces without an IP address, and format the output so that it reads more naturally (replacing "." with "dot", for instance).

ryanleesipes commented 8 years ago

Assigned to @ethanaward

ethanaward commented 8 years ago

Addressed by #170.