0

USB Input in BrightScript

I would like to use USB Input in a BrightScript Custom PlugIn.

I can handle GPIO, UDP, aso. but can not find any examples or documentation to USB.

What event type is it? What kind of data will be received (Str, int, float)

function USBin_ProcessEvent(event as Object)
    'handle USB Inputs
    if type(event)= "?????" then
        eventData = event.Get?????()
    endif
    return false
end function

 

 
 

7 comments

  • 0
    Avatar
    Bright Scripters

    What type of USB device are you using?

    Does it interface like a keyboard?

     

    To get more insight, you could put a the top of the function this line:

    print type(event)

    You would then watch the terminal over serial port, or ssh, while interacting with the USB device.

    Please share your experience here

     

  • 0
    Avatar
    Lukas Uebachs

    It is a touch device from Phidget (linear touch) should be HID, unfortunately it doesn't send any event.

    I get GPIO inputs, but neither Mouse or any other USB events.

     

     

  • 0
    Avatar
    Bright Scripters

    Not all USB devices would generate USB events... 

    Getting GPIO events may be what you are looking for here.

    Do those events correlate with touching the device?

    See if you can get an integer value from the event...

    Try to stop the script when a GPIO event is detected, and then explore it with the debugger.

    Are you getting anything meaningful with event.GetInt() ?

     

  • 0
    Avatar
    Lukas Uebachs

    Sorry, that was misleading by me. I get GPIO inputs from a GPIO button.

    Just tested if the debug output worked at that point.

    Do I need to register a special message port for USB inputs?

     
     
  • 0
    Avatar
    Bright Scripters

    I don't think that you need to do anything special, but I may be wrong.

    Not all USB devices are supported out of the box.

    You can gain some insight, by examining the bottom of the log in the diagnostic web page, right after you plug in the USB cable.

     

  • 0
    Avatar
    Lukas Uebachs

    At least it is recognized, No Errors

    [   76.939] usb 3-1: new low-speed USB device number 2 using ohci-brcm
    [   77.172] USB vidpid=06c2:0076
    [   77.183] hid-generic 0003:06C2:0076.0001: hiddev0: USB HID v1.10 Device [Phidgets Inc. PhidgetInterfaceKit] on usb-f0490400.ohci_v2-1/input0

     
     
  • 0
    Avatar
    Bright Scripters

    Recognized, doesn't necessarily mean supported.

    The fact that you are not seeing any events, is not good news, but you should email that info to support@brightsign.biz, and they may be able to help.

Please sign in to leave a comment.