GithubHelp home page GithubHelp logo

Comments (6)

Jinjinov avatar Jinjinov commented on May 21, 2024

Can you give me any more details about the devices that are not recognized? Device type, model, manufacturer - or device specifications website?

If I can't reproduce the bug, I can't fix it :)

from usb.events.

GoNzCiD avatar GoNzCiD commented on May 21, 2024

Yes, please tell me if this info is enough:

  • A Toshiba memory stick 16Gb (Regarding google model seems to be hayabusa):
    This is the lines when I unplug it, but no logging when I plug-in it:
    Removed:
    Device Name:
    Device System Path: USB\VID_0E0F&PID_0001\66259FFDB0A0CD9107187694
    Mounted Directory Path:
    Product:
    Product Description:
    Product ID: 0001
    Serial Number: 66259FFDB0A0CD9107187694
    Vendor:
    Vendor Description:
    Vendor ID: 0E0F
    

And the same for:

And the same for all, it can recognize when I remove the device but not when I plug them in :( It's very rare for me and maybe there are any external factor that is breaking the detection. I can see in the code that there are some Debug traces, so maybe I download your sources and try again debugging.

from usb.events.

Jinjinov avatar Jinjinov commented on May 21, 2024

I see, thanks for the details. Unfortunately I don't own any of the devices you listed, except for a Toshiba memory stick which works on my PC. Are any USB devices detected at all? If not, there could be a problem with Windows 10 (I use Windows 8.1)

Does any of the previous NuGet packages work?

I changed the detection code a few times, so previous code could actually work.

If none of the previous NuGet packages work, you can try uncommenting these lines:

https://github.com/Jinjinov/Usb.Events/blob/master/Usb.Events/UsbEventWatcher.cs#L232
https://github.com/Jinjinov/Usb.Events/blob/master/Usb.Events/UsbEventWatcher.cs#L240

and comment these lines:

https://github.com/Jinjinov/Usb.Events/blob/master/Usb.Events/UsbEventWatcher.cs#L234
https://github.com/Jinjinov/Usb.Events/blob/master/Usb.Events/UsbEventWatcher.cs#L242

The program will probably crash, but you should at least get the event, if you put a breakpoint at

https://github.com/Jinjinov/Usb.Events/blob/master/Usb.Events/UsbEventWatcher.cs#L297

from usb.events.

GoNzCiD avatar GoNzCiD commented on May 21, 2024

Hi @Jinjinov,

I don't test with older versions

This is the first time I use your package, I'm just looking for an event that alerts me when the Arduino is connected to PC1 or PC2 via the KVM USB of the link above. (In fact it should be valid for me the USB hub detection, not needed the end USB device)
I can try with older versions in the next days, but I have discovered an interesting behavior...

Scenario: The KVM USB connected to one USB PC PORT and some devices connected to the KVM USB (even a USB HUB to the KVM and other end device to this HUB). I'm running the last sources from this repo.

Test 1:

  • Plug the KVM to the PC.
  • No events detected
  • Plug the memory stick (or any other end device) to other USB PC port
  • All Added events are shown, from the memory stick and any other devices connected (KVM, HUB, and end devices)
  • Unplug the KVM
  • All the Removed events are shown

Test 2:

  1. The KVM is plugged
  2. Swap the KVM to the other PC
  3. All the Removed events are shown
  4. Swap the KVM to the current PC
  5. No Added events detected but I can see in log console an entry for an USB Concentrator.
  6. Swap the KVM to the other PC again
  7. All the Removed events are shown
  8. Swap the KVM to the current PC again
  9. No events nor log console events are shown
  10. I can loop from 6 to 9 with the same results
  11. Plug an end device to one USB PC port
  12. All Added events are shown (a lot of them, probably repeated, it seems like they are queued in some buffer and once I use another USB port of the PC all of them are processed at this moment....)
  13. And now I'm at point 1 again.

I don't know if it helps you in some way or do you have any other test in mind that I can do...

from usb.events.

Jinjinov avatar Jinjinov commented on May 21, 2024

Oh, so, you are using your USB devices via the KVM switch - that explains a lot.

My Usb.Events works with WMI in Windows and I think that WMI triggers one event for one Win32_USBControllerDevice

Because you have your KVM plugged in, there is only one such event, because there is only one Win32_USBController - all other devices are child devices and the KVM is the parent device.

Usb.Events 1.1.1.1 listens to Win32_USBControllerDevice events, but some older versions listened to the Win32_PnPEntity events, so they might work.

Try with older NuGet versions - or try to comment the Win32_USBControllerDevice lines and uncomment the Win32_PnPEntity like I said in the previous comment.

Also, try plugging the USB devices directly to your PC, without the KVM - does that work?

from usb.events.

GoNzCiD avatar GoNzCiD commented on May 21, 2024

Unfortunately I have not enough time to work on it, but I could test that changing these lines and debug, some even is catch when plug/unplug devices to the kvm, So maybe yes, it's possible to adapt it.

from usb.events.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.