Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HID Device not detecting #88

Closed
fireloudapp opened this issue Jul 27, 2019 · 51 comments
Closed

HID Device not detecting #88

fireloudapp opened this issue Jul 27, 2019 · 51 comments
Labels

Comments

@fireloudapp
Copy link

Hi,

I am trying to read data from a HID device, the device type is (USB RFID Id Contactless Proximity Smart Card Reader 125KHZ Em4001 Em4100). The device type is not detected and no events like connected and disconnected event triggered.

Please suggest.

I have provided the sample code for your reference
` class Program
{
#region Fields
private static readonly TrezorExample _DeviceConnectionExample = new TrezorExample();
///


/// TODO: Test these!
///

private static readonly DebugLogger Logger = new DebugLogger();
private static readonly DebugTracer Tracer = new DebugTracer();
#endregion

    static void Main(string[] args)
    {
        Console.WriteLine("Hello USB!");

        WindowsUsbDeviceFactory.Register(Logger, Tracer);
        WindowsHidDeviceFactory.Register(Logger, Tracer);

        var devices =  DeviceManager.Current.GetConnectedDeviceDefinitionsAsync(null);
        Console.WriteLine("Currently connected devices: ");
        foreach (var device in devices.Result)
        {
            Console.WriteLine($"{device.DeviceId} - {device.Label} - {device.Manufacturer} -  {device.ProductName}");
        }
        Console.WriteLine();
        Console.WriteLine("Connected device completed.");

        _DeviceConnectionExample.TrezorInitialized += _DeviceConnectionExample_TrezorInitialized;
        _DeviceConnectionExample.TrezorDisconnected += _DeviceConnectionExample_TrezorDisconnected;
        Go();
        new ManualResetEvent(false).WaitOne();
    }

    private static async Task Go()
    {
        var menuOption = await Menu();

        switch (menuOption)
        {
            case 1:
                try
                {
                    await _DeviceConnectionExample.InitializeTrezorAsync();
                    await DisplayDataAsync();
                    _DeviceConnectionExample.Dispose();

                    GC.Collect();

                    await Task.Delay(10000);
                }
                catch (Exception ex)
                {
                    Console.Clear();
                    Console.WriteLine(ex.ToString());
                }
                Console.ReadKey();
                break;
            case 2:
                Console.Clear();
                DisplayWaitMessage();
                _DeviceConnectionExample.StartListening();
                break;
        }
    }


    #region Event Handlers
    private static void _DeviceConnectionExample_TrezorDisconnected(object sender, EventArgs e)
    {
        Console.Clear();
        Console.WriteLine("Disconnected.");
        DisplayWaitMessage();
    }

    private static async void _DeviceConnectionExample_TrezorInitialized(object sender, EventArgs e)
    {
        try
        {
            Console.Clear();
            await DisplayDataAsync();
        }
        catch (Exception ex)
        {
            Console.Clear();
            Console.WriteLine(ex.ToString());
        }
    }
    #endregion

    #region Private Methods
    private async static Task<int> Menu()
    {
        while (true)
        {
            Console.Clear();

            var devices = await DeviceManager.Current.GetConnectedDeviceDefinitionsAsync(null);
            Console.WriteLine("Currently connected devices: ");
            foreach (var device in devices)
            {
                Console.WriteLine(device.DeviceId);
            }
            Console.WriteLine();

            Console.WriteLine("Console sample. This sample demonstrates either writing to the first found connected device, or listening for a device and then writing to it. If you listen for the device, you will be able to connect and disconnect multiple times. This represents how users may actually use the device.");
            Console.WriteLine();
            Console.WriteLine("1. Write To Connected Device");
            Console.WriteLine("2. Listen For Device");
            var consoleKey = Console.ReadKey();
            if (consoleKey.KeyChar == '1') return 1;
            if (consoleKey.KeyChar == '2') return 2;
        }
    }

    private static async Task DisplayDataAsync()
    {
        var bytes = await _DeviceConnectionExample.WriteAndReadFromDeviceAsync();
        Console.Clear();
        Console.WriteLine("Device connected. Output:");
        DisplayData(bytes);
    }

    private static void DisplayData(byte[] readBuffer)
    {
        Console.WriteLine(string.Join(' ', readBuffer));
        Console.ReadKey();
    }

    private static void DisplayWaitMessage()
    {
        Console.WriteLine("Waiting for device to be plugged in...");
    }
    #endregion
}`
@MelbourneDeveloper
Copy link
Owner

@srganeshram please post the logging output from the output window.

Also, please turn on break on all exceptions and post a screen shot of any exceptions.

https://christianfindlay.com/2019/07/14/visual-studio-break-on-all-exceptions/

@fireloudapp
Copy link
Author

fireloudapp commented Jul 28, 2019

@MelbourneDeveloper
Thanks for your quick response, below are the details you wanted. I am uSing Windows 10, VS 2019 FW .NET Core 3.0

Console Output:
console details

Exception Details and breakdown

image

image

I got the error @ WindowsBaseDevice.cs

Exception details

Device.Net.Exceptions.ApiException
HResult=0x80131500
Message=Could not get Hid Attributes (Call HidD_GetAttributes). Error code: 6
Source=Device.Net
StackTrace:
at Device.Net.Windows.WindowsDeviceBase.HandleError(Boolean isSuccess, String message) in D:\SourceCode\Device.Net\src\Device.Net\Windows\WindowsDeviceBase.cs:line 37

Call back:
image

@MelbourneDeveloper
Copy link
Owner

@srganeshram OK, I understand the problem. Thankyou very much for your detailed description.

The problem is first occurring here:

using (var safeFileHandle = APICalls.CreateFile(deviceId, APICalls.GenericRead | APICalls.GenericWrite, APICalls.FileShareRead | APICalls.FileShareWrite, IntPtr.Zero, APICalls.OpenExisting, 0, IntPtr.Zero))

The handle is being properly created so when it attempts to get the description for the Hid device, error 6 is returned. Error code 6 just means that the handle is invalid.

One potential reason why this might be happening is that the device is being opened in read/write mode with file sharing. Perhaps the device doesn't allow this. I have added some better error handling so that the problem is caught earlier and there's a description of the problem.

You can see it in the Develop branch:

if (safeFileHandle.IsInvalid) throw new DeviceException($"CreateFile call with Id of {deviceId} failed. Desired Access: {desiredAccess} (GenericRead / GenericWrite). Share mode: {shareMode} (FileShareRead / FileShareWrite). Creation Disposition: {creationDisposition} (OpenExisting)");

So, a question comes... Is this device read only? Or could there be a problem with shared connections? If so, maybe that is why connection is failing. Perhaps the code needs to be changed

Here:

using (var safeFileHandle = APICalls.CreateFile(deviceId, desiredAccess, shareMode, IntPtr.Zero, creationDisposition, 0, IntPtr.Zero))

And:

_ReadSafeFileHandle = APICalls.CreateFile(DeviceId, APICalls.GenericRead | APICalls.GenericWrite, APICalls.FileShareRead | APICalls.FileShareWrite, IntPtr.Zero, APICalls.OpenExisting, 0, IntPtr.Zero);

I've logged this issue:
#89

My advice to you is to clone the Develop branch, and fix the code for your device in those spots. Have a look at this documentation:
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea

If you get it working, I can review a PR and get the fix in to the library.

@fireloudapp
Copy link
Author

It seems like as you said, I am sure that device wont allow us to write, its a access card reader, it is used for reading card data only.

I took your updated code and found the error as

image

and the call stack is

image

@MelbourneDeveloper
Copy link
Owner

@srganeshram try changing the desired access, share mode, and createdisposition values.

Here is the documentation for CreateFile: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea

https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/opening-hid-collections

@MelbourneDeveloper
Copy link
Owner

@srganeshram the flags attributes argument could also be an issue...

Do you know the protocol for the card reader? My guess that a card reader would just show up as a device drive. If it just shows up as a drive, there's not much point in trying to use Hid.Net. You can just use standard file access methods to read/write files etc.

@fireloudapp
Copy link
Author

@MelbourneDeveloper
try changing the desired access, share mode, and createdisposition values.

I tried this but same issue.

The device type is "USB RFID Id Contactless Proximity Smart Card Reader 125KHZ Em4001 Em4100".

The reader is working fine, if I show the access card it reads it and displays in notepad or any textbox.

I am not sure about the protocol, and I don't think that it supports protocol. I just want to read any raw data from that device.
If you want the device details I have shared the link in my first comment.

Any help appreciate;

@MelbourneDeveloper
Copy link
Owner

@srganeshram can I TeamViewer on to your computer right now?

@MelbourneDeveloper
Copy link
Owner

@srganeshram and chance you could send a "USB RFID Id Contactless Proximity Smart Card Reader 125KHZ Em4001 Em4100" to Australia? I'd like to try to get it working.

@MelbourneDeveloper
Copy link
Owner

@srganeshram please send me a TeamViewer link on Twitter or Slack

@fireloudapp
Copy link
Author

@MelbourneDeveloper I will share in a few minutes.

@fireloudapp
Copy link
Author

I just twitted. Please check

@MelbourneDeveloper
Copy link
Owner

@srganeshram I didn't get it

@fireloudapp
Copy link
Author

your twitter id please.

@MelbourneDeveloper
Copy link
Owner

@srganeshram cfdevelop

@fireloudapp
Copy link
Author

Please check now.

@MelbourneDeveloper
Copy link
Owner

@srganeshram you gave away your TeamViewer details publicly Please change your TeamViewer password immediately!

@fireloudapp
Copy link
Author

I will reset no worries

@MelbourneDeveloper
Copy link
Owner

@srganeshram please send me a message. Not tweet.

@MelbourneDeveloper
Copy link
Owner

No!!!!!

Delete this and change your password!!!!QUICKLY! This is a public forum.

@MelbourneDeveloper
Copy link
Owner

@srganeshram you cannot give away your credentials in public like this.

@MelbourneDeveloper
Copy link
Owner

I'm sorry. We cannot do TeamViewer at this point. Please regenerate your password and we can chat about this later.

@fireloudapp
Copy link
Author

Ok. Not a problem. We can check later..

@fireloudapp
Copy link
Author

If it is fine, please share your email I will send the teamview link.

@MelbourneDeveloper
Copy link
Owner

@srganeshram where can I get a USB RFID Id Contactless Proximity Smart Card Reader 125KHZ Em4001 Em4100?

Is it possible to send one to Australia?

I will try to get this working if I can get one.

@fireloudapp
Copy link
Author

fireloudapp commented Jul 29, 2019

@MelbourneDeveloper I will check and let you know.

@fireloudapp
Copy link
Author

@MelbourneDeveloper I just found one, in amazon.com. RFID USB Card Reader

@MelbourneDeveloper
Copy link
Owner

MelbourneDeveloper commented Jul 29, 2019

@srganeshram I ordered one. It will take a couple of weeks.

@fireloudapp
Copy link
Author

@MelbourneDeveloper I am very kind of you. Thanks for the support.

@MelbourneDeveloper
Copy link
Owner

@srganeshram the package arrived but they couldn't find my letterbox or something... I think it will be delivered again Monday.

Could you please try the new 3.0 Beta 2 version to see if you are having the same issue?

@fireloudapp
Copy link
Author

@MelbourneDeveloper,
Package: I am waiting for the delivery.
New 3.0 Beta 2 version - I tried with the new beta version, the difference I found is earlier in my console it wont recognize the USB device itself, but now it can able to detect and list the devices.

But, I could not able to read the data still.I have attached the error details for your reference.

Console Window - (Using New version 3.0 Beta 2)
image
The above highlighted in red is the device I am trying to read, and it was listed out.

Error Details - (Using New version 3.0 Beta 2)

image

Call back
image

Let me know if you need any further details..

Thanks

@MelbourneDeveloper
Copy link
Owner

@srganeshram on the line where it tries to open the file handle change apicalls.genericread to 0 and see what happens.

@fireloudapp
Copy link
Author

@MelbourneDeveloper I changed as stated.
_ReadSafeFileHandle = APICalls.CreateFile(DeviceId, APICalls.GenericRead, 3, IntPtr.Zero, APICalls.OpenExisting, 0, IntPtr.Zero);
to
_ReadSafeFileHandle = APICalls.CreateFile(DeviceId, 0, 3, IntPtr.Zero, APICalls.OpenExisting, 0, IntPtr.Zero);

It seems it worked and passed the above line, I tried to read the data from the device by using "ReadReportAsync" method, but it throws me an error as "System.UnauthorizedAccessException: 'Access to the path is denied.'"

Error details
image

Instance details of "_ReadFileStream"
image

Call back
image

@MelbourneDeveloper
Copy link
Owner

@srganeshram this is the same issue I get when I try to read data from my mouse.

Please wait until Monday when I get the same device.

@fireloudapp
Copy link
Author

Ok. Thanks for your support. We can wait.

@MelbourneDeveloper
Copy link
Owner

@srganeshram , I got the device. The problem is that it doesn't seem to work...

I put my card on it, but it doesn't beep or go green...

@MelbourneDeveloper
Copy link
Owner

@srganeshram I tried multiple cards but nothing...

@fireloudapp
Copy link
Author

fireloudapp commented Aug 6, 2019 via email

@MelbourneDeveloper
Copy link
Owner

@srganeshram I used my credit card and it didn't work. I also used another card.

@MelbourneDeveloper
Copy link
Owner

@srganeshram I tried three different credit cards, three different USB ports, and two different cables. Nothing works. The device beeps when I plug it in to the computer, the red LED appears, but nothing happens when I tap it with a credit card.

@fireloudapp
Copy link
Author

@MelbourneDeveloper I am sure that you cannot use credit card to read the data.

You should use RFID Proximity Card (RFID Proximity Id Card)

The above card can be read from the device.

Thanks

@MelbourneDeveloper
Copy link
Owner

@srganeshram oh no! So, I have to order something else from Amazon?

Also, why can't you just use the device as a keyboard? The device is essentially a keyboard. The device sends keys to notepad like a regular keyboard. Is there some extra data if you read via USB?

@fireloudapp
Copy link
Author

fireloudapp commented Aug 7, 2019 via email

@MelbourneDeveloper
Copy link
Owner

@srganeshram send me a private message on Twitter or Slack. I will send you the address to send it to.

@MelbourneDeveloper
Copy link
Owner

@srganeshram again:

Why can't you just use the device as a keyboard? The device is essentially a keyboard. The device sends keys to notepad like a regular keyboard. Is there some extra data if you read via USB?

@MelbourneDeveloper
Copy link
Owner

@srganeshram there is a computer shop near my work. I will try to buy some cards today.

@fireloudapp
Copy link
Author

fireloudapp commented Aug 9, 2019 via email

@MelbourneDeveloper
Copy link
Owner

@srganeshram I haven't been able to find the cards here. You will need to send me one. But, I've tried all kinds of cards and nothing works. I also tried my passport. I'm pretty sure this device is useless.

@fireloudapp
Copy link
Author

@MelbourneDeveloper

No Problem. I have found a workaround for this. As you stated that this device is detected as a simple keyboard that gave me a hint of reading raw input from keyboard. I used the below article
Reading Raw Input from keyboard.
Now, I am able to read the device data when I show the card.

If you want to read the data from that device, you should use the proximity card. I can share the one from my end, if you wish you can share your address in a private message through twitter(@SRGaneshRam) or email(sr.ganeshram@hotmail.com)

Thanks.

@AalapMistry
Copy link

'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'F:\max430AI.ConfigurationTool\max430AI.ConfigurationTool\bin\Debug\max430AI.ConfigurationTool.exe'. Symbols loaded.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'F:\max430AI.ConfigurationTool\max430AI.ConfigurationTool\bin\Debug\Device.Net.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'F:\max430AI.ConfigurationTool\max430AI.ConfigurationTool\bin\Debug\Hid.Net.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Line No:1
High:0
Low:8
'max430AI.ConfigurationTool.exe' (CLR v4.0.30319: max430AI.ConfigurationTool.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Remote Debugger\x64\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x1ad8 has exited with code 0 (0x0).
The thread 0xae0 has exited with code 0 (0x0).
Status Bit:1
07FFFFFFFFFFFFFF
Line No:2
High:0
Low:16
Status Bit:1
070011D9FC800100
Line No:3
High:0
Low:24
Status Bit:1
07011213D7FFFFFF
Line No:4
High:0
Low:32
Status Bit:1
07029A0100001100
Line No:5
High:0
Low:40
Status Bit:1
0703000000000000
Line No:6
High:0
Low:48
Status Bit:1
0704C22200000000
Line No:7
High:0
Low:56
Status Bit:1
0705640000000C00
Line No:8
High:0
Low:64
Status Bit:1
0706000000000000
Line No:9
High:0
Low:72
Status Bit:1
0707112000000000
Line No:10
High:0
Low:80
Status Bit:1
0708960000001600
Line No:11
High:0
Low:88
Status Bit:1
0709000000000000
Line No:12
High:0
Low:96
Status Bit:1
070A121A00000000
Line No:13
High:0
Low:104
Status Bit:1
070B640000000C00
Line No:14
High:0
Low:112
Status Bit:1
070C000000000000
Line No:15
High:0
Low:120
Status Bit:1
070D121900000000
Line No:16
High:0
Low:128
Status Bit:1
070E7D0000001200
Line No:17
High:0
Low:136
Status Bit:1
070F000000000000
Line No:18
High:0
Low:144
Status Bit:1
0710120900000000
Line No:19
High:0
Low:152
Status Bit:1
0711000000001400
Line No:20
High:0
Low:160
Status Bit:1
0712000000000000
Line No:21
High:0
Low:168
Status Bit:1
07131313D7FFFFFF
Line No:22
High:0
Low:176
Status Bit:1
07149A0100001103
Line No:23
High:0
Low:184
Status Bit:1
071508AA0AAA0000
Line No:24
High:0
Low:192
Status Bit:1
0716C32200000000
Line No:25
High:0
Low:200
Status Bit:1
0717640000000C03
Line No:26
High:0
Low:208
Status Bit:1
071808AA0AAA0000
Line No:27
High:0
Low:216
Status Bit:1
0719112000000000
Line No:28
High:0
Low:224
Status Bit:1
071A960000001600
Line No:29
High:0
Low:232
Status Bit:1
071B0850A9FA0000
Line No:30
High:0
Low:240
Status Bit:1
071C101A00000000
Line No:31
High:0
Low:248
Status Bit:1
071D640000000C03
Line No:32
High:1
Low:0
Status Bit:1
071E08A0AAAA0000
Line No:33
High:1
Low:8
Status Bit:1
071F131900000000
Line No:34
High:1
Low:16
Status Bit:1
07207D0000001203
Line No:35
High:1
Low:24
Status Bit:1
072108A00AAA0000
Line No:36
High:1
Low:32
Status Bit:1
0722120900000000
Line No:37
High:1
Low:40
Status Bit:1
0723000000001400
Line No:38
High:1
Low:48
Status Bit:1
0724000000000000
Line No:39
High:1
Low:56
Status Bit:1
07254213D7FFFFFF
Line No:40
High:1
Low:64
Status Bit:1
07269A0100001100
Line No:41
High:1
Low:72
Status Bit:1
0727000000000000
Line No:42
High:1
Low:80
Status Bit:1
0728C22200000000
Line No:43
High:1
Low:88
Status Bit:1
0729640000000C00
Line No:44
High:1
Low:96
Status Bit:1
072A000000000000
Line No:45
High:1
Low:104
Status Bit:1
072B112000000000
Line No:46
High:1
Low:112
Status Bit:1
072C960000001600
Line No:47
High:1
Low:120
Status Bit:1
072D000000000000
Line No:48
High:1
Low:128
Status Bit:1
072E121A00000000
Line No:49
High:1
Low:136
Status Bit:1
072F640000000C00
Line No:50
High:1
Low:144
Status Bit:1
0730000000000000
Line No:51
High:1
Low:152
Status Bit:1
0731121900000000
Line No:52
High:1
Low:160
Status Bit:1
07327D0000001200
Line No:53
High:1
Low:168
Status Bit:1
0733000000000000
Line No:54
High:1
Low:176
Status Bit:1
0734120900000000
Line No:55
High:1
Low:184
Status Bit:1
0735000000001400
Line No:56
High:1
Low:192
Status Bit:1
0736000000000000
Line No:57
High:1
Low:200
Status Bit:1
0737112200000000
Line No:58
High:1
Low:208
Status Bit:1
0738640000000C00
Line No:59
High:1
Low:216
Status Bit:1
0739000000000000
Line No:60
High:1
Low:224
Status Bit:1
073AC12000000000
Line No:61
High:1
Low:232
Status Bit:1
073B960000001600
Line No:62
High:1
Low:240
Status Bit:1
073C000000000000
Line No:63
High:1
Low:248
Status Bit:1
073D111A00000000
Line No:64
High:2
Low:0
Status Bit:1
073E640000000C00
Line No:65
High:2
Low:8
Status Bit:1
073F000000000000
Line No:66
High:2
Low:16
Status Bit:1
0740101A00000000
Line No:67
High:2
Low:24
Status Bit:1
0741640000000C00
Line No:68
High:2
Low:32
Status Bit:1
0742000000000000
Line No:69
High:2
Low:40
Status Bit:1
0743101A00000000
Line No:70
High:2
Low:48
Status Bit:1
0744640000000C00
Line No:71
High:2
Low:56
Status Bit:1
0745000000000000
Line No:72
High:2
Low:64
Status Bit:1
0746120900000000
Line No:73
High:2
Low:72
Status Bit:1
0747000000001400
Line No:74
High:2
Low:80
Status Bit:1
0748000000000000
Line No:75
High:2
Low:88
Status Bit:1
0749112000000000
Line No:76
High:2
Low:96
Status Bit:1
074A960000001600
Line No:77
High:2
Low:104
Status Bit:1
074B000000000000
Line No:78
High:2
Low:112
Status Bit:1
074CC12000000000
Line No:79
High:2
Low:120
Status Bit:1
074D960000001600
Line No:80
High:2
Low:128
Status Bit:1
074E000000000000
Line No:81
High:2
Low:136
Status Bit:1
074F102000000000
Line No:82
High:2
Low:144
Status Bit:1
0750960000001600
Line No:83
High:2
Low:152
Status Bit:1
0751000000000000
Line No:84
High:2
Low:160
Status Bit:1
0752102000000000
Line No:85
High:2
Low:168
Status Bit:1
0753960000001600
Line No:86
High:2
Low:176
Status Bit:1
0754000000000000
Line No:87
High:2
Low:184
Status Bit:1
0755102000000000
Line No:88
High:2
Low:192
Status Bit:1
0756960000001600
Line No:89
High:2
Low:200
Status Bit:1
0757000000000000
Line No:90
High:2
Low:208
Status Bit:1
0758000900000000
Line No:91
High:2
Low:216
Status Bit:1
0759000000001400
Line No:92
High:2
Low:224
Status Bit:1
075A000000000000
Line No:93
High:2
Low:232
Status Bit:1
075E093400000000
Line No:94
High:2
Low:240
Status Bit:1
075F010000000000
Line No:95
High:2
Low:248
Status Bit:1
0760000000000000
Line No:96
High:3
Low:0
Status Bit:1
0761093500000000
Line No:97
High:3
Low:8
Status Bit:1
0762060000000000
Line No:98
High:3
Low:16
Status Bit:1
0763000000000000
Line No:99
High:3
Low:24
Status Bit:1
0764093600000000
Line No:100
High:3
Low:32
Status Bit:1
0765010000000000
Line No:101
High:3
Low:40
Status Bit:1
0766000000000000
Line No:102
High:3
Low:48
Status Bit:1
0767093700000000
Line No:103
High:3
Low:56
Status Bit:1
0768010000000000
Line No:104
High:3
Low:64
Status Bit:1
0769000000000000
Line No:105
High:3
Low:72
Status Bit:1
076A093800000000
Line No:106
High:3
Low:80
Status Bit:1
076B010000000000
Line No:107
High:3
Low:88
Status Bit:1
076C000000000000
Line No:108
High:3
Low:96
Status Bit:1
076D093900000000
Line No:109
High:3
Low:104
Status Bit:1
076E010000000000
Line No:110
High:3
Low:112
Status Bit:1
076F000000000000
Line No:111
High:3
Low:120
Status Bit:1
0770093C00000000
Line No:112
High:3
Low:128
Status Bit:1
0771010000000000
Line No:113
High:3
Low:136
Status Bit:1
0772000000000000
Line No:114
High:3
Low:144
Status Bit:1
0773093A00000000
Line No:115
High:3
Low:152
Status Bit:1
0774010000000000
Line No:116
High:3
Low:160
Status Bit:1
0775000000000000
Line No:117
High:3
Low:168
Status Bit:1
0776093B00000000
Line No:118
High:3
Low:176
Status Bit:1
0777010000000000
Line No:119
High:3
Low:184
Status Bit:1
0778000000000000
Line No:120
High:3
Low:192
Status Bit:1
0779093D00000000
Line No:121
High:3
Low:200
Status Bit:1
077A010000000000
Line No:122
High:3
Low:208
Status Bit:1
077B000000000000
Line No:123
High:3
Low:216
Status Bit:1
077C093E00000000
Line No:124
High:3
Low:224
Status Bit:1
077D010000000000
Line No:125
High:3
Low:232
Status Bit:1
077E000000000000
Line No:126
High:3
Low:240
Status Bit:1
077F094200000000
Line No:127
High:3
Low:248
Status Bit:1
0780010000000000
Line No:128
High:4
Low:0
Status Bit:1
0781000000000000
Line No:129
High:4
Low:8
Status Bit:1
0782094300000000
Line No:130
High:4
Low:16
Status Bit:1
0783010000000000
Line No:131
High:4
Low:24
Status Bit:1
0784000000000000
Line No:132
High:4
Low:32
Status Bit:1
0785093F00000000
Line No:133
High:4
Low:40
Status Bit:1
0786010000000000
Line No:134
High:4
Low:48
Status Bit:1
0787000000000000
Line No:135
High:4
Low:56
Status Bit:1
0788094000000000
Line No:136
High:4
Low:64
Status Bit:1
0789010000000000
Line No:137
High:4
Low:72
Status Bit:1
078A000000000000
Line No:138
High:4
Low:80
Status Bit:1
078B0B2F00000000
Line No:139
High:4
Low:88
Status Bit:1
078C640000000000
Line No:140
High:4
Low:96
Status Bit:1
078D000000000000
Line No:141
High:4
Low:104
Status Bit:1
078E093500000000
Line No:142
High:4
Low:112
Status Bit:1
078F050000000000
Line No:143
High:4
Low:120
Status Bit:1
0790000000000000
Line No:144
High:4
Low:128
Status Bit:1
0791093500000000
Line No:145
High:4
Low:136
Status Bit:1
0792040000000000
Line No:146
High:4
Low:144
Status Bit:1
0793000000000000
Line No:147
High:4
Low:152
Status Bit:1
0797F02900000000
Line No:148
High:4
Low:160
Status Bit:1
0798000000000000
Line No:149
High:4
Low:168
Status Bit:1
0799000000000000
Line No:150
High:4
Low:176
Status Bit:1
079A00000000401F
Line No:151
High:4
Low:184
Status Bit:1
079B803EC05D007D
Line No:152
High:4
Low:192
Status Bit:1
079CFFFFFFFFFFFF
Line No:153
High:4
Low:200
Status Bit:1
079DFFFFFFFFFFFF
Line No:154
High:4
Low:208
Status Bit:1
079E00000000401F
Line No:155
High:4
Low:216
Status Bit:1
079F803EC05D007D
Line No:156
High:4
Low:224
Status Bit:1
07A0FFFFFFFFFFFF
Line No:157
High:4
Low:232
Status Bit:1
07A1FFFFFFFFFFFF
Line No:158
High:4
Low:240
Status Bit:1
07A200000000401F
Line No:159
High:4
Low:248
Status Bit:1
07A3803EC05D007D
Line No:160
High:5
Low:0
Status Bit:1
07A4FFFFFFFFFFFF
Line No:161
High:5
Low:8
Status Bit:1
07A5FFFFFFFFFFFF
Line No:162
High:5
Low:16
Status Bit:1
07A600000000401F
Line No:163
High:5
Low:24
Status Bit:1
07A7803EC05D007D
Line No:164
High:5
Low:32
Status Bit:1
07A8FFFFFFFFFFFF
Line No:165
High:5
Low:40
Status Bit:1
07A9FFFFFFFFFFFF
Line No:166
High:5
Low:48
Status Bit:1
07AA00000000401F
Line No:167
High:5
Low:56
Status Bit:1
07AB803EC05D007D
Line No:168
High:5
Low:64
Status Bit:1
07ACFFFFFFFFFFFF
Line No:169
High:5
Low:72
Status Bit:1
07ADFFFFFFFFFFFF
Line No:170
High:5
Low:80
Status Bit:1
07AE00000000401F
Line No:171
High:5
Low:88
Status Bit:1
07AF803EC05D007D
Line No:172
High:5
Low:96
Status Bit:1
07B0FFFFFFFFFFFF
Line No:173
High:5
Low:104
Exception thrown: 'System.IO.IOException' in mscorlib.dll

why Exception while reading data ? please help error Exception occure during read data byte frame from hid USB device , using hid.net and device.net library

@carl-qva
Copy link

Hi MelbourneDeveloper, im having an issue with Device.Net (and in general with all hid libraries that i've tested so far). The problem is that my app can communicate with my hid device only in administrator mode, when the app is not run in admin mode the device is not found. In admin mode i can read/write data without any problem. See this log from Device.Net and please help

region: ApiService, message: Calling CreateFile for DeviceId: \?\hid#vid_0483&pid_a2ca&mi_00#7&1a31e08c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}. Desired Access: None. Share mode: 3. Creation Disposition: 3, LogLevel: Information
Exception thrown: 'Device.Net.Exceptions.DeviceException' in Hid.Net.dll
region: WindowsHidDeviceFactory, message: GetDeviceDefinition error. Device Id: \?\hid#vid_0483&pid_a2ca&mi_00#7&1a31e08c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, LogLevel: Error, exception: CreateReadConnection call with Id of \?\hid#vid_0483&pid_a2ca&mi_00#7&1a31e08c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} failed.
region: WindowsHidDeviceFactory, message: Device with path \?\hid#vid_0483&pid_a2ca&mi_00#7&1a31e08c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} was skipped. See previous logs., LogLevel: Warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants