Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry pi 5 sometimes won't connect to LAN. #1922

Open
radekjuthner opened this issue Oct 18, 2024 · 17 comments
Open

Raspberry pi 5 sometimes won't connect to LAN. #1922

radekjuthner opened this issue Oct 18, 2024 · 17 comments

Comments

@radekjuthner
Copy link

I started RPI5, pressed SHIFT. RPI loaded Network installer and then lost network connection. Could not use Network installer. Replugging the network cable solved the problem.
Losing LAN connection happens very randomly - about once in 7 to 10 boots.
If I continue to boot linux in a bad state, then it is not possible to ping the router from the RPI, but it is possible to ping the RPI from the router.
I originally suspected the Linux driver (#6420), but the error occurs before it even boots.

Device (s)
Raspberry Pi 5

System
cat /etc/rpi-issue
Raspberry Pi reference 2024-03-15
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f19ee211ddafcae300827f953d143de92a5c6624, stage2

vcgencmd version
2024/10/10 00:36:47
Copyright (c) 2012 Broadcom
version 0e63dd5e (release) (embedded)

uname -a
Linux raspi5 6.6.44-v8+ raspberrypi/linux#1789 SMP PREEMPT Mon Aug 5 15:22:52 BST 2024 aarch64 GNU/Linux

@radekjuthner radekjuthner changed the title Raspberry pi 5 se občas nepřipojí k LAN síti. Raspberry pi 5 sometimes won't connect to LAN. Oct 18, 2024
@radekjuthner
Copy link
Author

Really no idea? I know of multiple cases with this problem.

@peterharperuk
Copy link

Are you saying the network installer is somehow breaking the lan connection when Linux boots?

@radekjuthner
Copy link
Author

Yes. I managed to catch this error. I turned on the RPI5 and entered the installer using the shift key. I wanted to download and install the OS. The installer informed me that I was not connected to the network. However, the LAN connector was connected, the LEDs indicated traffic. It was possible to ping the RPI5 from the router. This status is also transferred to the running Linux. After booting Linux, the RPI5 receives an IP address, but cannot ping the router gateway. However, the router can ping the RPI5. The error can be fixed either by disconnecting and connecting the LAN connector or by disabling and enabling the network through Network Manager.

@peterharperuk
Copy link

peterharperuk commented Nov 28, 2024

Sorry, still confused. You were in the network installer you weren't getting an IP address. How did you then boot Linux?

@radekjuthner
Copy link
Author

radekjuthner commented Nov 28, 2024

I have a Raspberry pi 5 with SSD. I have Raspbian installed on the SSD and it boots. I wanted to try another OS using the installer (holding the shift key during the boot process) and online installation. At this step, the mentioned failure occurred: no network connection.

EDIT:
Simply put: after booting Linux, the RPI receives an IP address from which it cannot ping the routerboard gateway, but the routerboard can ping the RPI. I have tried the latest versions of Raspbian, Ubuntu and MX Linux - always the same error (approximately one in 10 boots fails to reach the network). If the aforementioned distributions use the same LAN driver, the problem may be there. In my opinion, the problem is before the operating system boots - probably in the bootloader firmware. The error will be solved by disconnecting and then reconnecting via the LAN connector or ip link set eth0 down and ip link set eth0 up.

@peterharperuk
Copy link

Right so it's not a problem "caused" by the network installer. Obviously I'm not seeing this problem. Can you post the output of "ip addr" before and after it works?

In my opinion, the problem is before the operating system boots - probably in the bootloader firmware

Why do you think that? Could it not be an interoperability problem with your router?

@radekjuthner
Copy link
Author

I published the outputs here: #6420

@peterharperuk
Copy link

I have a Raspberry pi 5 with SSD

I assume you actually mean an NVMe disk. Once you're connected you could use the imager on the OS to flash a blank SD card with an image. It would be interesting to know if you only have the problem when booting from this NVMe.

Your ethernet adapter seems to have a funny name. How did you setup this disk? Your ethernet adapter seems to have renamed itself end0 which might have some bearing on the problem?

@radekjuthner
Copy link
Author

I also have a problem with booting from the SD card. I don't think the problem is in the OS, but before the OS boots. When I get to the Network installer (shift key when turning on the RPI), no OS is booted yet and the network is sometimes unavailable.

@peterharperuk
Copy link

The network installer that gets downloaded IS a linux image that's booted onto your device.

@radekjuthner
Copy link
Author

radekjuthner commented Nov 28, 2024

Below I attach the output when the error occurs. It's from a fresh OS install.

`ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 2c:cf:67:5a:36:5b brd ff:ff:ff:ff:ff:ff
inet 192.168.100.180/24 brd 192.168.100.255 scope global dynamic noprefixroute eth0
valid_lft 43170sec preferred_lft 43170sec
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 2c:cf:67:5a:36:5c brd ff:ff:ff:ff:ff:ff

dmesg | grep eth0
[ 0.550764] macb 1f00100000.ethernet eth0: Cadence GEM rev 0x00070109 at 0x1f00100000 irq 112 (2c:cf:67:5a:36:5b)
[ 3.748085] macb 1f00100000.ethernet eth0: PHY [1f00100000.ethernet-ffffffff:01] driver [Broadcom BCM54213PE] (irq=POLL)
[ 3.748094] macb 1f00100000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 7.843823] macb 1f00100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control t

ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 2c:cf:67:5a:36:5b brd ff:ff:ff:ff:ff:ff

ip neigh
192.168.100.130 dev eth0 INCOMPLETE
192.168.100.1 dev eth0 INCOMPLETE

lspci | grep Ethernet
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge

ping from router to RPI:
ping 192.168.100.180
PING 192.168.100.180 (192.168.100.180) 56(84) bytes of data.
64 bytes from 192.168.100.180: icmp_seq=42 ttl=64 time=1920 ms
64 bytes from 192.168.100.180: icmp_seq=43 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=86 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=117 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=148 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=179 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=210 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=241 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=272 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=303 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=334 ttl=64 time=890 ms
64 bytes from 192.168.100.180: icmp_seq=377 ttl=64 time=1920 ms
64 bytes from 192.168.100.180: icmp_seq=378 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=421 ttl=64 time=1920 ms
64 bytes from 192.168.100.180: icmp_seq=422 ttl=64 time=880 ms
64 bytes from 192.168.100.180: icmp_seq=465 ttl=64 time=1920 ms
64 bytes from 192.168.100.180: icmp_seq=466 ttl=64 time=870 ms
64 bytes from 192.168.100.180: icmp_seq=509 ttl=64 time=1920 ms
64 bytes from 192.168.100.180: icmp_seq=510 ttl=64 time=880 ms`

@peterharperuk
Copy link

It's as if your router isn't responding to arp. Does the arp command show anything interesting?

@radekjuthner
Copy link
Author

radekjuthner commented Nov 28, 2024

ARP did not show anything interesting.
My router is Banana BPI-R3 with Arch linux with ISC DHCPd. The RPI has a dedicated IP address based on the MAC address. Raspberry pi 4 and Raspberry pi 400 run on the same network without problems. Of course also other devices Smart TV, Smart Phones, printer. Only RPI 5 has a problem.

Maybe the problem is the insufficient shutdown of RPI5. I installed the RPI5 in a Pironman 5 box (https://www.sunfounder.com/products/pironman-5-nvme-m-2-ssd-pcie-mini-pc-case-for-raspberry-pi-5). It is still under standby voltage even after shutdown. Maybe the network doesn't "shut down enough" and stays in an indeterminate state. I notice the problem more on reboot than when turning on the RPI5 itself.

Edit:
I found that the error can be triggered when I run ip link set eth0 down and ip link set eth0 up several times in a row. A bit problematic to reproduce. Sometimes 5 times is enough, sometimes 10 times.

@peterharperuk
Copy link

The RPI has a dedicated IP address based on the MAC address

Does it behave better if you remove the static IP address from the router? I can't really imagine why it would make a difference but it might be worth a try.

@radekjuthner
Copy link
Author

I tried running things, but the result was the same. I let the IP address be assigned via DHCP without filtering by MAC address, assigning the IP address depending on the MAC address, I set a static IP address on the RPI5. It did not solve the problem. As I wrote, the problem must be somewhere at the firmware level, or I have faulty hardware.

@peterharperuk
Copy link

I wouldn't rule it out but I doubt it's a firmware problem.

I set a static IP address on the RPI5

I didn't quite follow all this. Are you still using a static IP address or not? If not, is the DHCP server the router or another machine?

Can you run the following two commands and post the output just for my curiosity?

sudo vcgencmd otp_dump | grep "5[1-2]:"
cat /sys/firmware/devicetree/base/chosen/rpi-duid

@radekjuthner
Copy link
Author

radekjuthner commented Nov 29, 2024

sudo vcgencmd otp_dump | grep "5[1-2]:"
cat /sys/firmware/devicetree/base/chosen/rpi-duid

Returns:
51:2ccf675a
52:365c0000

0000000012345678

It doesn't know if you wanted an output when the network connection is faulty. The output provided is from a problem-free network connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants