Comments (6)
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.
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:
- this USB KVM
- Logitec Unifying USB receiver: https://www.logitech.com/products/mice/unifying-receiver-usb.910-005236.html
- Arduino UNO (Elegoo R3) https://www.elegoo.com/products/elegoo-uno-r3-board?_pos=1&_sid=6debb4cda&_ss=r
- Generic (Unknown manufacturer and model) smart card reader
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.
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.
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:
- The KVM is plugged
- Swap the KVM to the other PC
- All the
Removed
events are shown - Swap the KVM to the current PC
- No
Added
events detected but I can see in log console an entry for an USB Concentrator. - Swap the KVM to the other PC again
- All the
Removed
events are shown - Swap the KVM to the current PC again
- No events nor log console events are shown
- I can loop from 6 to 9 with the same results
- Plug an end device to one USB PC port
- 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....)
- 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.
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.
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)
- added flash storage size HOT 1
- Disposing UsbEventWatcher on Linux throws a null reference exception. HOT 3
- IUsbEventWatcher Events not working on WinForms HOT 1
- Inside the windows service this package not working HOT 4
- USB exact description need to include. HOT 2
- false "device added" events are fired on Linux HOT 10
- Separate UsbEventWatcher construction from start of enumerating devices HOT 3
- Capture device number and bus number on Linux HOT 2
- No events or device list on macOS HOT 2
- How are you guys compiling this library on Linux? HOT 2
- Does not work on Windows with .NET 7 HOT 8
- Can we allow the monitor loop to exit? HOT 14
- Triggering events works only two times under windows HOT 4
- Support for 32 bit Raspberry Pi OS HOT 26
- Feature Request: Provide a way to toggle debug logging without relying on the DEBUG preprocessor directive HOT 7
- Application terminates immediately when USB is put in on MacOS HOT 5
- Include osx-arm64 target runtime HOT 7
- Missing existing device metadata while running in docker, until device is removed and then added HOT 1
- Add sd-device backend for Linux HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usb.events.