Jump to content
The simFlight Network Forums

Cant read or write feature.


Mugz

Recommended Posts

I have VPC Stick MT-50CM2

VID: 3344PID:4130

Trying com.readfeature or com.writefeature but no luck.

I'm trying to capture USB port data, but FSUIPC nothing to get or send to USB device.
image.thumb.png.71aa62e04901c12b044ff4684b488a14.png

Vendor = 0x3344
Product = 0x4130
Device = 0
Report = 0
Pollrate = 25
--------------------------------------------------------

dev, rd, wrf, wr, init = com.openhid(Vendor, Product, Device, Report)

if dev == 0 then
  ipc.log("Could not open HID")
  ipc.exit()
end

ipc.set("dev",dev)
ipc.set("wrf",wrf)

dev = ipc.get("dev")
wrf = ipc.get("wrf")

gt, n = com.readfeature(dev, wrf)
if n ~= 0 then
  ipc.log(gt)
else
  ipc.log("Error getting Features")
end

str = "0265010000B900000000000000000000000000000000000000000000000000000000000000F0"
out = str:gsub('%x%x',function(c)return c.char(tonumber(c,16))end)

i = com.writefeature(dev, out, wrf)

 

Link to comment
Share on other sites

I think the second argument to the com.readfeature call should be the report number, so try

gt, n = com.readfeature(dev, Report)

Maybe also try setting Report to 1 (which is the default), rather than 0, in your init section (of 0 does not work).

6 hours ago, Mugz said:

Changed Device to 1 (not sure why, i have only one device),

I'm not sure why this should be if you only have one of those devices....

Link to comment
Share on other sites

7 minutes ago, John Dowson said:

I'm not sure why this should be if you only have one of those devices....

Yes. It's strange for me also. When i use Device = 0, i got wrf = 0, with device = 1 i have wrf = something like 192. No other device with same name or VID/PID exist.

 

8 minutes ago, John Dowson said:

Maybe also try setting Report to 1 (which is the default), rather than 0, in your init section (of 0 does not work).

I contact with device vendor, and he told me what this functionality is not implemented

 

So, based on all the actions, it remains to understand how Device works

Link to comment
Share on other sites

8 minutes ago, Mugz said:

I contact with device vendor, and he told me what this functionality is not implemented

Ah, ok.

9 minutes ago, Mugz said:

So, based on all the actions, it remains to understand how Device works

I don't know why this is and cannot really look into it as I don't have such a device. Could it be that it has multiple registry entries (just a thought)? Anyway, if it works with device 1, just use that.

Link to comment
Share on other sites

3 minutes ago, John Dowson said:

I don't know why this is and cannot really look into it as I don't have such a device. Could it be that it has multiple registry entries (just a thought)? Anyway, if it works with device 1, just use that.

How i can check this? Can you give me a patch in registry to check and find Device number?

Link to comment
Share on other sites

51 minutes ago, Mugz said:

How i can check this? Can you give me a patch in registry to check and find Device number?

You could disconnect your device and just remove the registry entries for that device anyway, reboot and re-connect to get them added again.
Take a backup of your registry first, and then save the following text in a .reg file (e.g. removeVPCStick.reg) and then execute by double-clicking:

Windows Registry Editor Version 5.00

[-HKCU\SYSTEM\CurrentControlSet\Control\MediaProperties\PrivateProperties\DirectInput\VID_3344&PID_4130]

[-HKCU\SYSTEM\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM\VID_3344&PID_4130]

[-HKCU\SYSTEM\CurrentControlSet\Control\MediaProperties\PrivateProperties\DirectInput\VID_3344&PID_4130]

[-HKCU\SYSTEM\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM\VID_3344&PID_4130]

As I said, I'm not sure if this is the issue or will help, but worth a try. Otherwise, just continue to use device 1, thats not really an issue.

  • Like 1
Link to comment
Share on other sites

5 hours ago, John Dowson said:

Otherwise, just continue to use device 1, thats not really an issue.

Yes. Indeed it's not issue, but is very hard do diagnose other issue, why it is not working 😃

Link to comment
Share on other sites

It's possible implement for future not use Device number. just VID and PID and if system exist two same device - send control all of them? Just like option.

Like 

Device = -1 # Use both device with same VID/PID

Link to comment
Share on other sites

5 hours ago, John Dowson said:

As I said, I'm not sure if this is the issue or will help, but worth a try.

So, i deleted all registry, and reconnect device. All VPC device created new keys with two number. 0 and 1. Seems it's by design. Anyway thanks for your help

image.png.f77fea7f57a05db594e67e67c3dc551b.png

Link to comment
Share on other sites

13 hours ago, Mugz said:

It's possible implement for future not use Device number. just VID and PID and if system exist two same device - send control all of them? Just like option.

Like 

Device = -1 # Use both device with same VID/PID

I don't see much point in this, sorry.

13 hours ago, Mugz said:

All VPC device created new keys with two number. 0 and 1. Seems it's by design.

Yes, I think so. And I don't see this as an issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.