skcasb
Posts: 18
Joined: Wed Jul 11, 2018 12:46 pm

Raspberry Stretch: how to check if Ethernet cable is connected ?

Thu Feb 14, 2019 10:51 am

Hi All,

in general when I need to check if the ethernet cable is connected to a raspberry, I verify the value of /sys/class/net/eht0/carrier

Code: Select all

carrier = 0  -->  network cable detached

carrier = 1  -->  network cable attached
On my Raspberry 3B+ I get always carrier = 1 even if the network cable is disconnected.

My kernel version is 4.14.79-v7+ #1159

it seems that the problem is specific to RPI 3B+ as I read on this site:
https://raspberrypi.stackexchange.com/q ... ont-change
The proposed solution of connecting the Ethernet cable after turning on the raspberry is interesting but does not seem applicable in real cases.
Is there any other way to know if the network cable is connected ?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6259
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Raspberry Stretch: how to check if Ethernet cable is connected ?

Thu Feb 14, 2019 11:05 am

https://github.com/raspberrypi/firmware/issues/1100

ethtool will report the true status

skcasb
Posts: 18
Joined: Wed Jul 11, 2018 12:46 pm

Re: Raspberry Stretch: how to check if Ethernet cable is connected ?

Thu Feb 14, 2019 11:22 am

I confirm that using ethtool I can see the real Link detected and solve my problem.

Thank you.

Regards.

Return to “Troubleshooting”