User Tools

Site Tools


docs:guide-user:hardware:usb.overview

Turning USB power on and off

On some routers, it is possible to turn USB power on and off using GPIO, like this:

On:

echo 1 > /sys/class/gpio/gpioN/value

Off:

echo 0 > /sys/class/gpio/gpioN/value

Get current state:

cat /sys/class/gpio/gpioN/value

Here, N should be replaced with pin number, which depends on router model. Here are some known pin numbers:

Model Pin number(s)
TP-Link TL-WR703N 8
TP-Link TL-WR842ND 6 (v1), 4 (v2)
TP-Link TL-WDR3600 21, 22
TP-Link TL-WDR4300 21, 22
TP-Link TL-WR1043ND 21 (v2), 8 (v3, v4)

If your model is not listed, you may try to find N by trial and error. For some N, the directory /sys/class/gpio/gpioN might not exist, in this case it can be created like this:

echo N > /sys/class/gpio/export

You may also look at this forum thread.

:!: Some routers might have difficulties providing full USB power output.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
docs/guide-user/hardware/usb.overview.txt · Last modified: 2019/09/08 12:21 by tmomas