[SOLVED] Ethernet expansion card is not connecting

Oh wow, that is really interesting! I just received my own ethernet expansion card and I have the exact same problem. Linux doesn’t detect any carrier on the card, but when I suspend the laptop, the LEDs go back up as if there was a link then! Pop open the lid again, and boom, as soon as Linux resumes, the LEDs go off. They blink a little from time to time, but it’s just a blip, not a solid “yep, we have a link here”.

Here are the logs when I plug in the device:

Dec 02 18:25:55 angela kernel: usb 4-2: new SuperSpeed USB device number 5 using xhci_hcd 
Dec 02 18:25:55 angela kernel: usb 4-2: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.04 
Dec 02 18:25:55 angela kernel: usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=6 
Dec 02 18:25:55 angela kernel: usb 4-2: Product: USB 10/100/1G/2.5G LAN 
Dec 02 18:25:55 angela kernel: usb 4-2: Manufacturer: Realtek 
Dec 02 18:25:55 angela kernel: usb 4-2: SerialNumber: 4013000001 
Dec 02 18:25:55 angela NetworkManager[59731]: <info>  [1670023555.2285] manager: (eth0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/8) 
Dec 02 18:25:55 angela kernel: cdc_ncm 4-2:2.0: MAC-Address: REDACTED
Dec 02 18:25:55 angela kernel: cdc_ncm 4-2:2.0: setting rx_max = 16384 
Dec 02 18:25:55 angela kernel: cdc_ncm 4-2:2.0: setting tx_max = 16384 
Dec 02 18:25:55 angela kernel: cdc_ncm 4-2:2.0 eth0: register 'cdc_ncm' at usb-0000:00:0d.0-2, CDC NCM (NO ZLP), REDACTED
Dec 02 18:25:55 angela mtp-probe[67996]: checking bus 4, device 5: "/sys/devices/pci0000:00/0000:00:0d.0/usb4/4-2" 
Dec 02 18:25:55 angela mtp-probe[67996]: bus: 4, device: 5 was not an MTP device 
Dec 02 18:25:55 angela systemd-udevd[67995]: Network interface NamePolicy= disabled on kernel command line. 
Dec 02 18:25:55 angela NetworkManager[59731]: <info>  [1670023555.8143] device (eth0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external') 
Dec 02 18:25:55 angela mtp-probe[68056]: checking bus 4, device 5: "/sys/devices/pci0000:00/0000:00:0d.0/usb4/4-2" 
Dec 02 18:25:55 angela mtp-probe[68056]: bus: 4, device: 5 was not an MTP device 

Notice how NetworkManager doesn’t seem to like the interface somehow…

Here’s what iproute2 thinks of that interface:

anarcat@angela:~$ ip link show eth0 | head -1
6: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000

Here’s the requested lshw output:

  *-network
       description: Ethernet interface
       physical id: e
       bus info: usb@4:2
       logical name: eth0
       serial: REDACTED
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=cdc_ncm driverversion=6.0.0-4-amd64 duplex=half firmware=CDC NCM (NO ZLP) link=no multicast=yes port=twisted pair

… and, for good measure, lsusb:

Bus 004 Device 005: ID 0bda:8156 Realtek Semiconductor Corp. USB 10/100/1G/2.5G LAN
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.20
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8156 
  bcdDevice           31.04
  iManufacturer           1 Realtek
  iProduct                2 USB 10/100/1G/2.5G LAN
  iSerial                 6 4013000001
  bNumConfigurations      3
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0039
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              256mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval              11
        bMaxBurst               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0068
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              256mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass     13 
      bInterfaceProtocol      0 
      iInterface              5 CDC Communications Control
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      3 REDACTED
        bmEthernetStatistics    0x0031501f
        wMaxSegmentSize               1518
        wNumberMCFilters            0x8000
        bNumberPowerFilters              0
      CDC NCM:
        bcdNcmVersion        1.00
        bmNetworkCapabilities 0x2b
          8-byte ntb input size
          max datagram size
          net address
          packet filter
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval              11
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 
      iInterface              4 Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0062
    bNumInterfaces          2
    bConfigurationValue     3
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              256mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0 
      iInterface              5 CDC Communications Control
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      3 REDACTED
        bmEthernetStatistics    0x0031501f
        wMaxSegmentSize               1518
        wNumberMCFilters            0x8000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval              11
        bMaxBurst               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              4 Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0016
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      HIRD Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   2
      Lowest fully-functional device speed is High Speed (480Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x001c
  (Bus Powered)
  U1 Enabled
  U2 Enabled
  Latency Tolerance Messaging (LTM) Enabled

Any idea what could be happening here? The card is basically not working…

This is a 12th gen DIY kit, running Debian testing/bookworm 11:

Linux angela 6.0.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.8-1 (2022-11-11) x86_64 GNU/Linux

I’m available for further debugging, firmware upgrades, etc.

I just filed a support request about this with the Framework team directly, this seems serious enough…

1 Like

Interesting! Thanks for creating a support ticket, is there anyway to share that link or is it private?

One last detail that may be helpful is that my ethernet expansion card was working well for a while when I first received it. It only stopped working sometime around early November (I can’t remember exactly when since I wasn’t using it that often at that time)

unfortunately, i couldn’t find a clear link. it seems there’s a message-id to keep track of threads, but that doesn’t give you a web view. I’ll give updates here as soon as i have them.

for me it never worked. which version of the laptop do you have, and on which OS?

Got a reply from support, they asked me to reproduce in one of the distros mentioned here, but I replied that someone here (@Cameron_Abma) had the same problem in Ubuntu 22.04.

They have also asked for a video where we see the behavior, which I also sent. Here is a copy:

https://paste.anarc.at/publish/2022-12-04-DY2F7vHBRijfZ2ycTDLSxlw4wtfEBcZIX0ytJBE6sKQ/VID_20221204_145120_proxy.mp4

1 Like

Okay so here’s an interesting tidbit:

If I reboot the laptop, the link LEDs actually come back up during the POST boot, before the kernel loads. Then when the Linux kernel runs, they turn off and then back on, steadily, until … something runs and then they turn back off.

So something is breaking this during boot, because in the BIOS, it just works! Fascinating!

I bet this is a problem with powertop. When I run powertop, there is an entry like this in the Tunables tab:

Good Autosuspend for USB device USB 10/100/1G/2.5G LAN [Realtek]      

Hitting space bar here magically fixes the ethernet card, woohoo!

Or, if you will, this magic command whould turn the card back on:

echo 'on' > '/sys/bus/usb/devices/4-2/power/control';

to revert:

echo 'auto' > '/sys/bus/usb/devices/4-2/power/control';

… interestingly, even in auto mode, the card still works. So maybe there’s something in the powertop setup code that breaks this…

I’ll notify support, but I think this might be a fix for you, @samdas @Cameron_Abma :slight_smile:

Well that is certainly much better!

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec  238             sender
[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec                  receiver

whoohoo!

9 Likes

Hmm… Are either of you using one of those wacky “green” ethernet switches? If so, I wonder if there are any tools or means of trying it out with those features disabled.

@Matt_Hartley sorry for the late reply, i fixed it by reinstalling ubuntu. for now, no issues with the adapter or the cable. so sorry, i cant show you any data anymore, what i could remember is that the adapter was recognized by the system, just for some reason, it would not accept the cable. anyway, sorry i didnt get responed earlier.

@SodaStream i dont know what you mean, but i use the ethernet expansion card directly to the modem/router of my provider. no switches there.

1 Like

No. The first tests were performed against some generic tplink switch, and the latter test against a Turris Omnia router. Not sure what a whacky green switch is either…

Could this be that you changes some power saving settings in the first install and those were lost in the second? I used powertop here and that seems to be the root cause of the problem…

cant remember but i highly doubt it, i was not changing any power saving settings, just installed a bunch of stuff that is recommanded. but will try out and report back. if that would be the case, i would be super mad. it also doesnt make much sense to me, isnt wifi more costly energy wise than ethernet?

Edit: first, i have the newest ubuntu now, so 22.10, i had the issue with 22.04, so it could be already fixed. but i have here now the power saver option and the automatic power saver enabled. and ethernet works fine.

As @anarcat already posted, the device/chipset doesn’t seem to be playing nicely with power saving optimisations. Following @anarcat’s manual sysfs workaround indeed stops the immediate issue for me.

I don’t really want to have to execute ad hoc commands though (scripted or manually), so I dug a little deeper to see what was auto-configuring the device into a(n erroneous) power-saving state.

On my system at least (Ubuntu 22.04), it was TLP. Adding the following line to /etc/tlp.conf worked-around the immediate issue, and the Ethernet expansion begins working as expected upon insert, sleep, reboots etc:

/etc/tlp.conf

USB_DENYLIST="0bda:8156"

Where ‘0bda:8156’ is the device id for the Ethernet expansion.

Of course… this now disables the auto-suspend for the Ethernet expansion (though I’m not sure of the power impact), so a proper solution would be to ensure the chipset/expansion behaves correctly with these power optimisations in the first place.

5 Likes

Ah, that’s more likely what’s causing the problem here, indeed. I was suspicious when powertop wouldn’t restore the bad behavior when re-enabling the power saving trick. It seems it’s doing it differently than tlp.conf is maybe?

Anyways, I also have tlp setup, so that could also be the culprit in my case.

yeah, that’s what I told support too… I don’t think this issue is fixed just because we found the workaround…

1 Like

ok i have it now, after reading your comments, yes it most probably was tlp for me.
I installed it today, and did some other stuff, after a restart, the card wasnt working. i tried to edit the tlp.conf, but that didnt change it, only uninstalling tlp worked. so i will keep it uninstalled until the issue is solved. thanks for the help

Some lines of TP-Link, D-Link, and others provide a “green” ethernet technology which sometimes plays poorly with certain network configurations. While it’s prudent to do our part in saving the planet, saving a couple watts over a year won’t really help as much and will likely wind up with switches in ditches as people move to more traditional ethernet switches.

I thought I’d screen for that potential source of trouble, but if you’re experiencing this when plugged in to your router, then the point is moot.

2 Likes

Did you run systemctl daemon-reload after changing the tlp.conf? and then restart the service?

1 Like

@nadb yes i did. also reboot, nothing. only uninstalling solves it.
i stopped the service and started it again, nothing.

You don’t happen to have a config in /etc/tlp.d/00-yourhostname?

@nadb i have 00-template.conf in the tlp.d folder

I was wondering if they had anything configured in there, in which case they might overrride any changes you made. That and if you just made changes to the main tlp.conf they might not stick since the recommended method is to add file in /etc/tlp.d with your modified config.