Edex-ui: [Linux] Network module shows offline all the time

Created on 17 Mar 2019  路  17Comments  路  Source: GitSquared/edex-ui

Hi,

Great project.
The network module seems to not working in Solus Linux. It shows "OFFLINE" all the time.
Detected NICs are correct + ping to 1.1.1.1 is OK.
Changing the LAN to WLAN and the address for test is not giving any different results.
My public IPv4 address is blinking.

Is there a way to debug and troubleshoot this issue? I'm running it from AppImage.

bug confirmed

All 17 comments

Could you give me a list of your NICs?
Do you think you could have any latency issues reaching https://ipinfo.now.sh?
Do the 3D globe and network traffic monitor work or are they blinking/displaying "offline"?

enp0s31f6 Link encap:Ethernet  HWaddr 10:62:E5:51:FE:53
          inet addr:172.16.16.28  Bcast:172.16.16.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35088 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22804 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:38707434  TX bytes:2973114
          Interrupt:16 Memory:e6300000-e6320000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:0.0.0.0  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3253 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3253 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:352802  TX bytes:352802

wlp1s0    Link encap:Ethernet  HWaddr 5C:5F:67:96:71:9D
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:4174 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3329 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2842134  TX bytes:534273
curl https://ipinfo.now.sh
{"api_version":"3.0.0","geo":{"latitude":42.6833,"longitude":23.3167,"metro_code":null,"time_zone":"Europe/Sofia"},"ip":"REDACTED","time":1552822217}



md5-c21f4c23430ca2e50ee388f0bf7e72ee



            if (net.ip4 === "127.0.0.1") {
                offline = true;

I assume the while loop does not pick my local network and the above case sets the offline flag.

The part of netstat that loops through NICs to try to find the correct one will return the loopback interface if it hasn't found anything better.
If after selecting a network interface, its IP address matches localhost, the code concludes that no externally connected interface was found, and so flags the system as offline.

There should be a tiny text in the top right corner of the netstat module indicating the interface it's trying to monitor. Can you confirm that's the right one?

image

wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 5c:5f:67:96:71:9d brd ff:ff:ff:ff:ff:ff
    inet 172.16.16.29/24 brd 172.16.16.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 68942sec preferred_lft 68942sec
    inet6 2001:REDACTED:b8f1/64 scope global dynamic noprefixroute 
       valid_lft 86341sec preferred_lft 14341sec
    inet6 fe80::ab3c:873a:5083:8cd1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Seems like you got multiple addresses linked to that interface, and I'm not quite sure how the JS code is handling that.

Try opening the dev tools in eDEX (Ctrl+Maj+I), clicking on the "console" tab and running this:
window.si.networkInterfaces(d => console.log(JSON.stringify(d, 0, " ")))

Copy/paste the JSON output here please. Also, it would be helpful if you could run it a few times and check if the output is consistent - notably in the ip4/ip6 fields.

Hi,

The output is consistent:

[
 {
  "carrierChanges": 0,
  "duplex": "",
  "iface": "lo",
  "ifaceName": "lo",
  "internal": true,
  "ip4": "127.0.0.1",
  "ip6": "::1",
  "mac": "",
  "mtu": 65536,
  "operstate": "unknown",
  "speed": -1,
  "type": "virtual"
 },
 {
  "carrierChanges": 4,
  "duplex": "",
  "iface": "wlp1s0",
  "ifaceName": "wlp1s0",
  "internal": false,
  "ip4": "172.16.16.29",
  "ip6": "2001:REDACTED:b8f1",
  "mac": "REDACTED:96:71:9d",
  "mtu": 1500,
  "operstate": "up",
  "speed": 866.7,
  "type": "wireless"
 }
]

Okay, all good so far.

Can you give me the output of the following command in eDEX's dev console?

output = {iface: window.mods.netstat.iface, internalIPv4: window.mods.netstat.internalIPv4, externalIPinfo: window.mods.netstat.ipinfo, lastReachFinished: window.mods.netstat.lastconn.finished, lastReachHeader: window.mods.netstat.lastconn._header, offlineVerdict: (window.mods.netstat.offline) ? "offline" : "online"};console.log(JSON.stringify(output, 0, " "));

@GitSquared, thanks for your time and effort for solving this.

It looks right to me, except the "offlineVerdict" value :-1:

{
 "iface": "wlp1s0",
 "internalIPv4": "172.16.16.29",
 "externalIPinfo": {
  "geo": {
   "latitude": 42.6833,
   "longitude": 23.3167,
   "metro_code": null,
   "time_zone": "Europe/Sofia"
  },
  "ip": "Public IP REDACTED"
 },
 "lastReachFinished": true,
 "lastReachHeader": "GET / HTTP/1.1\r\nHost: ipinfo.now.sh\r\nConnection: keep-alive\r\n\r\n",
 "offlineVerdict": "offline"
}

Indeed. I'm going to continue investigating this tomorrow, hopefully i'll have something for you.

@presianbg Could you try this test version? I'm exactly sure it will fix the problem but doesn't hurt to try.

image
Same result + the file system widget is stuck on "Calculating Available Space..."

Seems like a case of #446 on linux too... Well that one at least will be easy to fix. Gonna have to try something else to fix your original issue though. Hang tight!..

@presianbg How about this one?

Works flawlessly :) Thanks!

Great! So here's what's going on: After the geoip API call, there's another test that tries to determine the latency (ping) of your connection. It's using external software utilities and because of that, doesn't necessarily run on the NIC selected by eDEX.

Your screen probably shows --ms as ping, right? That's why.

In the build I just sent you, I just commented out the line that triggered the offline state when the ping failed. To actually fix the issue, I'm going to look into making the geoip call send back some latency report - not sure how though.

I tried replacing the ping implementation with something that would use Node's built-in networking modules and always work on the right NIC, but using ICMP packets with Node requires root privileges :/

Your screen probably shows --ms as ping, right?

Yes, this is correct.

You may try using something like that:

聽curl -w "dns_resolution: %{time_namelookup}, tcp_established: %{time_connect}, ssl_handshake_done: %{time_appconnect}, TTFB: %{time_starttransfer}\n" -o /dev/null -s "https://gitub.com"

I mean it's not the perfect solution, but it's not mandatory to use ICMP :)

ipinfo.now.sh is no longer working. moved to ipinfo.io

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vhenrique05 picture Vhenrique05  路  3Comments

jakewilliami picture jakewilliami  路  4Comments

bennettyuan18 picture bennettyuan18  路  5Comments

clragon picture clragon  路  6Comments

jwulf picture jwulf  路  5Comments