On 4/01/2021 17:47, Dirk Hohndel wrote:
> Serial communication on Windows... definitely not the best topic for me to help
> you with.
> I changed the subject line, hoping that maybe that will get someone with
> experience in that mine field to jump in.
>
> I also copied John who wrote the Cochran support and might be more familiar with
> dive computer specific pitfalls. And Jef who is the main author of
> libdivecomputer and knows everything there is to know about all the ways in
> which Windows makes communication with devices "entertaining".
This is the relevant part:
>> [0.000000] INFO: Open: name=COM5
>> [0.000534] INFO: Configure: baudrate=9600, databits=8, parity=0, stopbits=2,
>> flowcontrol=0
>> [0.001867] ERROR: A device attached to the system is not functioning (31) [in
>> /__w/subsurface/libdivecomputer/src/serial_win32.c:494 (dc_serial_configure)]
The serial port (COM5) was opened successfully, but trying to configure it
failed with ERROR_GEN_FAILURE (31). That means the device is at least recognized
by the OS and a driver is present. Otherwise opening would already fail. The
fact that configuring fails is most likely either a problem with the driver, or
the hardware itself. At this point we haven't even tried to communicate with the
dive computer. We're still setting up the serial port.
The other strange thing is that the dc_serial_configure function first retrieves
the current serial port settings, and then applies the new setting. The first
step appears to work just fine, it's the updating that failed. So that means the
driver (or the OS) fails to apply those settings. Those two stopbits is not a
very common configuration, but it's also used by a few other (older) dive computers.
I don't know about the Cochran, but some dive computers need to be put manually
into download mode. I doubt that's the problem here, because then I would expect
it to fail later when starting the communication, and not during configuration
of the serial port.
@Kitty: Have you tried downloading with the Cochran application? Does that work?
You mention you tried installing several drivers with zadig. Did it already fail
before you tried that? Because that could be part of the problem. Those WinUSB,
libusb-win32 or libusbK drivers are only needed for accessing the device with
the libusb library. If you install those, the normal driver will be replaced,
and without the virtual serial port, subsurface won't be able to connect at all.
There is a possibility that you somehow broke the driver. I suggest to uninstall
those drivers, and then install the original driver again. The easiest solution
is often to re-install the official application of the manufacturer, because
that typically contains the correct driver. (I never had physical access to a
Cochran, so I don't really know.)
Jef