Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: Blink(1)

  1. #11
    Join Date
    Dec 2004
    Posts
    103

    Default

    I've tested with forced administration elevation, but without success.

  2. #12
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    That is strange, let me look see if the PIR-1 example code still works...
    Ron
    No support through PM

  3. #13
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Hmm looks like the HID code was old. I've updated it. The attached plugins were build against Girder 6.0.0.99
    Attached Files Attached Files
    Ron
    No support through PM

  4. #14
    Join Date
    Dec 2004
    Posts
    103

    Default

    That's better, I get the first HID device:

    Code:
    jeu. nov. 6 18:11:43 2014	{ -- #0
    jeu. nov. 6 18:11:43 2014	   [1] = { -- #1
    jeu. nov. 6 18:11:43 2014	      ["path"] = "\\\\?\\hid#vid_0463&pid_ffff#6&18fa85f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}",
    jeu. nov. 6 18:11:43 2014	      ["interfaceNumber"] = -1,
    jeu. nov. 6 18:11:43 2014	      ["productId"] = 65535,
    jeu. nov. 6 18:11:43 2014	      ["product"] = "PROTECTIONCENTER",
    jeu. nov. 6 18:11:43 2014	      ["manufacturer"] = "MGE UPS SYSTEMS",
    jeu. nov. 6 18:11:43 2014	      ["serial"] = "000000000",
    jeu. nov. 6 18:11:43 2014	      ["vendorId"] = 1123,
    jeu. nov. 6 18:11:43 2014	   } -- #1,
    jeu. nov. 6 18:11:43 2014	} -- #0
    But VID_27B8&PID_01ED (BLINK) is missing whatever I provide as parameter.

  5. #15
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Alright, try attached while running debugview. Copy and paste whatever it prints to debugview when you run enumerate
    Attached Files Attached Files
    Ron
    No support through PM

  6. #16
    Join Date
    Dec 2004
    Posts
    103

    Default

    Thanks for that, now I know what is wrong, the stick controller was running and it prevents enumerating the device.
    Code:
    hid.enumerate(0,0)
    is now producing:

    Code:
    jeu. nov. 6 20:51:54 2014    { -- #0
    jeu. nov. 6 20:51:54 2014       [1] = { -- #1
    jeu. nov. 6 20:51:54 2014          ["path"] = "\\\\?\\hid#vid_0463&pid_ffff#6&18fa85f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}",
    jeu. nov. 6 20:51:54 2014          ["interfaceNumber"] = -1,
    jeu. nov. 6 20:51:54 2014          ["productId"] = 65535,
    jeu. nov. 6 20:51:54 2014          ["product"] = "PROTECTIONCENTER",
    jeu. nov. 6 20:51:54 2014          ["manufacturer"] = "MGE UPS SYSTEMS",
    jeu. nov. 6 20:51:54 2014          ["serial"] = "000000000",
    jeu. nov. 6 20:51:54 2014          ["vendorId"] = 1123,
    jeu. nov. 6 20:51:54 2014       } -- #1,
    jeu. nov. 6 20:51:54 2014       [2] = { -- #2
    jeu. nov. 6 20:51:54 2014          ["path"] = "\\\\?\\hid#vid_27b8&pid_01ed#7&121f57c5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}",
    jeu. nov. 6 20:51:54 2014          ["interfaceNumber"] = -1,
    jeu. nov. 6 20:51:54 2014          ["productId"] = 493,
    jeu. nov. 6 20:51:54 2014          ["product"] = "blink(1) mk2",
    jeu. nov. 6 20:51:54 2014          ["manufacturer"] = "ThingM",
    jeu. nov. 6 20:51:54 2014          ["serial"] = "2000221F",
    jeu. nov. 6 20:51:54 2014          ["vendorId"] = 10168,
    jeu. nov. 6 20:51:54 2014       } -- #2,
    jeu. nov. 6 20:51:54 2014    } -- #0
    When the controller is running and enumerate() fails to get the device, DebugView is logging:

    Code:
    [13776] HIDDEBUG: MATCH 4 at device index: 0, vid=1123, pid=65535
    [13776] HIDDEBUG: Continue 3 at device index: 1, size=87, last error=32, path=\\?\hid#vid_27b8&pid_01ed#7&121f57c5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    [13776] HIDDEBUG: Exit 1 at device index: 2
    I'm not really familiar with all these HID stuffs, is some software using the protocol working in exclusive access?
    Last edited by RLeBrette; November 6th, 2014 at 02:04 PM.

  7. #17
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Yes looks like the other software is taking exclusive access of the device. ( Error=32 means ERROR_SHARING_VIOLATION ) So exit that guy and you should be in business!
    Ron
    No support through PM

  8. #18
    Join Date
    Dec 2004
    Posts
    103

    Default

    Thanks for the fixed version. If I'm successful to implement a binding for the stick I will not need the software controller anymore, I will use G6 instead

  9. #19
    Join Date
    Dec 2004
    Posts
    103

    Default

    Another problem, when using the enumerate API with an explicit (vid, pid) the vid is not taken in account, 0 is used instead, and not considered as the "all" value but "zero" value.

    Code:
    [13776] HIDDEBUG: FAIL 4 at device index: 0, vid=1123, pid=65535 ( search 0:493 )
    [13776] HIDDEBUG: FAIL 4 at device index: 1, vid=10168, pid=493 ( search 0:493 )
    [13776] HIDDEBUG: Exit 1 at device index: 2
    Not blocker.

  10. #20
    Join Date
    Dec 2004
    Posts
    103

    Default

    Trying to switch light on.

    Code:
    local hid = require('hid')
    local devices = hid.enumerate(0,0)
    local blink, err = hid.open(devices[2].path)
    local command = string.char(0) .. 'c' .. string.char(255) .. string.char(255) .. string.char(255).. string.char(0) .. string.char(0).. string.char(0)
    table.print({command:byte(1,command:len())})
    local bytesWritten, err = blink:setFeatureReport(command)
    print(bytesWritten, err)
    local bytesWritten, err = blink:write(command)
    print(bytesWritten, err)
    blink:close()
    I always get nil,-1 as result.
    Are setFeatureReport and write exactly the same function?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •