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
On my Raspberry 3B+ I get always carrier = 1 even if the network cable is disconnected.
Code: Select all
carrier = 0 --> network cable detached carrier = 1 --> network cable attached
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 ?