in reply to Re: serial port control on Windows
in thread serial port control on Windows

Wow, that was interesting.

First of all, thanks for the mode command, I forgot that even existed.

When I click into device manager, it tells me the USB to serial port converter is on COM3. It also told me the baud rate was 9600. I manually changed it to 19200. I got out of device manager in case it might be interfering.

mode COM3: before opening the device gives me a baud rate of 1200, n, 7, 1. So much for my setting the port to 19200 in the device manager. When the code opens the port, mode says the device is not available. So at least perl grabbed the right device, but I can't tell what the settings are.

Replies are listed 'Best First'.
Re^3: serial port control on Windows
by BrowserUk (Patriarch) on Apr 23, 2008 at 19:18 UTC
    When the code opens the port, mode says the device is not available. So at least perl grabbed the right device, but I can't tell what the settings are.

    Did you try setting the port then closing it before using the mode command? They (usually) retain the last set of settings until something changes them.

    Another old technique for setting up serial ports initially is to do everything from the command line:

    mode com3: ... copy con com3: type whatever the device is expecting here ^Z ## see what response you get copy com3: con

    If you need to send or receive binary , then judicious use of /b on the copy commands may be in order--though it is a pain entering Alt-nnn, Alt-nnn.

    Also, if the device doesn't respond then you will probably have to kill cmd.exe from the task manager to get control back.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.