mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Pi4 Network issues

Sat Jun 29, 2019 9:22 am

Hi,

I'm running my 2GB Pi4 running buster desktop and I've come across an issue where I (seemingly randomly) cannot connect to my network using the ethernet port when I boot (or reboot) the Pi.

When this happens I can't ping any of my local network (even the router), eth0 (I can't use wlan0 as the wi-fi signal won't reach my office.) has had a static IP set via dhcpcd.conf - but this problem happens even if I use dhcpcd for the IP address.

I've checked /var/log/syslog and can't see any obvious error messages and ethtool shows that a link has been detected.

The only way I can get my network up again is rebooting and then it's hit or miss that it re-connects correctly.

I'm hoping it's just a software or firmware issue rather than hardware problems - has anyone else come across this problem?

BTW, I've tried several network cables and a different network switch with no avail.

Paul

k-pi
Posts: 930
Joined: Sun Feb 12, 2017 1:46 pm
Location: Upper Hale, Surrey, UK.

Re: Pi4 Network issues

Sat Jun 29, 2019 9:25 am

Maybe try switching off the wifi(?), (& maybe bluetooth too).

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 9:39 am

Just tried that and still having random connection issues... :(

pcmanbob
Posts: 8324
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pi4 Network issues

Sat Jun 29, 2019 10:02 am

When having networking problems the first thing I would normally do is reboot the router, it may have just got a bit confused with a list of connected devices.

have you had any very short mains interruptions recently , that's often a cause of router problems because it does not do a proper power off and reboot
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 10:14 am

No mains problems - but I'll reboot the router anyway - thanks for the suggestion...

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 11:03 am

@pcmanbob

That seems do have done the trick - thanks for the idea - I forgot that routers can be a pain...

Cheers

Paul

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 1:55 pm

Spoke too soon - same problem (After several successful restarts) couldn't connect to the the network until I rebooted another two times..

I still think this could be software/firmware issue but I could be wrong, any other ideas to the cause of this problem?

pcmanbob
Posts: 8324
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pi4 Network issues

Sat Jun 29, 2019 2:42 pm

Is this a fresh install of buster or an update from stretch.

if its a fresh install try doing

Code: Select all

sudo apt-get update
sudo apt-get full-upgrade
if its an update from stretch then try a flashing another SD card with a fresh build of buster.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 3:49 pm

Brand new Buster installation only ever run ob my Pi4...

incognitum
Posts: 449
Joined: Tue Oct 30, 2018 3:34 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 3:52 pm

Does it work better if you do "sudo mii-tool -r eth0" ?

If so, might be the same issue as: https://www.raspberrypi.org/forums/view ... &p=1488476
Probably something timing specific.

pcmanbob
Posts: 8324
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pi4 Network issues

Sat Jun 29, 2019 3:52 pm

mrlinux2u wrote:
Sat Jun 29, 2019 3:49 pm
Brand new Buster installation only ever run ob my Pi4...
The try the update and see if that fixes your problem.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 4:39 pm

Thanks for the tip - I've tried it and I'll see how it goes.

I'll post an update when I've got one.

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 5:02 pm

This is a weird problem because I ssh'd into the Pi4 and rebooted it 10 times and the network worked as expected, but the 11th time resulted in no outgoing or incoming connection - however I could ping the Pi4 from my Chromebook but couldn't ssh into it.

Tried 'sudo mii-tool -r eth0' to no avail -

[email protected]:~ $ sudo mii-tool -r eth0
restarting autonegotiation...
[email protected]:~ $ ping 192.168.1.90
connect: Network is unreachable

Restarting the network fixed things for now.

[email protected]:~ $ sudo service networking restart
[email protected]:~ $ ping 192.168.1.90
PING 192.168.1.90 (192.168.1.90) 56(84) bytes of data.
64 bytes from 192.168.1.90: icmp_seq=1 ttl=64 time=0.891 ms
64 bytes from 192.168.1.90: icmp_seq=2 ttl=64 time=0.466 ms

incognitum
Posts: 449
Joined: Tue Oct 30, 2018 3:34 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 5:33 pm

mrlinux2u wrote:
Sat Jun 29, 2019 5:02 pm
[email protected]:~ $ sudo mii-tool -r eth0
restarting autonegotiation...
[email protected]:~ $ ping 192.168.1.90
connect: Network is unreachable

Restarting the network fixed things for now.
You do are configuring that static IP using dhcpcd -or some other network manager that can detect interface and carrier changes-, and not /etc/network/interfaces, right?

"sudo systemctl status dhcpcd" shows it started up normally, and did not bail out?

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 5:52 pm

Yep - setting static IP from dhcpcd.conf and here's the output from the command :

sudo systemctl status dhcpcd
Warning: The unit file, source configuration file or drop-ins of dhcpcd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
* dhcpcd.service - dhcpcd on all interfaces
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/dhcpcd.service.d
`-wait.conf
Active: active (running) since Sat 2019-06-29 17:45:46 BST; 1h 0min ago
Process: 363 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w (code=exited, status=0/SUCCESS)
Main PID: 475 (dhcpcd)
Tasks: 1 (limit: 3607)
Memory: 2.2M
CGroup: /system.slice/dhcpcd.service
`-475 /sbin/dhcpcd -q -w
Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: carrier lost
Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: deleting route to 192.168.1.0/24
Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: deleting default route via 192.168.1.254
Jun 29 17:53:52 raspberrypi4 dhcpcd[475]: eth0: carrier acquired
Jun 29 17:53:52 raspberrypi4 dhcpcd[475]: eth0: IAID 32:03:02:55
Jun 29 17:53:52 raspberrypi4 dhcpcd[475]: eth0: probing address 192.168.1.100/24
Jun 29 17:53:52 raspberrypi4 dhcpcd[475]: eth0: soliciting an IPv6 router
Jun 29 17:53:56 raspberrypi4 dhcpcd[475]: eth0: using static address 192.168.1.100/24
Jun 29 17:53:56 raspberrypi4 dhcpcd[475]: eth0: adding route to 192.168.1.0/24
Jun 29 17:53:56 raspberrypi4 dhcpcd[475]: eth0: adding default route via 192.168.1.254

Appears the carrier was lost and once I ran the 'sudo service networking restart' command it found it again.

Hope the output helps...

Paul

pcmanbob
Posts: 8324
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pi4 Network issues

Sat Jun 29, 2019 5:58 pm

If you are setting a static IP on the pi is the address you set out side of the address range of the DHCP server in your router.

If it's not the DHCP server in your router my be trying to assign the address to another device.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

incognitum
Posts: 449
Joined: Tue Oct 30, 2018 3:34 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 6:07 pm

It's normal for carrier to get lost when issuing that mii-tool command.

Code: Select all

Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: carrier lost
Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: deleting route to 192.168.1.0/24
Jun 29 17:53:39 raspberrypi4 dhcpcd[475]: eth0: deleting default route via 192.168.1.254
Jun 29 17:53:52 raspberrypi4 dhcpcd[475]: eth0: carrier acquired
What does stand out is that it takes a long 13 seconds to re-establish the link after that, while it only takes 3-4 seconds on my Pi 4.
Not sure what is causing that...

(P.S. restarting the networking service should not do anything, as it only handles stuff that is inside /etc/network/interfaces)

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 6:09 pm

@pcmanbob

Turns out my router was dishing out IP addresses (192.168.1.65 - 192.168.1.253) that clashed with the static IP address (192.168.1.100) so I've changed the dhcp range to 192.168.1.200 - 192.168.1.253.

I've got quite a few RPi's with static IP's that were in the original dhcp range that have never had issues but I'm hoping that change the range will help.

BTW, many thanks to the great help everyone has been offering - very much appreciated :D

paul

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 6:13 pm

@incognitum

I didn't notice the time taken - interesting.

I'm in the process of rebooting the Pi4 remotely and will see if the dhcp tweak helps things.

I'll post the results of my tests.

paul

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 6:27 pm

Another update...

Several successful reboots via ssh and then no connection to the Pi4 but I can still ping it...

Curious indeed...

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 7:02 pm

Yet another update..

Just re-ran 'sudo mii-tool -r eth0' on the Pi4 (locally) and the results are as follow

sudo systemctl status dhcpcd

Jun 29 19:55:43 raspberrypi4 dhcpcd[472]: eth0: carrier lost
Jun 29 19:55:43 raspberrypi4 dhcpcd[472]: eth0: deleting route to 192.168.1.0/24
Jun 29 19:55:43 raspberrypi4 dhcpcd[472]: eth0: deleting default route via 192.168.1.254
Jun 29 19:55:47 raspberrypi4 dhcpcd[472]: eth0: carrier acquired
Jun 29 19:55:47 raspberrypi4 dhcpcd[472]: eth0: IAID 32:03:02:55
Jun 29 19:55:47 raspberrypi4 dhcpcd[472]: eth0: probing address 192.168.1.100/24
Jun 29 19:55:47 raspberrypi4 dhcpcd[472]: eth0: soliciting an IPv6 router
Jun 29 19:55:52 raspberrypi4 dhcpcd[472]: eth0: using static address 192.168.1.100/24
Jun 29 19:55:52 raspberrypi4 dhcpcd[472]: eth0: adding route to 192.168.1.0/24
Jun 29 19:55:52 raspberrypi4 dhcpcd[472]: eth0: adding default route via 192.168.1.254

Still took 9 seconds (better than last time) - but at least it brought the network backup again..

incognitum
Posts: 449
Joined: Tue Oct 30, 2018 3:34 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 7:22 pm

mrlinux2u wrote:
Sat Jun 29, 2019 7:02 pm
Still took 9 seconds (better than last time)
Carrier detection/link negotiation took 4 seconds this time (19:55:43-19:55:47) which is normal.

The other time spent is testing if the IP address you specified is not already in use by someone else in the network, as safety check.
(You can skip that by adding noarp to dhcpcd.conf if you do not need that)

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 7:32 pm

@incognitum

Thanks for the noarp tip - added, now just need to figure why the network fails.

Cheers

Paul

mrlinux2u
Posts: 214
Joined: Sat Sep 24, 2011 8:38 pm

Re: Pi4 Network issues

Sat Jun 29, 2019 7:34 pm

@incognitum

Thanks for the noarp tip - added, now just need to figure why the network fails.

Cheers

Paul

pcmanbob
Posts: 8324
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Pi4 Network issues

Sat Jun 29, 2019 7:47 pm

Do you suffer the same problems if you removed the static IP from your pi and allow the router to assign it an IP address ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Troubleshooting”