0

I have a device connected to a USB and it periodically sends data to my PC. During the time it is not sending data, the USB cable needs to be removed, else, the device won't work (a fail-safe feature, if the USB cable is connected and attached to pc, the device is in communication mode, if the USB cable is disconnected from pc, it is in stand-alone operation mode).

I was thinking to use the Devcon so I font has to use another hardware, I'll just disable the USB port during an operation mode, then enable it during communication mode. However, the periodic transfer of data can be set to every 5,10,15,30 minutes depending on the settings.

My question is, will it be okay to disable/enable the USB port periodically? Say every 5 minutes? Won't it cause any problem in the long run? Or would it be more efficient for me to use external hardware, a switch to connect/disconnect the USB? Appreciate any advice or thoughts.

ElsaKarami
  • 624
  • 1
  • 4
  • 14
axia_so2
  • 27
  • 6

1 Answers1

1

If devcon works for you, I don't see why it would cause any problems in the long run. There is no inherent reason why the hardware should get damaged when you run some commands in your software to disable a USB port.

Using external hardware to accomplish the same thing would not be more efficient because you'd have to pay for the hardware and maintain it.

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • Thanks David! Efficient I mean in terms of performance, but I gladly accept your answer. I was not sure if disable and enable the port will make the software/driver buggy but seems to be okay. Thanks a lot for your insight! – axia_so2 Nov 18 '21 at 21:36
  • I thought I only need to disable the usb ports, but unfortunately, it seems I have to turn off the USP port power and disabling the usb ports still keeps the power on. And it seems I can't turn off the USB port power so might have to go through the relay route. :( Another issue as the pc have limited USB ports. – axia_so2 Nov 19 '21 at 05:17