Ethernet disabling in raspberry pi

30,669

Solution 1

I do not believe that this stops power to the ethernet port but it is worth a shot.

In Terminal type in sudo ifconfig eth0 down this should disable the ethernet port on the Raspberry Pi. To re-enable the port just type in sudo ifconfig eth0 up

And to view the names of all adapters type in sudo iwlist scan probably a better way of doing this but this has been working for me.

Solution 2

Disabling an ethernet interface actually doesn't power down the hardware. You have to disable the chip via bus power. But I'm afraid, that the same chip which contains the ethernet driver also contains the USB driver.

See this question on raspberrypi.stackexchange.com. There is different chip (LAN9512) discussed, but disabling it should be same. I just wonder why you have different chip, maybe different Raspberry Pi's revision?

So to power down the chip, just write 0 to the file /sys/devices/platform/bcm2708_usb/buspower:

echo 0x0 > /sys/devices/platform/bcm2708_usb/buspower

To power it up, write 1 to the same file:

echo 0x1 > /sys/devices/platform/bcm2708_usb/buspower

According to the discussion on the Raspberry Pi site, a consumption of this chip should be around 200 mA, what's about a half of a consumption of whole Raspberry Pi (which is about 400 - 500 mA).

It's also a good idea to turn the networking off before physically disabling the chip:

/etc/init.d/networking stop

Solution 3

If you don't want to deconfigure the interface fully, but do want to power it down, this works:

ip link set eth0 down

It may depend on the NIC drivers.

Share:
30,669
Sarweshkumar C R
Author by

Sarweshkumar C R

Software developer with 3+ years of experience in development of applications. Have good experience in understanding of the full mobile development life cycle with hands-on expertise with a wide variety of Android, SDK versions, design creation, coding, debugging, and maintenance.

Updated on July 05, 2022

Comments

  • Sarweshkumar C R
    Sarweshkumar C R almost 2 years

    We are trying to develop an application on raspberry pi. We are planning run Pi using batteries. So we have to reduce the power consumption in Pi. As far as we know, ethernet consumes a lot of current, so is there any way to disable ethernet without disturbing the two usb ports on raspberry pi model B? (Ethernet and usb ports are controlled by a single chip LAN8512). Any help or suggestion would be appreciated.

  • Sarweshkumar C R
    Sarweshkumar C R almost 8 years
    Thanks for the suggestions.