Page 1 of 1

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

Posted: Thu Feb 14, 2019 10:51 am
by skcasb
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 ?

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

Posted: Thu Feb 14, 2019 11:05 am
by ShiftPlusOne
https://github.com/raspberrypi/firmware/issues/1100

ethtool will report the true status

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

Posted: Thu Feb 14, 2019 11:22 am
by skcasb
I confirm that using ethtool I can see the real Link detected and solve my problem.

Thank you.

Regards.