View Full Version : u-HID not working with Girder 5
tonyG
July 22nd, 2009, 05:36 AM
Hi everyone,
Background
Have bought a u-HID programmable HID interface. It's basically a HID class device, which you can use with buttons, switches, encoders, etc. You program up the input with your chosen output et voila, a very versatile solution. Its made by Ultimarc who have a long list of input products. www.u-hid.com
It can create three main events:
1) Joystick button press
2) Keyboard press
3) Mouse button push
It also can be configured with quadrature encoders and assigned as either x-y-z axis outputs or as a joystick button press.
Its being picked up within windows - either in notepad (for keyboard presses), control panel joystick tests (for the joystick), and anywhere for the mouse buttons.
Problem
Girder doesn't see all of this devices events.
It sees only the keyboard presses. It misses the joysticks and mouse events. I have tested this on two PCs. I have tried capturing an event using the transport plugin, as well as simply looking at the event action on the bottom left hand input section.
I have tested 4* other HID devices and all of the events are picked up.
Is this something anyone else has experienced?
It's driving me nuts as it doesn't make a lot of sense - girder picks up HID device events - and this is a standard HID device.
Any ideas???
Thanks, Tony
tonyG
July 23rd, 2009, 12:43 AM
As a way of progressing this, and maybe getting a response..
Question:
Do you have to "program" the generic transport plugin to receive a particular devices events?
Edit: I have found this in help: 6. The HID Plugin stores short scripts on its configuration page to parse data from HID devices like joysticks and game pads to generate Girder Events. If this is the case, how do you "program" a specific HID device and where is the container?
Or, should I see all events on the bottom left window?
From my hours of reading help, it looks like I need to program the transport plugin for this HID device. This will finally be my first entry into LUA if my assumptions are correct. The transport plugin is quite a beast (for all the right reasons it seems). Could some please give me a simple step by step guide, or send me a GML file which has a HID device configured. After which, I hope to get finally my LUA wings!!
Rob H
July 23rd, 2009, 02:58 AM
Ron is the HID expert around here but he's out of the office this week unfortunately.
Have you read the Transport tutorial in the help?
A HID transport should be much the same, except you would use constants.transport.HID instead of constants.transport.GIP
I have a feeling that Ron may have provided a HID transport for someone here, so maybe a search for "HID + transport" here using Google would turn something up.
tonyG
July 23rd, 2009, 03:52 AM
Hi Rob,
Thanks for the reply. I've been working on this all morning: slow going for me I'm afraid..
I have found the thread you mention, and it looks like others are having simalar experiences.
I have loaded Rons genericHID.LUA into the transport folder. I'm aware this is generic and needs the vendor and device ID specific to my u-HID.
Have run:
local t = transport.support.usbhid.ListDevices()
table.print(t)
And now get my devices details. Still not working overall, but making progress...
Tony
tonyG
July 23rd, 2009, 08:13 AM
OK
It's been intesting day.
Progress
Now using "UHID.LUA" which is an ammended GenericHid.LUA file, with the device parameters altered.
e.g.
Product ID = 5377
Vendor ID = 53769
RRL = 21 (which I've added to Parser length)
The plugin is receiving events from the UHID. Only problem is, it's receiving a constant flow (spammage) of 21 hex character inputs, which do change when I push a button (good), but spams up the events, such that I cannot capture a keypress (RAW) event.
The "spam" is based on a Hex value rotation of about 8-12 cycles.
I've seen the ammended code by NEOMORPH, but it's only effective when the spam stream is based on a single HEX value.
From here:
1) Do I try to alter the script to filter out these events - what approach?
2) Change something else in the device parameters which may fix the behaviour?
Some help by now may prevent complete meltdown!
Rob H
July 23rd, 2009, 09:04 AM
Can you show some of the repeating inputs?
tonyG
July 24th, 2009, 12:09 AM
Morning Rob,
I've spent good money on Girder 5, and then about £100 on the UHID. I've spent all day yesterday, last night, and this morning - c. 14 hours.
I have the following observation:
The UHID "plugin" is not a solution.
1) The genericHID.LUA is not even in the latest Girder download. Without it = no HID plugin.
2) There is no sample script included in the sample files
3) You find it by searching through all the threads on the forums, and it's in the middle of a long thread.
4) This is after you go through the help and you still haven't been told a missing file is required.
5) It looks like it has been improved on (wiimote HID), but has never been packaged up.
I know we all get a little frustrated when things don't work, but,
i) Girder 5 continues to offer "blind alleys" for what should be mainstream requirements
ii) I consider a HID input device mainstream. Look at the amount of frustrated, confused people on the threads regarding HID.
I would like to continue using Girder.
I would have loved to have got this working in time for a specific event.
But do you know what? - I'm going to put it to one side. I'm going to forget about the £100 spent on the U-HID.
My apologies for saying this:
I'm not going to touch a bl***ed thing until this plugin becomes a plugin.
My loss, maybe..
tonyG
July 24th, 2009, 12:35 AM
Suggestion for getting the HID plugin into production:
Development
1) Use existing GenericHID.LUA and Wiiremote.LUA as a starting point.
2) Test against a series of off-the-shelf HID devices (lying around the office).
3) Develop the LUA script to automatically derive some of the settings of the selected device e.g. parsar length
Deployment
1) Include GenericHid.LUA in current Girder Build!
2) Include a sample GML, to include;
i) "Find and table USB HID devices" script (using existing LUA mentioned in forums)
ii) "Start selected USB HID device" script - user opens script and enter Vendor, Product IDs
.
3) Update help file
As you can see, I'm not asking for dialogue boxes, and tick boxes (although Girder 3 largely provided this).
I wonder what the expectation level is for the HID plugin for other people?
flyvans.com
September 15th, 2009, 02:25 AM
hi tony,
i totally share(d) your pain!
had to go through the exact same steps... while everything else is pretty straightforward, getting something as simple as a usb/HID to work is a major pain and frustration :-(
even though i consider myself pretty geeky, i had spent more than a week to get it work, involving a very steep learning curve with lua etc...
to expect this from the general public is a totally out of this world.
also, since it used to work much more user friendly in an earlier version, i cannot understand why this wasn't ported over!
now, i just discovered the new transport manager GUI which however doesn't appear to work for HID even though it pretends :-(
rgds, bernie
tonyG
September 22nd, 2009, 11:09 AM
Hi Bernie,
Nice to know I'm not alone...
Girder has always delivered the goods like no other automation package - it interfaces with hardware and deep into applications. All good.
I can only imagine V5 has taken an extrodinary amount of work from the girder dev team. BUT - if people cannot find the feature and use the feature however you have a wasted feature. 95% development effort for no user return...
It looks like an extra 5% effort is required to effectively present this masterpiece to it's paying cutomers. Otherwise V5 comes across as an uncomplete beta.
I'm not here to rant - merely to suggest some time on correctly presenting the embeded features (Wizards, GUI, Menus, implementation guides, etc) would make V5 the product V3 was in this respect. ( Not intended to start a version feature comparison)
flyvans.com
September 23rd, 2009, 03:50 AM
now climbing new mountains :-(
had everything working using a microsoft sidewinder joystick to simulate the eventual "plasma mm2" interface board.
now that simple change doesn't appear to work and is again a pain to debug. e.g. the new vendor id is hex '12DA'.
what kind of string format etc... is now expected by the lua script based on the wiimote sample?
my suggestion is to come up with a generic directx directinput plugin!
then you don't have to worry about the actual usb hid packets etc... but you get a nice single interface to all kinds of input devices.
or a lua-script-builder tool, that configs a nice script via a simple to use gui that will actually work afterwards!
rgds, bernie
tonyG
September 23rd, 2009, 04:04 AM
It would be great to hear from the man himself - Ron - to see what he thinks?
flyvans.com
September 23rd, 2009, 05:06 AM
tony,
if you search a bit (i'm unable to link the thread on, even within this forum)
search "joypad" or "directinput"
you will find a plugin by "wagner" that was intended for girder 3.2 but to my amazement works pretty well in girder5!
i do have a timing/polling issue as the plugin is not configurable and polls a little too slow at 20ms. just contacted the author, let's see wheter i can reach him.
if i can get this timing issue resolved, i'm going to use that most likely.
rgds, bernie
reeven
September 23rd, 2009, 08:31 PM
I use Girder for advanced thing with my remotes.
Second, for easier thing i use Intelliremote.
And i use Pinnacle Game Profiler with my gamepads, it's kind of Xpadder but much better.
Girder is build for remotes, Pinnacle is for pads.
EDIT: You mean this plugin by Wagner:
http://www.promixis.com/forums/showthread.php?p=136912#post136912
It's not working ok with newer pads like Xbox 360, Ps3, etc, these has triggers, this plugin see 2 triggers like only one.
For pads, i give you the solution on this message.
tonyG
September 24th, 2009, 02:30 PM
"Girder is build for remotes, Pinnacle is for pads."
Really?
I'm only asking as Girder has a history of plugins and functionality for all input devices: joysticks, mouse (J Hind's plugin), and now the "official" G5 HID LUA. I think G5 has the ambition to work with many input devices - it just needs packaging and presenting.
I'll be very disppointed if your summary is true. Yet another app running in the background.
reeven
September 25th, 2009, 01:36 AM
tony, have you seen how many people complain about official g5 hid plugin?
I rest my case.
flyvans.com
September 25th, 2009, 01:46 AM
gotta get the post count over 10 first...
stupid posting rules
flyvans.com
September 25th, 2009, 01:47 AM
wrote my own helper app (i'm using one anyway already, so just added the features) in visual basic (dot) net 2005 express and using the free slimDX library.
get the slimdx library from slimdx.org
here's the code:
mappc is the class name i used on the form, can be easily replaced.
there is one timer required which i named "joytimer".
Imports System.Runtime.InteropServices
Imports System
Imports System.Globalization
Imports System.Windows.Forms
Imports SlimDX
Imports SlimDX.DirectInput
Imports System.Collections.Generic
Public Class mappc
Public Shared lastbuttons(127) As Boolean
Dim girdyvent
'cleaning up when disposing
Private Sub mappc_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
ReleaseDevice()
girdyvent = Nothing
End Sub
Private Sub mappc_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
girdyvent = CreateObject("GIRDERX.Girder")
CreateDevice() 'starts polling joystick
End Sub
Private joystick As Device(Of JoystickState)
Private state As New JoystickState()
Private Sub CreateDevice()
' make sure that DirectInput has been initialized
Dim dinput As New DirectInput()
' search for devices
For Each device As DeviceInstance In dinput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly)
' create the device
Try
joystick = New Device(Of JoystickState)(dinput, device.InstanceGuid)
joystick.SetCooperativeLevel(Me, CooperativeLevel.Nonexclusive Or CooperativeLevel.Background)
Exit Try
Catch generatedExceptionName As DirectInputException
End Try
Next
If joystick Is Nothing Then
MessageBox.Show("There are no joysticks attached to the system.")
Exit Sub
End If
For Each deviceObject As DeviceObjectInstance In joystick.GetDeviceObjects()
If (deviceObject.ObjectType And ObjectDeviceType.Axis) <> 0 Then
joystick.GetObjectPropertiesById(CInt(deviceObject .ObjectType)).SetRange(-1000, 1000)
End If
Next
' acquire the device
joystick.Acquire()
Joytimer.Interval = 12 '12ms polling interval
Joytimer.Start()
End Sub
Private Sub ReadImmediateData()
If joystick.Acquire().IsFailure Then
Exit Sub
End If
If joystick.Poll().IsFailure Then
Exit Sub
End If
state = joystick.GetCurrentState()
If Result.Last.IsFailure Then
Exit Sub
End If
decodebuttons()
End Sub
Private Sub ReleaseDevice()
Joytimer.[Stop]()
If joystick IsNot Nothing Then
joystick.Unacquire()
joystick.Dispose()
End If
joystick = Nothing
End Sub
Private Sub decodebuttons()
Dim buttons As Boolean() = state.GetButtons()
Dim butt As String
butt = ""
For b As Integer = 0 To buttons.Length - 1
If buttons(b) = True And lastbuttons(b) = False Then
Select Case b
Case 0 'right rotary left turn
butt = "RRLeft"
Case 1 'right rotary right turn
butt = "RRRight"
Case 2 'left rotary left turn
butt = "LRLeft"
Case 3 'left rotary right turn
butt = "LRRight"
Case 4 'right rotary pull
butt = "RRPull"
Case 5 'right rotary push
butt = "RRPush"
Case 6 'left rotary push
butt = "LRPush"
Case 7 'left rotary pull
butt = "LRPull"
Case 15 'LSK1
butt = "Button1"
Case 14 'LSK2
butt = "Button2"
Case 12 'LSK3
butt = "Button3"
Case 11 'LSK4
butt = "Button4"
Case Else
butt = "undefined"
End Select
girdyvent.TriggerEvent(butt, "131313", "", "", "", 0)
End If
Next
Array.Copy(buttons, lastbuttons, 128)
End Sub
Private Sub Joytimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Joytimer.Tick
ReadImmediateData()
End Sub
End Class
simple, effective and is working excellently!
might not be the nicest code, it's an adaptation from a c# sample in the sdk.
feel free to ask questions if you don't understand something.
rgds,
bernie
Ron
September 25th, 2009, 12:23 PM
I'm sorry you guys are having trouble with the HID transport. We are continuously trying to improve Girder. I understand your frustration but I thought the transport tutorial was quite detailed and should get you started on building a HID plugin.
W.r.t. having a ready to use lua script for any HID device that would be great. If I have some spare time I might get around to that, however the HID spec is HUGE and this would take significant time.
flyvans.com
September 25th, 2009, 12:45 PM
hi ron,
sometimes simpler would be better...
putting myself into the "stupid" user position, i do not want to care about hardcoding vendor or productid's, nor creating clases loading objects etc... just to get a damn joystick or gamepad working.
also, girder for the most part does a great job at hiding all the technicalities from the user to a point, therefore making it very user friendly.
e.g. the commandcapture command etc...
so, regarding the hid interface, i would suggest it's safe to say that 99% of them are either mouse, keyboard or joysticks/gamepads which all can be nicely interfaced through either usb-hid and even easier through directinput(directx).
my thinking is you're trying to be too open too generic in this case. let the pro user have the low level access to usb-hid. but also support the quick and dirty gamepad/joystick/wiimote/3dmouse(to a point) inputs which cover 99% of the demand and are relatively easy to code generically.
more so because apparently this used to work just fine in earlier versions.
if somebody needs to use a more exotic hid device (e.g. eye-tracker that kind of stuff) he'll go the distance and write the lua/own script.
just to let you know, i consider myself pretty geeky (although not with lua and such) i had it working at one point with one joystick but couldn't make the transition to another device with the same functions/mappings without getting all kinds of debug/error messages in the script console.
i took the detour with slimdx and vb.net and am more than happy with it!
hoping it will eventually be directly a part of girder.
look at how simple windows presents game controllers (even several) and then their states in the properties. girder should do it the same way or even better, when "learning" an event, automatically detect which button on which joystick is pressed.
rgds,
bernie
Ron
September 25th, 2009, 12:52 PM
Yep you are right. As I said it's on the list, however the list is long. (Girder covers a huge field of use and HID is only a tiny tiny part of it)
reeven
September 25th, 2009, 01:02 PM
Ron, if you have time, pls install Pinnacle game profiler, to see how 2 coders manage to make an hid interface for all pads.
Maybe you learn more from this.
I use that with xbox 360 pad, it has an windows profile, i enter in any game and when i exit windows profile switch back. I use this all the time with my pad... but it's not working with remotes, it work but with global hotkey and that's it.
http://www.pinnaclegameprofiler.com/
Ir server Suite has also an hid plugin, workin ok with xbox 360 pad.
Evenghost has 3-4 hid plugins, all working ok with xbox 360 pad.
But a lot of us does not like these softwares....
Ir server is ok.. lm remote ok, but Evenghost... it seem from another planet for me....
When you have time you could install some of this software to learn about them.( steal from them:)))
Ron
September 25th, 2009, 01:10 PM
No stealing my friend.
When I get time I'll look into creating a more targeted hid file. Just not happening soon sorry to say.
tonyG
September 27th, 2009, 08:57 AM
girder for the most part does a great job at hiding all the technicalities from the user to a point, therefore making it very user friendly. e.g. the commandcapture command etc...
....my thinking is you're trying to be too open too generic in this case. let the pro user have the low level access to usb-hid. but also support the quick and dirty gamepad/joystick/wiimote/3dmouse(to a point) inputs which cover 99% of the demand and are relatively easy to code generically.
Hi Ron,
Sorry to be giving you a rough time on this one. Still, we are trying to be constructive, which must be better than a customer who simply "rants", or silently leaves to a competitor...
I've included a quote from Bernie, who for me, has "hit the nail on the head".
Ron
September 27th, 2009, 01:03 PM
No worries, feedback is good :)
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.