USB: disable data, leave charging capability only

Hello.
I have a modem that has ethernet port and USB charging.
If it is connected to a USB charger, etherner works. If it is connected to a USB device, it disables ethernet port.

I would like to charge the modem via USB port in my router. However, once I plug it in, it identified the router as data-capable and therefore disables ethernet.

Is it possible to config OpenWRT to disable data in USB and leave it only with charging capability? That way the USB port in my router would act just like a wall charger, not trying to exchange any data.

Thanks!

Hello, this depends heavily on your used OpenWrt device as some handle the usb power through the usb driver and some aren't.
This means if you unload the usb driver, it disables also the power if it's handld by the driver.

Which device are you using?

1 Like

Thanks for helping! I have a TP-Link Archer C7 v4.

Whatever you think it's worth trying, I would try (I just need the commands to it, don't know them by hard).

How about handling this at the hardware side, by foot example using a USB cable that has the power wires only, or otherwise use weekdays know as USB condom - - a USB connector that connects the power wires only; made for people to charge their phones in public places without exposing them to possible threat of hacking or data theft by a device at the other end of the USB port.

2 Likes

Yes, it would be one option. But I'm hoping there is a couple of commands I can issue to disable the data part, and use USB for power only in my router with OpenWRT.

Remove all "kmod-usb-" packages?
It's an easy tab in "Software" section, just search for them and remove them. Should disable usb capability but the power still remains.

If unfortunately that modem still detects an impedance between the pins or something like that, then there is nothing else to be done software side.

Thank you, I removed the usb packages, but the modem still recognizes as a data-capable device, then it automatically disables the ethernet port.

I would suggest to just use a little double socket lamp adapter if you have just one plug into the wall, into it put a cheap phone charger to get 5 volts USB. Otherwise tampering with the router and de soldering the data pins would be too complicated to be worth bothering with. :slight_smile:

I think the C7 V4 has a hub chip to expand the CPU single port to two external ports. So the hub is always going to attach to any device that is plugged in. It doesn't matter what the CPU does.

As @mgehab said there are adapters that interrupt the data lines, as a defense against malware contained in innocent looking USB-charged products.

1 Like

Or you could just try convering the 2 middle pins in the USB connectors.

Check this for example

2 Likes

This is an excellent idea! Thanks!

EDIT: this didn't work. My phone, for example, correctly charges only and does not show as connected to a data-capable device. However my modem was still identifying as connected to a data device. Very weird! I just received my "usb condom" (data blocker) device, and that one worked! Now the modem thinks it is connected to a charger. So, something in the modem is highly sensitive that the tape covering was not working, but a full data blocker cable worked.

1 Like

I don't imagine that the current is strong enough to go through the tape; it's more likely that the tape didn't reach the end of the data pens inside the connector.

But anyway, glad a solution worked for you.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.