[RPi5] PCIe to Ethernet not recognised

  • I have a Waveshare PCIe to ethernet and M2 Hat on my Pi5, the Drive and ethernet port functions correctly with the standard Pi OS but with LibreELEC 12.2 the drive functions but the ethernet port is not recognised.

    lspci lists the ethernet port as Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 15). I have attached a dump from lspci.

    Pi5 lspci.txt

    I have tried using the lastest nightly build, but the ethernet port is still not recognised.

    Any advice please?

    Thanks

  • Hi,

    Thanks for your reply.

    I want to share my wireguard connection using the second lan port.

    I have had this config working with a usb lan adapter. I would like to use the port on the hat, as the usb lan adaptor is not always recognised on rebooting and requires the usb cable to be remove and reconnected to function.

    Thanks again

  • just put it in the .update folder of your LE12.2 installation and reboot

    Code
    cd /storage/.update/
    wget https://www.horus.com/~hias/tmp/libreelec/LibreELEC-RPi5.aarch64-12.2-devel-20250903185236-90fc4bb.tar
    reboot

    so long,

    Hias

  • The image I provided already includes the Realtek R8169 driver mentioned in the Waveshare docs and according to your log the ethernet adapter was detected just fine as eth1:

    Code
    Sep 03 18:37:19.569160 LibreELEC kernel: r8169 0001:04:00.0: enabling device (0000 -> 0002)
    Sep 03 18:37:19.577761 LibreELEC kernel: r8169 0001:04:00.0: can't read MAC address, setting random one
    Sep 03 18:37:19.588967 LibreELEC kernel: videodev: Linux video capture interface: v2.00
    Sep 03 18:37:19.594613 LibreELEC kernel: r8169 0001:04:00.0 eth1: RTL8168h/8111h, ae:7f:66:a5:82:77, XID 541, IRQ 194
    Sep 03 18:37:19.594825 LibreELEC kernel: r8169 0001:04:00.0 eth1: jumbo features [frames: 9194 bytes, tx checksumming: ko]

    So you should have an eth1 interface available (check with "ifconfig eth1"), note though that LE doesn't support multiple network interfaces and you have to configure it manually - you may need to adjust whatever you did to set up you USB ethernet adapter.

    so long,

    Hias

  • Thank you so much, making good progress, but I still need your help please as I am going round in circles trying to assign an ip address to eth1.

    Eth1 is listed with ifconfig eth1, but without ip address assigned. It does not appear in 'connmanctl services' or in the kodi connections screen.

    When I was using the usb adapter, the eth1 interface appeared in the kodi connections screen, and I was able to set the ip address as static using the gui. This setting persisted when rebooted.

    I don't know where the config files are for setting static ip address on eth1 in LibreELEC, so I tried setting the ipaddress using ifconfig commands:-

    ifconfig eth1 192.168.122.1
    ifconfig eth1 netmask 255.255.255.0
    ifconfig eth1 broadcast 192.168.1.120 (the fixed ip for eth0)

    after which eth1 appears in the kodi connection screen, but is listed as dhcp with an incorrect ip address. Forwarding between eth1 and wg0 using iptables does not work, even if I set the ip address to static with the same ip config within the kodi connections gui.

    Can you tell me where the config file to set the ip static address for eth1 is on LibreELEC please (if this is the correct way to proceed). I cannot use connmanctl as the interface does not appear until it has an ip address and ifconfig does not seem to be working.

    Hope you can help.

    Many thanks again for your time

  • Random MACs cause issues with ConnMan as the 'service' identifier is derived from the MAC, e.g. ethernet_b827ebb5e9a8_cable so randomly generated MACs mean a new (unconfigured) NIC on each boot.

    That said, I would still expect the second NIC to be detected and brought into an UP state, and for it to receive an IP via DHCP, which will mean you have two NICs in the same subnet etc. - but that's generally not an issue, and you can add a static DHCP reservation in the router to avoid manual configuration on the LE side.

    See if this works to assign a static MAC:

    Code
    nano /storage/.config/udev.rules.d/99-network-custom-mac.rules

    Create that ^ file with the content below:

    Code
    SUBSYSTEM=="net", ACTION=="add", KERNELS=="0001:04:00.0", PROGRAM="/sbin/ip link set %k address ae:7f:66:a5:82:77"

    Reboot to see if it works. Check the MAC assigned, then reboot again and check again to see if it changed? .. and if no, has the NIC been detected properly this time?