Changes to System.DeviceAttached/System.DeviceRemoved

Got a good idea? You can suggest new features here.

Add device names and other device data to System.DeviceAttached/System.DeviceRemoved

Yes
14
100%
No
0
No votes
Have no clue what I am talking about
0
No votes
Don't care
0
No votes
 
Total votes: 14

Snowbird
Experienced User
Posts: 380
Joined: Fri Jul 03, 2009 10:04 am

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by Snowbird » Sun Jun 25, 2017 5:24 pm

ok, I did what you said, now I have this :

Code: Select all

19:28:34            Exception in thread WMI Thread:
19:28:34            Traceback (most recent call last):
19:28:34              File "threading.pyc", line 801, in __bootstrap_inner
19:28:34              File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1525, in run
19:28:34                self._current_devices(guid, device, **dev)
19:28:34              File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1488, in _current_devices
19:28:34                class_guid = device.ClassGuid.upper()
19:28:34            AttributeError: 'NoneType' object has no attribute 'upper'
19:28:34            

Snowbird
Experienced User
Posts: 380
Joined: Fri Jul 03, 2009 10:04 am

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by Snowbird » Sun Jun 25, 2017 5:35 pm

kgschlosser wrote:yes there is. this is why I am having you test it out. But with BT there has to be a specific things I have to code into the plugin to look for as the devices get added removed in a different manner.. Now if you delete the pairing completely and then remake it does it then show a connection for the device?

because if it does then i will have to monitor BT devices for being enabled or not.
actually this does work ! But I first had to reinstall the version located in this post :
viewtopic.php?f=5&t=9588&start=75#p46704

When I pair or unpair the phone, not only I can see the phone itself but also the other BT services related to the phone as well, so this does work !!! :)

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Mon Jun 26, 2017 3:39 am

I know it works. Just gotta make all the tidbits work. And windows 10 is not making this very easy. I am wondering if it is acting like this possibly becsuse of administrative privileges. Try running EG as admin and see if it begins to work.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Mon Jun 26, 2017 3:40 am

And copy and paste the events for the BT stuff for the phone. I want to see what it looks like.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 380
Joined: Fri Jul 03, 2009 10:04 am

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by Snowbird » Mon Jun 26, 2017 7:54 am

Ok, here's what happens when I pair my phone :

Code: Select all

09:38:59   System.Device.Attached.USBDevice.RAZR MAXX HD <dynamic-device 'USBDevice'>
09:38:59      Attached
09:38:59         Python Script
09:38:59            Name: RAZR MAXX HD, Description: Bluetooth Peripheral Device, Caption: RAZR MAXX HD, DeviceId: BTHENUM\DEV_B07994F7ABDF\8&A715F6&0&BLUETOOTHDEVICE_B07994F7ABDF, DeviceID: BTHENUM\DEV_B07994F7ABDF\8&A715F6&0&BLUETOOTHDEVICE_B07994F7ABDF, ClassGuid: None, PNPDeviceID: BTHENUM\DEV_B07994F7ABDF\8&A715F6&0&BLUETOOTHDEVICE_B07994F7ABDF, 


09:39:01   System.Device.Attached.USBDevice.Bluetooth Peripheral Device <dynamic-device 'USBDevice'>
09:39:01      Attached
09:39:01         Python Script
09:39:01            Name: Bluetooth Peripheral Device, Description: Bluetooth Peripheral Device, Caption: Bluetooth Peripheral Device, DeviceId: BTHENUM\{00001801-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001801-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001801-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:03   System.Device.Attached.USBDevice.Bluetooth Peripheral Device <dynamic-device 'USBDevice'>
09:39:03      Attached
09:39:03         Python Script
09:39:03            Name: Bluetooth Peripheral Device, Description: Bluetooth Peripheral Device, Caption: Bluetooth Peripheral Device, DeviceId: BTHENUM\{00001800-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001800-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001800-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:05   System.Device.Attached.USBDevice.Headset Gateway <dynamic-device 'USBDevice'>
09:39:05      Attached
09:39:05         Python Script
09:39:05            Name: Headset Gateway, Description: Headset Gateway, Caption: Headset Gateway, DeviceId: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.Handsfree Gateway <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: Handsfree Gateway, Description: Handsfree Gateway, Caption: Handsfree Gateway, DeviceId: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.MAP SMS <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: MAP SMS, Description: MAP SMS, Caption: MAP SMS, DeviceId: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.Headset Gateway <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: Headset Gateway, Description: Headset Gateway, Caption: Headset Gateway, DeviceId: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001112-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.OBEX File Transfer <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: OBEX File Transfer, Description: OBEX File Transfer, Caption: OBEX File Transfer, DeviceId: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.OBEX Object Push <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: OBEX Object Push, Description: OBEX Object Push, Caption: OBEX Object Push, DeviceId: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:07   System.Device.Attached.USBDevice.OBEX Phonebook Access Server <dynamic-device 'USBDevice'>
09:39:07      Attached
09:39:07         Python Script
09:39:07            Name: OBEX Phonebook Access Server, Description: OBEX Phonebook Access Server, Caption: OBEX Phonebook Access Server, DeviceId: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:09   System.Device.Attached.USBDevice.Handsfree Gateway <dynamic-device 'USBDevice'>
09:39:09      Attached
09:39:09         Python Script
09:39:09            Name: Handsfree Gateway, Description: Handsfree Gateway, Caption: Handsfree Gateway, DeviceId: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000111F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:13   System.Device.Attached.USBDevice.AV Remote Control Target <dynamic-device 'USBDevice'>
09:39:13      Attached
09:39:13         Python Script
09:39:13            Name: AV Remote Control Target, Description: AV Remote Control Target, Caption: AV Remote Control Target, DeviceId: BTHENUM\{0000110C-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000110C-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000110C-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:15   System.Device.Attached.USBDevice.Advanced Audio <dynamic-device 'USBDevice'>
09:39:15      Attached
09:39:15         Python Script
09:39:15            Name: Advanced Audio, Description: Advanced Audio, Caption: Advanced Audio, DeviceId: BTHENUM\{0000110A-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000110A-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000110A-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000,


09:39:17   System.Device.Attached.USBDevice.Bluetooth Peripheral Device <dynamic-device 'USBDevice'>
09:39:17      Attached
09:39:17         Python Script
09:39:17            Name: Bluetooth Peripheral Device, Description: Bluetooth Peripheral Device, Caption: Bluetooth Peripheral Device, DeviceId: BTHENUM\{0000110E-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000110E-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000110E-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:19   System.Device.Attached.USBDevice.Android Network Access Point <dynamic-device 'USBDevice'>
09:39:19      Attached
09:39:19         Python Script
09:39:19            Name: Android Network Access Point, Description: Android Network Access Point, Caption: Android Network Access Point, DeviceId: BTHENUM\{00001116-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001116-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001116-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:21   System.Device.Attached.USBDevice.MAP SMS <dynamic-device 'USBDevice'>
09:39:21      Attached
09:39:21         Python Script
09:39:21            Name: MAP SMS, Description: MAP SMS, Caption: MAP SMS, DeviceId: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001132-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:25   System.Device.Attached.USBDevice.OBEX Phonebook Access Server <dynamic-device 'USBDevice'>
09:39:25      Attached
09:39:25         Python Script
09:39:25            Name: OBEX Phonebook Access Server, Description: OBEX Phonebook Access Server, Caption: OBEX Phonebook Access Server, DeviceId: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{0000112F-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:29   System.Device.Attached.USBDevice.OBEX Object Push <dynamic-device 'USBDevice'>
09:39:29      Attached
09:39:29         Python Script
09:39:29            Name: OBEX Object Push, Description: OBEX Object Push, Caption: OBEX Object Push, DeviceId: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001105-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:33   System.Device.Attached.USBDevice.OBEX File Transfer <dynamic-device 'USBDevice'>
09:39:33      Attached
09:39:33         Python Script
09:39:33            Name: OBEX File Transfer, Description: OBEX File Transfer, Caption: OBEX File Transfer, DeviceId: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, DeviceID: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, ClassGuid: None, PNPDeviceID: BTHENUM\{00001106-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&A715F6&0&B07994F7ABDF_C00000000, 


09:39:37   System.Device.Attached.USBDevice.Bluetooth Peripheral Device <dynamic-device 'USBDevice'>
09:39:37      Attached
09:39:37         Python Script
09:39:37            Name: Bluetooth Peripheral Device, Description: Bluetooth Peripheral Device, Caption: Bluetooth Peripheral Device, DeviceId: BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\8&20E5A5E0&0&000000000000_00000009, DeviceID: BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\8&20E5A5E0&0&000000000000_00000009, ClassGuid: None, PNPDeviceID: BTHENUM\{00001101-0000-1000-8000-00805F9B34FB}_LOCALMFG&0000\8&20E5A5E0&0&000000000000_00000009,

Snowbird
Experienced User
Posts: 380
Joined: Fri Jul 03, 2009 10:04 am

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by Snowbird » Mon Jun 26, 2017 7:58 am

kgschlosser wrote:I know it works. Just gotta make all the tidbits work. And windows 10 is not making this very easy. I am wondering if it is acting like this possibly becsuse of administrative privileges. Try running EG as admin and see if it begins to work.
I still get this error when I start as admin :
09:57:11 Exception in thread WMI Thread:
09:57:11 Traceback (most recent call last):
09:57:11 File "threading.pyc", line 801, in __bootstrap_inner
09:57:11 File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1525, in run
09:57:11 self._current_devices(guid, device, **dev)
09:57:11 File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1488, in _current_devices
09:57:11 class_guid = device.ClassGuid.upper()
09:57:11 AttributeError: 'NoneType' object has no attribute 'upper'
09:57:11

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Mon Jun 26, 2017 5:22 pm

give this one a try
Attachments
System-1.2.0.egplugin
(206.95 KiB) Downloaded 633 times
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 380
Joined: Fri Jul 03, 2009 10:04 am

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by Snowbird » Mon Jun 26, 2017 5:49 pm

nice ! the error is gone ! :wink:

but what happened to these events ? they are not generated anymore ?
System.SessionUnlock
System.SessionLock

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Tue Jun 27, 2017 2:26 am

follow th initial instructions for running the plugin. I need that log.txt file after it has run for a minute or so.. you will see all kinds of stuff go flying by on the screen. I am not worried about the session locking and unlocking. this thing is not complete. I only set this version to give excessive logging information. and i need to see that information.
If you like the work I have been doing then feel free to Image

pralima87
Posts: 11
Joined: Tue Sep 11, 2018 3:36 pm

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by pralima87 » Thu Sep 13, 2018 8:08 pm

Is this System-1.2.0.egplugin safe to use with RC4?

It looks like is working fine,
but I'm only getting the DeviceRemoved working 100%.

When my BT controller connects I only get the event the first time.
one the next connections I get no event.
System.Device.Attached.HIDDevice.HID-compliant game controller <dynamic-device 'HIDDevice'>

But when it disconnects it always trow the event:
System.Device.Removed [u'\\\\?\\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002054c_PID&09cc#8&553dc99&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}']

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Thu Sep 13, 2018 9:01 pm

The device removed is not working properly either. The event is not supposed to show up like that.

I am going to need to know a whole lot more information
When you say device "connected" are you referring to plugging in a blutooth dongle? Or are you referring to a device connecting to the Bluetooth??.. these are 2 completely different things. This plugin will generate events for plugging and unplugging devices from a computer. If it is a device connection over some kind of wireless signal it is not going to work properly. The issue with Bluetooth is that it is a serial port connection that is made when a device connects. Some devices have specific windows drivers but most do not. And unless windows sees a connected device as a device and not a comport it is not going to generate an event or it will generate one that is more of a generic

Also. As far as the blutooth dongle drivers go. Are you using the ones that came with windows or are you using the broadcom widcomm drivers?
If you like the work I have been doing then feel free to Image

pralima87
Posts: 11
Joined: Tue Sep 11, 2018 3:36 pm

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by pralima87 » Thu Sep 13, 2018 10:16 pm

Or are you referring to a device connecting to the Bluetooth??
Yep I have a bluetooth dongle and need to detect the events when the controller connects to it ;)

Are you using the ones that came with windows or are you using the broadcom widcomm drivers?[/quote]
broadcom widcomm driver

Somehow I'm getting some proper events now:
System.DeviceAttached [u'\\\\?\\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002054c_PID&09cc#8&553dc99&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}']
System.DeviceRemoved [u'\\\\?\\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002054c_PID&09cc#8&553dc99&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}']

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Fri Sep 14, 2018 5:32 am

ok so you are looking for a device connecting to the bluetooth dongle.
The plugin is not designed to capture those. This is because not every bluetooth device adds a device to the device manager. It is one of those things i did plan on adding.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by kgschlosser » Tue Oct 29, 2019 1:03 am

OK so I never liked how this plugin worked. I found it clunky and slow. So I started doing some research on the Windows API and I have found a better way!. The old system would take about 10 seconds to load all of the devices on a PC the new way takes less then 100 milliseconds. I am still in the research process and have done some programming. I want to see what kinds of things I am able to access using the Windows API instead of WMI
If you like the work I have been doing then feel free to Image

r0tkäppchen
Posts: 5
Joined: Tue Dec 07, 2021 6:04 pm

Re: Changes to System.DeviceAttached/System.DeviceRemoved

Post by r0tkäppchen » Mon Mar 07, 2022 3:18 pm

kgschlosser wrote:
Thu Jun 22, 2017 7:20 pm
well people you can give this version of the system plugin a go... it is goin to require you to have EG 0.5 RC2 installed. this will not work with any versions before that
when I added and installed the plugin into the plugins>System folder (by either adding it or replacing the previous files) or a new subfolder I created in the plugins folder I got the error:

Code: Select all

         Exception in thread WMI Thread:
         Traceback (most recent call last):
           File "threading.pyc", line 801, in __bootstrap_inner
           File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1105, in run
             **dev
           File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 711, in _create_event
             if name.endswith('.'):
         AttributeError: 'NoneType' object has no attribute 'endswith'
causing eventghost to freeze when I try to eg delete an event

I'm not getting the error on a fresh EG 0.5 RC6 without any settings. But once I load my previous tree, I'm getting it.

EG 0.5 RC6
Windows 10 64bit

edit: I'm not getting the error on the 2nd version of the plugin you posted. But the events created only contain either generic information like:

Code: Select all

System.Device.Removed.Keyboard.Erweitert (101 oder 102 Tasten) <dynamic-device 'Keyboard'>
or an event that is formatted in a way that you can't put it into a macro like:

Code: Select all

System.Device.Attached [u'\\\\?\\HID#VID_045E&PID_0750&MI_00#7&1624bf4f&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}']
had this issue with 2 non-bluetooth keyboards I connected

In addition to that, eventghosts' tray icon is red and I can't run any Actions unless it's an action that runs by itself at the very moment eventghost starts.
On EG0.5 RC2, it works when I use it with an empty configuration. But once I load up the old one, the arrow turns red again and restarting EG causes it to freeze.
edit2: Apparently, I'm getting a lot more errors upon checking the "Log Debug Info" option when loading up an empty configuration with the System plugin installed:

Code: Select all

16:47:15: 0 MainThread: PluginManager.ScanAllPlugins :0.12538039999999998
16:47:15: 0 MainThread: SendKeysParser.__init__()
16:47:15: 0 MainThread: Document.ShowFrame()
16:47:15: 0 MainThread: Document.ShowFrame => None
---> Willkommen beim EventGhost <---
16:47:16: 0 EventThread: EventThread.StartSession(filename=None)
16:47:16: 0 ActionThread: ActionThread.StartSession(filename=None)
16:47:16: 1 MainThread: OSDFrame.__init__(parent=None)
16:47:16: 0 ActionThread: Document.Load(filePath=None)
16:47:16: 0 MouseThread: MouseThread.run()
16:47:16: 0 ActionThread: Document.LoadEmpty()
16:47:16: 0 MainMessageReceiver: BroadcastNotifier.OnPowerBroadcast(hwnd=397924, uMsg=536L, wParam=32787L, lParam=8213888)
16:47:16: 0 MainMessageReceiver: BroadcastNotifier.OnPowerBroadcast(hwnd=397924, uMsg=536L, wParam=32787L, lParam=8213952)
16:47:16: 0 MainMessageReceiver: BroadcastNotifier.OnPowerBroadcast(hwnd=397924, uMsg=536L, wParam=32787L, lParam=8213984)
16:47:16: 0 MainMessageReceiver: BroadcastNotifier.OnPowerBroadcast(hwnd=397924, uMsg=536L, wParam=32787L, lParam=8209232)
16:47:16: 0 ActionThread: StartLoad(cls=<class 'eg.Classes.TreeLink.TreeLink'>)
16:47:16: 0 WMI Thread: WMI.MountDrive()
16:47:16: 0 ActionThread: XML loaded in 0.009035 seconds.
16:47:16: 1 MainThread: TreeCtrl.OnItemCollapsingEvent(event=<wx.TreeEvent>)
Autostart
16:47:16: 0 ActionThread: ActionThread.StartSession => None
System.PowerProfile.HighPerformance
Main.OnInit
System.PowerSaving.Off
System.PowerSource.Line
System.Monitor.On
Exception in thread WMI Thread:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 1105, in run
    **dev
  File "C:\ProgramData\EventGhost\plugins\System\Device\Notifier.py", line 711, in _create_event
    if name.endswith('.'):
AttributeError: 'NoneType' object has no attribute 'endswith'
Okay, I tried to reinstall a fresh, plugin-less 0.5 RC2 after uninstalling the previous instance, rebooting and clearing all contents of C:/user/me/appdata/ that contained the name "eventghost" to confirm that the logs are error-free there but I'm already getting an error file upon installation: https://pastebin.com/yNqypn5k and loading up my configuration makes it behave the same way it did when the System 1.2.0 plugin was installed

now even 0.4.1 gave me errors until I uninstalled, deleted everything inside c:/PROGRAMdata/eventghost folder mentioned in its error, rebooted and reinstalled.

edit3: when trying to do the same before installing 0.5 RC2, activating "Log Debug Info" there and restarting, I'm getting an error similar to the one that started with

Code: Select all

16:47:15: 0 MainThread: PluginManager.ScanAllPlugins :0.12538039999999998
, minus the part that references the System plugin.
I then installed the System plugin on an empty configuration and that caused red log entries:

Code: Select all

18:48:20: 1 MainThread: PluginInstall.Import(filepath=u'c:\\users\\arsi\\downloads\\install\\system-1.2.0.egplugin')
18:48:27: 1 MainThread: PluginOverviewDialog.Destroy()
18:48:28: 1 MainThread: PluginInstall.Import => None
And upon restart, the errors mentioning the System plugin reappear again.

I tried reinstalling 0.5 RC6 again with deleting the ProgramData subfolder again and running an empty configuration with "Log Debug Info". That didn't cause any errors (except the one with the X10 remote).
adding the second iteration of your System plugin didn't cause an error.
but adding my configuration file causes the error that references the System folder again.

now it's working error-free because I loaded the configuration up via a .egtree file instead of a .xml
I then saved the config as a new .egtree file, reloaded and voilla, still no errors.

edit4: system plugin not working anymore. It believe it may be because I moved it to another location.^
reinstalled with all the steps I mentioned earlier.
works with the System Plugin as long as I don't load up my configuration. But as soon as I do that, I'm getting the error that references the system plugin folder.

Apparently it works on an empty config file for the first couple of seconds or before the first restart and then it produces the error

_______
Any updates on that other way you wanted to implement the feature?
_______

Post Reply