02-21-2020 01:02 AM
@mlars wrote:
Thanks for all your suggestions. We ended putting an arduino in between. If somebody works out a solution (make an example script), that works with cut usb cable, that could be useful in the future.
That’s pretty much in between the NI IO box and the FTDI GPIO board in terms of complexity to program and price. 😀
Guess you found the sweet spot there.
As to your original approach, don’t hold your breath. It’s technically pretty much impossible as the USB controller on the motherboard of your computer doesn’t really give you the necessary direct pin control at all. All you would get is a digital IO line with a high frequency random chatter signal that you can somehow influence in what chatter it produces but not even if it chatters or not let alone a static onoff signal.
02-21-2020 01:12 AM
@cbutcher wrote:
That is basically the opposite of what the OP wants...
Seems like cutting the wire is the simplest solution.
Try it out. I bet with you you won’t get very far in what the ops intention was. Even if you could hack into the device driver it would be hard (albeit depending on the USB controller not necessarily impossible) to do that. Obviously hacking the device driver is not a solution as you would need to hack virtually 100ds of different drivers to make this a general purpose solutions (aside of legal problems about reverse engineering and all that).
Sometimes technical advances can mean that a simple thing as a communication link gets so complex in its low level implementation that hacking it as hobby project is pretty much not an option anymore.
02-21-2020 06:34 AM
@rolfk wrote:
@cbutcher wrote:
That is basically the opposite of what the OP wants...
Seems like cutting the wire is the simplest solution.
Try it out. I bet with you you won’t get very far in what the ops intention was. Even if you could hack into the device driver it would be hard (albeit depending on the USB controller not necessarily impossible) to do that. Obviously hacking the device driver is not a solution as you would need to hack virtually 100ds of different drivers to make this a general purpose solutions (aside of legal problems about reverse engineering and all that).
Sometimes technical advances can mean that a simple thing as a communication link gets so complex in its low level implementation that hacking it as hobby project is pretty much not an option anymore.
Maybe I'm drastically misunderstanding, but it doesn't sound (at least to me) like the OP wants USB at all. They just want to control one of four wires that happens to be in a connector commonly used for USB communications.
02-21-2020 07:58 AM
@cbutcher wrote:
Maybe I'm drastically misunderstanding, but it doesn't sound (at least to me) like the OP wants USB at all. They just want to control one of four wires that happens to be in a connector commonly used for USB communications
I’m fully understanding the OPs intention as what you describe. The point I’m trying to make is that you do not have that kind of low level control over the USB signals. There is a host of drivers between you and the interface controller and the actual hardware implementation of the USB interface controller is a mini computer of its own that the lowest level driver can send commands to but these commands do not typically support things like “assert DO line to high” but rather “Send an USB Control Message to this endpoint, with this control code and this index selector”.
02-21-2020 08:25 AM - edited 02-21-2020 08:28 AM
Everything Rolf has posted here is correct (no surprises there).
To understand a bit more the complexities of how USB even communicates, the following link may help. It is NOT simply a string of one and zero. It MUST be hardware-timed and the allowed sequences of bits are specified.
02-21-2020 10:49 AM
Without knowing how the driver works... maybe you could write a script that would simply uninstall the USB driver to turn the port off, then reinstall the driver to turn the port back on. Does anyone know if a USB port with no driver installed would output the 5V power?
Another option: turn the computer Off to set the port to 0, reboot to turn it back On.
😉
02-21-2020 11:38 AM - edited 02-21-2020 11:38 AM
Instal/deinstall falls pretty flat on its nose for any built in USB port as they are typically part of the chipset (the big chip or chips that perform all kind of IO including SATA, PCI, ISB, FW, etc, integrated video controller and memory controller. DeInstalling a single USB port is there not an option.
02-21-2020 12:10 PM - edited 02-21-2020 12:11 PM
@cbutcher wrote:
That is basically the opposite of what the OP wants...
Since the OP went with the Arduino, it is basically the same as what the OP wants.
.
If the OP had purchased the official Arduino Uno instead of a clone on eBay the cost is $22 which is actually 50% more than the Adafruit board I linked.
.
.