edison-fw / edison-oobe

MIT License
1 stars 2 forks source link

rewrite-wip: wired connection (host mode) not detected correctly #7

Closed htot closed 3 years ago

htot commented 3 years ago

Hi @mwallnoefer

afbeelding However, checking with connman:

root@yuna:~# connmanctl  
connmanctl> technologies 
/net/connman/technology/p2p
  Name = P2P
  Type = p2p
  Powered = False
  Connected = False
  Tethering = False
/net/connman/technology/ethernet
  Name = Wired
  Type = ethernet
  Powered = True
  Connected = True
  Tethering = False
/net/connman/technology/wifi
  Name = WiFi
  Type = wifi
  Powered = True
  Connected = False
  Tethering = False
  TetheringIdentifier = EDISON-4D-70
  TetheringPassphrase = xxxxxxxxxxxxxxxxx
/net/connman/technology/bluetooth
  Name = Bluetooth
  Type = bluetooth
  Powered = False
  Connected = False
  Tethering = False
connmanctl> services 
*AO Wired                ethernet_00800f951d4d_cable
*A  OP35 Extra 5G        wifi_784b87ad4d70_4f503335204578747261203547_managed_psk
    OP35 Extra           wifi_784b87ad4d70_4f503335204578747261_managed_psk
    Oranje Plantage 35   wifi_784b87ad4d70_4f72616e6a6520506c616e74616765203335_managed_psk
...
mwallnoefer commented 3 years ago

This is about a physical USB Ethernet adapter, not the USB gadget? Hmm, I have only one with an USB-C connector which I may not connect to the Edison.

htot commented 3 years ago

That's right. I'll also test the USB gadget and bluetooth tether and open an issue if needed (likely).

htot commented 3 years ago

With gadget: afbeelding

No ip address same as with issue #8.

htot commented 3 years ago

I fixed up the code for showing Wired network , except _getIFaceIP is now not working probably due to the interface not being called eth0 as we expect in wired_form(). On my machine it is called enp0s17u1u1. Hail systemd. When I modify that afbeelding

mwallnoefer commented 3 years ago

Yeah, the problem lies in configure_edison line 900:

...
        elif Net == "Connected":
            Settings.Wired.IP = _getIFaceIP("eth0")
            Settings.Wired.Type = "Ethernet dongle"
            Settings.Wired.Mode = "checked"

How could we figure out what the name of the actual interface is :thinking:?

mwallnoefer commented 3 years ago

One solution (but not a very pretty one) could be the use of something like this:

basename `find /sys/class/net/ -type d -name "eth0" -o -name "en*"`

Since I am not aware of any method to figure this out over connman 😞 .

Some more hacks: https://stackoverflow.com/questions/54761878/get-list-of-ethernet-device-names-in-bash-script

htot commented 3 years ago

Once we know connman service name:

# connmanctl services ethernet_00800f951d4d_cable | grep Ethernet
  Ethernet = [ Method=auto, Interface=enp0s17u1u1, Address=00:80:0F:95:1D:4D, MTU=1500 ]
mwallnoefer commented 3 years ago

https://github.com/mwallnoefer/edison-oobe/commit/cbd367eaaba5e1dcfadb0836dd479b6047d14cbd

htot commented 3 years ago

Tested that. Needed one small fix e9c5a80cd6c58baee005ae8a3f9b53a400e3fe82, with that seems fine.

mwallnoefer commented 3 years ago

Okay, so I guess that we could close also this one?

htot commented 3 years ago

Agreed