USB电源是否始终启用?如果没有,如何编写驱动程序

时间:2023-01-27 23:07:14

I have a device that came with an AC power adapter where the connector is a mini USB plug. The device however doesn't seem to power itself from a computer's USB port (using a standard USB-mini USB cable) unless a specific driver is installed. The driver is only available for Windows. I would like to charge the device from USB plugs on different platforms.

我有一个附带交流电源适配器的设备,其中连接器是迷你USB插头。但是,除非安装了特定的驱动程序,否则设备似乎无法从计算机的USB端口(使用标准USB-mini USB电缆)供电。该驱动程序仅适用于Windows。我想从不同平台上的USB插头为设备充电。

My question is: why isn't power getting to the device without the driver? Is a driver always required for a USB port to start giving power? Or is it this device that's specifically made not to take a charge unless some software routine triggers it to do so?

我的问题是:没有驱动程序,为什么没有电源进入设备? USB端口是否始终需要驱动器才能开始供电?或者除非某些软件例程触发它,否则这个设备是否专门不收取费用?

I guess my question can be summarized as: Is power not present on the USB cable or is it present but the device ignoring it. If the answer is the former, I'll be trying to figure out how to write software that will enable the voltage to always be present.

我想我的问题可归纳为:USB电缆上是否存在电源或是否存在电源,但设备忽略它。如果答案是前者,我将试图弄清楚如何编写软件,使电压始终存在。

Thanks

5 个解决方案

#1


Why isn't power getting to the device without the driver?

没有驱动程序,为什么没有电源进入设备?

USB ports are always powered when the computer is on and the USB control software hasn't detected current overdraw.

当计算机开启且USB控制软件未检测到当前透支时,USB端口始终处于通电状态。

Is a driver always required for a USB port to start giving power?

USB端口是否始终需要驱动器才能开始供电?

No, the USB port is always required to start off providing power to the device, otherwise the device could never initiate a connection.

不,始终需要USB端口开始为设备供电,否则设备永远无法启动连接。

Or is it this device that's specifically made not to take a charge unless some software routine triggers it to do so?

或者除非某些软件例程触发它,否则这个设备是否专门不收取费用?

This can be complex. To meet the USB spec a device cannot pull more than a few mA until it's registered with the computer.

这可能很复杂。为了满足USB规范,设备在注册计算机之前不能超过几mA。

However, nearly every computer allows the USB port to pull the full 500mA (and more) before it'll shut the power off.

但是,几乎每台计算机都允许USB端口在关闭电源之前拉出500mA(或更多)电流。

The device you're charging is being nice by not pulling any significant power until the computer gives permission.

您正在充电的设备很不错,因为在计算机允许之前不会消耗任何重要的电量。

Writing software won't help, the device has to register with the USB bus, which will best be done with the driver.

编写软件无济于事,设备必须注册USB总线,最好用驱动程序完成。

However, the plug in charger doesn't do that. It likely has shorted the two data lines of the USB plug together, which signals the USB device that it's not connected to a computer and can pull the full 500mA without waiting.

但是,插入式充电器不能这样做。它可能将USB插头的两条数据线短路在一起,这表明USB设备没有连接到计算机,并且可以无需等待即可提取500mA电流。

Take a USB extension cable, cut off the jacket, and short the data lines (green and yellow, sometimes) together on the end going to the USB device, and leave them cut without touching anything on the end going to the PC, and leave the read and black power wires connected through.

拿一根USB延长线,剪掉外套,然后将数据线(有时是绿色和黄色)一起短接到USB设备上,然后将它们切断而不要接触到PC上的任何东西,并离开读取和黑色电源线通过连接。

It might work. If not, take the wall charger apart and find out what it's doing with each of the four USB wires, and see if you can duplicate that.

它可能会奏效。如果没有,请将壁式充电器拆开,找出它对四条USB线的影响,看看是否可以复制它。

#2


This might be helpful if you are targeting a linux system.

如果您的目标是Linux系统,这可能会有所帮助。

#3


This seems to be platform-specific. In Linux, USB ports are always energized, while on Windows they don't. Thumbdrives with LEDs turn off when unmounted in windows, but in Linux they stay lit. My cellphone's manual says that it can't be charged by a PC, but I regularly do on my linux machine, I guess that's because they don't have a driver and windows won't power up without one.

这似乎是特定于平台的。在Linux中,USB端口始终处于通电状态,而在Windows上则不然。在Windows中卸载时带LED的Thumbdrives会关闭,但在Linux中它们会保持点亮状态。我的手机说明它无法通过电脑充电,但我经常在我的linux机器上进行充电,我猜这是因为他们没有驱动程序,如果没有驱动程序,Windows将无法启动。

#4


Have you tried plugging it into a 'dumb' USB port - like the one on a car charger? Those ports are pure power and don't create a USB network. I think.

您是否尝试将其插入“哑”USB端口 - 就像车载充电器上的端口一样?这些端口是纯电源,不创建USB网络。我认为。

#5


Unless you have the hardware specs from the manufacturer, I think you are out of luck. You could try reverse engineering the driver to see what it does, but I'd expect it would be cheaper and easier just to buy one with cross platform drivers or charges without the driver.

除非你有制造商的硬件规格,否则我认为你运气不好。您可以尝试对驱动程序进行逆向工程以查看它的功能,但我希望只需购买带有跨平台驱动程序或没有驱动程序的费用就可以更便宜。

#1


Why isn't power getting to the device without the driver?

没有驱动程序,为什么没有电源进入设备?

USB ports are always powered when the computer is on and the USB control software hasn't detected current overdraw.

当计算机开启且USB控制软件未检测到当前透支时,USB端口始终处于通电状态。

Is a driver always required for a USB port to start giving power?

USB端口是否始终需要驱动器才能开始供电?

No, the USB port is always required to start off providing power to the device, otherwise the device could never initiate a connection.

不,始终需要USB端口开始为设备供电,否则设备永远无法启动连接。

Or is it this device that's specifically made not to take a charge unless some software routine triggers it to do so?

或者除非某些软件例程触发它,否则这个设备是否专门不收取费用?

This can be complex. To meet the USB spec a device cannot pull more than a few mA until it's registered with the computer.

这可能很复杂。为了满足USB规范,设备在注册计算机之前不能超过几mA。

However, nearly every computer allows the USB port to pull the full 500mA (and more) before it'll shut the power off.

但是,几乎每台计算机都允许USB端口在关闭电源之前拉出500mA(或更多)电流。

The device you're charging is being nice by not pulling any significant power until the computer gives permission.

您正在充电的设备很不错,因为在计算机允许之前不会消耗任何重要的电量。

Writing software won't help, the device has to register with the USB bus, which will best be done with the driver.

编写软件无济于事,设备必须注册USB总线,最好用驱动程序完成。

However, the plug in charger doesn't do that. It likely has shorted the two data lines of the USB plug together, which signals the USB device that it's not connected to a computer and can pull the full 500mA without waiting.

但是,插入式充电器不能这样做。它可能将USB插头的两条数据线短路在一起,这表明USB设备没有连接到计算机,并且可以无需等待即可提取500mA电流。

Take a USB extension cable, cut off the jacket, and short the data lines (green and yellow, sometimes) together on the end going to the USB device, and leave them cut without touching anything on the end going to the PC, and leave the read and black power wires connected through.

拿一根USB延长线,剪掉外套,然后将数据线(有时是绿色和黄色)一起短接到USB设备上,然后将它们切断而不要接触到PC上的任何东西,并离开读取和黑色电源线通过连接。

It might work. If not, take the wall charger apart and find out what it's doing with each of the four USB wires, and see if you can duplicate that.

它可能会奏效。如果没有,请将壁式充电器拆开,找出它对四条USB线的影响,看看是否可以复制它。

#2


This might be helpful if you are targeting a linux system.

如果您的目标是Linux系统,这可能会有所帮助。

#3


This seems to be platform-specific. In Linux, USB ports are always energized, while on Windows they don't. Thumbdrives with LEDs turn off when unmounted in windows, but in Linux they stay lit. My cellphone's manual says that it can't be charged by a PC, but I regularly do on my linux machine, I guess that's because they don't have a driver and windows won't power up without one.

这似乎是特定于平台的。在Linux中,USB端口始终处于通电状态,而在Windows上则不然。在Windows中卸载时带LED的Thumbdrives会关闭,但在Linux中它们会保持点亮状态。我的手机说明它无法通过电脑充电,但我经常在我的linux机器上进行充电,我猜这是因为他们没有驱动程序,如果没有驱动程序,Windows将无法启动。

#4


Have you tried plugging it into a 'dumb' USB port - like the one on a car charger? Those ports are pure power and don't create a USB network. I think.

您是否尝试将其插入“哑”USB端口 - 就像车载充电器上的端口一样?这些端口是纯电源,不创建USB网络。我认为。

#5


Unless you have the hardware specs from the manufacturer, I think you are out of luck. You could try reverse engineering the driver to see what it does, but I'd expect it would be cheaper and easier just to buy one with cross platform drivers or charges without the driver.

除非你有制造商的硬件规格,否则我认为你运气不好。您可以尝试对驱动程序进行逆向工程以查看它的功能,但我希望只需购买带有跨平台驱动程序或没有驱动程序的费用就可以更便宜。