Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Having issues with your DietPi installation or found a bug? Post it here.
richg
Posts: 10
Joined: Sun Mar 07, 2021 11:07 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by richg »

I tried booting up with the Ethernet cable connector disconnected, but the router up and running. The Ethernet would not work.

I took photos of the boot-up sequence without and with Ethernet connected.

Boot-up with no Ethernet
https://photos.app.goo.gl/FSgAXnWXVS3oYZPG9

https://photos.app.goo.gl/FSgAXnWXVS3oYZPG9

Example of a Good Boot-Up with Ethernet
https://photos.app.goo.gl/ES1hpxSHanUZmjHt9
richg
Posts: 10
Joined: Sun Mar 07, 2021 11:07 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by richg »

I was able to fix it once I could see the boot-up session.

I read this post: viewtopic.php?t=5289

I modified the time sync mode to custom.
dietpi-config > Advanced Options and choose "custom" as time sync mode.

I am not sure why this was preventing the system from booting up.
User avatar
Joulinar
Posts: 4203
Joined: Sat Nov 16, 2019 12:49 am

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by Joulinar »

well usually time sync should time out after 60 sec. This is as well shown on your picture > last line 10/60

Does it stuck at 10/60 or does it continue?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
richg
Posts: 10
Joined: Sun Mar 07, 2021 11:07 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by richg »

The unit tried 60/60 times and "Exited with error". See the picture in the link below.

https://photos.app.goo.gl/QV9421oYA7ZYrKHV6

It seemed to have booted up all the way, but the Ethernet connection was not established.
User avatar
Joulinar
Posts: 4203
Joined: Sat Nov 16, 2019 12:49 am

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by Joulinar »

this looks as expected. So I don't know how deactivating the time sync should influence this. :?

Are you able to have a keyboard connected and could check status? ip a

as well can you share network config cat /etc/network/interfaces
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
richg
Posts: 10
Joined: Sun Mar 07, 2021 11:07 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by richg »

Below is a the response of ip a.

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul
t 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
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOW
N group default qlen 1000
    link/ether b8:27:eb:33:47:ac brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.10/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
This is the output from cat /etc/networks/interfaces.

Code: Select all

# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Local
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112

# WiFi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 0.0.0.0
netmask 0.0.0.0
gateway 0.0.0.0
#dns-nameservers 0.0.0.0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
User avatar
MichaIng
Site Admin
Posts: 2780
Joined: Sat Nov 18, 2017 6:21 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by MichaIng »

So the only issue is that with a later plugged Ethernet cable, no network connection is established, while it works when the cable is connected on boot, right?

With a static IP address it should actually work. That also has been applied correctly, based on your ip a output. Has the default route been created? ip r
User avatar
Joulinar
Posts: 4203
Joined: Sat Nov 16, 2019 12:49 am

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by Joulinar »

@MichaIng

It's a little bit different. The issue is, that it is not working if RPi is booted up together with the router. Means, RPi is online before the Router. Looks like that Ethernet connection is not correctly detected. But yeah, usually it should work to connect the cable once the router is online :?

It seems to be only working if the RPi is booted after the router is online

Strange think, eth0 has a NO-CARRIER flag. Indeed cable is not detected. Probably a behaviour of the router?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2780
Joined: Sat Nov 18, 2017 6:21 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by MichaIng »

Ah, and I've overseen state DOWN (related to NO-CARRIER, I bet). So indeed then the cable connection state itself seems to not be updated somehow, probably when the router link becomes ready after the RPi link. I'm not sure how this is usually working, but in my case when restarting the router or such, I can see in the logs on the RPi how the link goes down and up, immediately, whether it's a udev event and/or triggered by the router, I'm not sure currently.

ethtool is installed (as it is by default), right? Would be interesting if running ethtool eth0 triggers the state shown by ip -br a s dev eth0 to be updated or if it still shows DOWN regardless of router connection.

What should definitely work is to reconfigure the interface:

Code: Select all

ifdown eth0
ifup eth0
If everything else does not lead to a satisfying solution, a little boot or login script that checks the interface state and in case re-configures it could be a workaround.
richg
Posts: 10
Joined: Sun Mar 07, 2021 11:07 pm

Re: Wired Ethernet on Connecting at Power-Up on Raspberry Pi 3

Post by richg »

The following is the response from typing ethtool eth0 when the Raspberry boots up before the router is up.

Code: Select all

Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pumbag
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: no
The response from ip -br a s dev eth0 is as follows:

Code: Select all

eth0             DOWN           192.168.0.10/24
I tried running the following:

Code: Select all

ifdown eth0
ifup eth0
This will work if the router is up and running when I run the script. If the router is not up or the Ethernet cable is not connected when the script is run, the connection will not be made. The problem is my unit is unattended and the power to the Raspberry Pi and router is cycled everyday. The Raspberry Pi comes up before the router and does not automatically establish an Ethernet connection. I did not have this problem with the pervious version of DietPi.
Post Reply