laamaa / m8c

Cross-platform M8 tracker headless client
Other
377 stars 80 forks source link

detect_m8_serial_device can't find device on Windows #134

Open CapMousse opened 4 months ago

CapMousse commented 4 months ago

Hello 👋

I just encounter a problem on Windows 11 while using M8C :

The method detect_m8_serial_device seem to not be able to find the correct values while reading the VID and PID. While debugging, I found that the VID and PID returned by sp_get_port_usb_vid_pid were totally random. https://github.com/laamaa/m8c/blob/9d70859ec2d75be67e2e80b04fb1f5b85b371737/src/serial.c#L29 Then the next check fail as the VID and PID doesn't match the correct values: https://github.com/laamaa/m8c/blob/9d70859ec2d75be67e2e80b04fb1f5b85b371737/src/serial.c#L31

If I comment all the check and force detect_m8_serial_device to return 1 when detecting port COM1 (the port where the headless unit is connected), m8c work as intended.

I can't find why libserialport can't read the correct values on windows.

Have a nice day !

laamaa commented 4 months ago

Unfortunately I don't have a Windows 11 machine I could try to reproduce the problem with. With my Win10 install it seems to be working correctly. Could someone with Win11 please try and see if this happens on more than one machine?

CapMousse commented 4 months ago

For context : this is a Windows 11 Pro install with all security features enabled. I can reproduce the same issue on a laptop with the same exact setup.

I will try on a Windows 11 Home edition too.

possiblyanowl commented 4 months ago

Hi, I also have Windows 11 Pro, and am having the same problem. M8 is detectable by M8 web display, I see the COM port in Device Manager when I connect the M8 as well as the M8 audio devices, but opening m8c results in the "DEVICE DISCONNECTED" error message.

Please let me know what I am able to do to help. I have setup the mingw toolchain and can compile m8c and test dev builds if necessary.

CapMousse commented 4 months ago

Update : I've just tester the latest release on W11 Pro and Home and still have the same issue. But everything work fine if I disable all the checks.

possiblyanowl commented 4 months ago

Same here, if I remove the checks for USB VID and PID and just return 1, it will work correctly.

laamaa commented 4 months ago

This is probably a libserialport issue, need to look up if some other project has bumped into the same issue when I have some time