User Tools

Site Tools

This wiki is read only and for archival purposes only. >>>>>>>>>> Please use the new OpenWrt wiki at <<<<<<<<<<

The USB Port: An Overview

You already adjusted the configuration to meet your basic needs with the help of basic config? Good. If your device has USB ports, here you see how to put them to good use.

  • To obtain a very basic USB support under OpenWrt, see USB Basic Support
  • To obtain support for USB storage and mount a local filesystem please see USB Storage
    • To do basic storage operations, see Partitioning, Formatting and Mounting
    • To provide access to file system(s) on a storage device via network see the services Samba, NFS or SSH
    • To mount another / instead of the one located on the Flash, please see extroot
    • To execute a Kernel on external storage after booting a Kernel from flash, please see kexec
    • To install packages to a different location other then JFFS2, see opkg
  • To install a printer and grant access to it from the net, see Printservers overview.
  • To connect your OpenWrt-Router over your Smartphone with the Internet, see USB Tethering..
  • To connect your Smartphone over your OpenWrt-Router with the Internet, see USB reverse tethering..
  • To obtain audio support (for an USB sound card), and run audio daemon, see USB Audio Support (WIP)
  • To obtain support for USB video streaming devices, USB Video Support
    • For a webcam, see webcam (WIP)
  • To use a 3g/4g/UMTS/LTE USB Modem (UMTS Dongle) for WAN connection, please see 3gdongle
  • To use your Bluetooth enabled phone in a PAN see Forum
  • To connect a USB device to your OpenWrt router, but utilize drivers installed somewhere else (sic!), see USB over IP tunnel
  • To connect various devices (sensors, GPIO-expanders, ADCs, RTCs etc), see How to use I²C over USB

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

Turning USB power on and off

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


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


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.

doc/howto/usb.overview.txt · Last modified: 2018/01/02 13:34 by marcinkk