https://bugs.winehq.org/show_bug.cgi?id=49752
Bug ID: 49752 Summary: Mikster MPC4 System: 'Selected serial port not exist' Product: Wine Version: 5.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: amad4wine2020@gmail.com Distribution: ---
Log in as 'Adm' user, go to the 'Controllers list', press the 'Add' button, select the appropriate 'Port COM' and 'Baud rate', press the 'Test' button, you will probably get an error message containing the phrase 'Selected serial port not exist'.
I have tried the following registry keys:
[System\CurrentControlSet\Enum\SERIAL\COM2\COM2] 1598720497 #time=1d67e260ec36dbc "ClassGUID"="{4D36E978-E325-11CE-BFC1-08002BE10318}" "FriendlyName Value"="Serial Port (COM2)"
[Software\Wine\Ports] 1598713705 #time=1d67e163e9541c4 "COM2"="/dev/ttyS1"
Unfortunately, it makes no difference.
Download links from the software's website: https://mikster.eu/en/download-center/ https://mikster.eu/wp-content/uploads/2019/03/installmpc482ENG.zip
P.S. The installer will silently install FirebirdSQL 1.5 and enable Firebird Guardian, it does not work well with winehq-devel. Unpack the installmpc482ENG.exe and rename the included installmpc482ENG/firebird/FirebirdWin32.exe before continuing with the installation. Install the renamed FirebirdWin32.exe manually (uncheck the 'Use the Guardian to control the server?' option during the installation).
https://bugs.winehq.org/show_bug.cgi?id=49752
amad4wine2020@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Ubuntu
https://bugs.winehq.org/show_bug.cgi?id=49752
amad4wine2020@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|Ubuntu |---
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #1 from amad4wine2020@gmail.com --- On Windows 10 system I get 'Device not responding' (when nothing is actually connected to the serial port). On WINE (Ubuntu 20.04) I get 'Selected serial port not exist'.
Tested under VirtualBox with virtual COM port. ttyS1 - VirtualBox serial port (Port Mode: Disconnected)
The permissions seems correct to me. My user is added to the corresponding group.
auser@auser-VirtualBox:~$ ls -la /dev/ttyS1 crw-rw---- 1 root dialout 4, 65 Sep 4 02:46 /dev/ttyS1
auser@auser-VirtualBox:~$ cat /etc/group | grep dial dialout:x:20:auser
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #2 from amad4wine2020@gmail.com --- Created attachment 68089 --> https://bugs.winehq.org/attachment.cgi?id=68089 WINE console output
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #3 from amad4wine2020@gmail.com --- still in wine-5.17
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #4 from amad4wine2020@gmail.com --- still in wine-5.18
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #5 from amad4wine2020@gmail.com --- still in wine-5.19
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #6 from amad4wine2020@gmail.com --- still in wine-5.20
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #7 from amad4wine2020@gmail.com --- Created attachment 68565 --> https://bugs.winehq.org/attachment.cgi?id=68565 screenshot_wine-5.20
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #8 from amad4wine2020@gmail.com --- still in wine-5.22
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #9 from amad4wine2020@gmail.com --- Still in Wine-6.0-rc1
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #10 from amad4wine2020@gmail.com --- still in wine-6.0-rc4
https://bugs.winehq.org/show_bug.cgi?id=49752
Roman Pišl rpisl@seznam.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rpisl@seznam.cz
--- Comment #11 from Roman Pišl rpisl@seznam.cz ---
P.S. The installer will silently install FirebirdSQL 1.5 and enable Firebird Guardian, it does not work well with winehq-devel. Unpack the installmpc482ENG.exe and rename the included installmpc482ENG/firebird/FirebirdWin32.exe before continuing with the installation. Install the renamed FirebirdWin32.exe manually (uncheck the 'Use the Guardian to control the server?' option during the installation).
This didn't work for me and not installing FirebirdWin32.exe caused mpc.exe to crash on startup. Without this workaround, the installation finishes without error and mpc.exe starts. Tested on Wine 6.0-rc4.
The problem is in in ioctl IOCTL_SERIAL_SET_HANDFLOW which returns STATUS_NOT_SUPPORTED.
That is because unsupported combination of flags is provided, see the first condition in set_handflow() in dlls/ntdll/unix/serial.c:
597 static NTSTATUS set_handflow(int fd, const SERIAL_HANDFLOW* shf) 598 { 599 struct termios port; 600 601 if ((shf->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) == 602 (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) 603 return STATUS_NOT_SUPPORTED;
The program shows "Device not responding" if this condition is removed, however I can't test it further because I don't have any device.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #12 from amad4wine2020@gmail.com --- Well, I have tried this patch:
diff -Naru wine-6.0-rc6.orig/dlls/ntdll/unix/serial.c wine-6.0-rc6/dlls/ntdll/unix/serial.c --- wine-6.0-rc6.orig/dlls/ntdll/unix/serial.c 2021-01-08 23:03:21.000000000 +0100 +++ wine-6.0-rc6/dlls/ntdll/unix/serial.c 2021-01-12 03:55:14.352020992 +0100 @@ -598,9 +598,9 @@ { struct termios port;
- if ((shf->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) == - (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) - return STATUS_NOT_SUPPORTED; +// if ((shf->FlowReplace & (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) == +// (SERIAL_RTS_CONTROL | SERIAL_RTS_HANDSHAKE)) +// return STATUS_NOT_SUPPORTED;
if (tcgetattr(fd, &port) == -1) {
Now the program shows 'Device not responding' instead of 'Selected serial port not exist', even when a device is connected.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #13 from amad4wine2020@gmail.com --- Created attachment 69168 --> https://bugs.winehq.org/attachment.cgi?id=69168 wine-6.0rc6+patch_log.txt
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #14 from Roman Pišl rpisl@seznam.cz --- Emulating some Windows serial line modes is tricky and this is the case. What kind of device do you have connected? Is it RS232 or RS485? What type of serial line chip do you have on your computer? Or is it USB converter?
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #15 from amad4wine2020@gmail.com --- (In reply to Roman Pišl from comment #14)
Emulating some Windows serial line modes is tricky and this is the case. What kind of device do you have connected? Is it RS232 or RS485? What type of serial line chip do you have on your computer? Or is it USB converter?
The connected device is: MCU-01 USB/RS485 OPTO-ISOLATED CONVERTER (https://mikster.eu/en/produkty/mcu-01-usbrs485-opto-isolated-converter/)
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #16 from Roman Pišl rpisl@seznam.cz --- Created attachment 69174 --> https://bugs.winehq.org/attachment.cgi?id=69174 Hack#2 - avoid fiddling with control flow
These USB converters are often a combo of FT232 and MAX485 that just works when plugged in and correct baud rate is selected. Try to avoid fiddling with setting of control flow at all with this patch. It is a blind shot again, since we don't know if the serial line is still the cause of the problem.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #17 from amad4wine2020@gmail.com --- Created attachment 69377 --> https://bugs.winehq.org/attachment.cgi?id=69377 screenshot_wine-6.2+Hack#2
The last patch (Hack#2) allows to connect the controller (MCC-2100). Once the controller has been successfully connected the program will show 'Device not responding'.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #18 from Roman Pišl rpisl@seznam.cz --- Created attachment 69386 --> https://bugs.winehq.org/attachment.cgi?id=69386 Hack#3 - fake EV_RXFLAG
The most important part from your screenshot is the message about EV_RXFLAG in the background.
Unfortunately your application is very specific and again requires a feature that is not only unimplemented but also very hard to emulate as Linux does not support this.
For more information see https://forum.winehq.org/viewtopic.php?t=32901&p=124405
Attached you'll find additional hack#3 that could possibly make the application work. You can fiddle with the time constant or maybe raising the event after more characters are in the queue.
I don't know how important is this application for you. A proper fix would require modifications to both Wine a Linux. Is that worth the effort?
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #19 from amad4wine2020@gmail.com --- Created attachment 69589 --> https://bugs.winehq.org/attachment.cgi?id=69589 wine-6.3+Hack#2+Hack#3_log.txt
Unfortunately, it doesn't work even with additional patch (Hack#3).
I have tried different values:
time.QuadPart = (ULONGLONG)10000 time.QuadPart = (ULONGLONG)100000 time.QuadPart = (ULONGLONG)1000000 time.QuadPart = (ULONGLONG)10000000
The program still shows 'Device not responding'.
It's not obvious to me how to raise events after more characters are in the queue, so I didn't try that.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #20 from amad4wine2020@gmail.com --- (In reply to Roman Pišl from comment #18)
I don't know how important is this application for you. A proper fix would require modifications to both Wine a Linux. Is that worth the effort?
According to the "D2XX Programmer's Guide" (https://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer%27s...), there are two functions that can take the EV_RXFLAG (one of them seems to be Windows specific): FT_W32_SetCommMask (Supported Operating Systems: Linux, Mac OS X, Windows) FT_W32_GetCommMask (Supported Operating Systems: Windows)
Does it make sense to try adopt the 'alternative driver' - D2XX for FTDI devices and a shim layer between the FTDI's Linux D2XX driver and application running under Wine? (https://github.com/brentr/wineftd2xx)
If there is a way to use VCP through D2XX driver (emulate a VCP interface through it), then maybe this one and other similar applications could work (probably only for FTDI's chips, quite common anyway).
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #21 from Roman Pišl rpisl@seznam.cz ---
Does it make sense to try adopt the 'alternative driver' - D2XX for FTDI devices and a shim layer between the FTDI's Linux D2XX driver and application running under Wine? (https://github.com/brentr/wineftd2xx)
If there is a way to use VCP through D2XX driver (emulate a VCP interface through it), then maybe this one and other similar applications could work (probably only for FTDI's chips, quite common anyway).
I don't think this is feasible. COM ports are directly forwarded to serial ports in Wine.
The more realistic is possibly a "proxy application" on the Linux side that talks with the device reliably and emulates what this obscure application running in Wine needs via pseudo terminal to which the COM port is mapped.
But that's all how I can help here as this as I don't have the real device.
https://bugs.winehq.org/show_bug.cgi?id=49752
--- Comment #22 from amad4wine2020@gmail.com ---
The more realistic is possibly a "proxy application" on the Linux side that talks with the device reliably and emulates what this obscure application running in Wine needs via pseudo terminal to which the COM port is mapped.
But that's all how I can help here as this as I don't have the real device.
It seems there are no alternatives to this software which can work with the Mikster MCC-2100 controllers, display the thermal processing logs (e.g., temperature in the chamber, humidity, cycle duration) and archive them on the local hard drive.
There are some remarks about the Set/GetCommMask functions: (https://stackoverflow.com/questions/53865939/porting-win32-serial-rs232-comm...) 'Set/GetCommMask : Unfortunately, the POSIX API does not have an equivalent of this function. If you need to care about the control signals(CTS,DSR,RING), you need to read the line status in a loop. If you only care about reading bytes that come back, you don't need to worry about this.'
Is it realistic to use a "proxy application" to emulate Set/GetCommMask functionality by using available POSIX functions (using standard drivers)?
Actually, I don't have knowledge to discuss this topic in a deeper level, I can give remote access to the serial port if it really helps.
https://bugs.winehq.org/show_bug.cgi?id=49752
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |serial
https://bugs.winehq.org/show_bug.cgi?id=49752
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, hardware