Shop OBEX P1 Docs P2 Docs Learn Events
Blocked com ports? — Parallax Forums

Blocked com ports?

Erik FriesenErik Friesen Posts: 1,071
edited 2011-03-10 12:21 in General Discussion
I am having issues with miscellaneous computers that have unaccessable com ports. Surely there is a way to find which program has the handle? All google finds is programs that deal with IP addresses. One thing I have found out is that windows xp media edition will do this if you turn on caller id.
«1

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-04 16:41
    Take a look at IRQ's
    '
    (Hardware Interrupt request)
    '
    If you don't know how to view these, Google IRQ.
    '
    You can manage the IRQ's to free up the COM ports you need.
    '
    Make sure you have a good understanding of how this works before you make any changes.
    '
    This should fix your problem with the COM ports.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-04 17:50
    These ports in question are not true com ports, the irq's are not changeable, if they were, they probably couldn't be changed while another process has control of them.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-03-04 18:27
    Not exactly sure what you are looking for but if you are looking to see what COM ports are being assigned, run the EnumPorts.hta file within this zip.
    It scans the registry and enumerates the ports and relevant info

    Attachment not found.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-04 19:28
    Hmm, you don't live far from me, I live in Southern Indiana about 45min from Louisville.

    Really what I need is some way to find out who is holding the handle open to a specific port.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-04 19:34
    These ports in question are not true com ports, the irq's are not changeable, if they were, they probably couldn't be changed while another process has control of them.
    '
    If their not true COM ports why didn't you say this from the start.
    '
    And No. you can't change and IRQ on the fly. This has to be changed in the Boot directory.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-05 05:12
    What percent of com ports are true today? The vast majority are probably virtual com ports. I don't see any way it can be an irq problem. I think there is some software that is scanning ports and opening them, but I can't figure out which.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-05 14:19
    IRQ's set the pecking order to what program gets priority to the com ports
    '
    Your Oblivious to how COM ports work.(Its a hardware thing)
    '
    There's no such thing as a virtual COM port. Unless its used to simulate a function. A simulation is not an out going port.
    '
    Unplug your ether net cable your WiFi card your BlueTooth your serial cable and your usb cable and see how a virtual com port works for You.
  • PublisonPublison Posts: 12,366
    edited 2011-03-05 15:00

    There's no such thing as a virtual COM port. Unless its used to simulate a function. A simulation is not an out going port.
    '
    http://www.ftdichip.com/Drivers/VCP.htm
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-05 18:53
    Publison wrote: »
    '
    Thanks for proving my point Publison
    '
    The FTDI chip coverts the voltage and DATA from a PC port to another voltage.(usually lower voltage)
    '
    Its not the PC port that does this.
    '
    Unless you change the hardware in the PC, Theres nothing virtual about it.
  • Mike GMike G Posts: 2,702
    edited 2011-03-05 18:54
    There's no such thing as a virtual COM port

    Virtual COM ports have been around for a long time. If you have a USB connection to a Propeller or STAMP, you're using a virtual COM port.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-03-05 20:18
    Virtual COM ports is the reason I wrote the EnumPorts.hta HTML Application (in the attached zip file from my earlier response).

    I have one physical COM port (COM1) and 17 virtual COM ports for all of my USB devices - see image below.
    I found that I could change the DeviceDesc registry entries so I could distinquish similar devices (like multiple Propeller boards, Arduinos, etc)

    For example, the DeviceDesc string value for this key is "USB Oscilloscope"
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_0403&Pid_6001\5&97be1ee&0&2

    ports.jpg
    955 x 474 - 135K
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-05 21:40
    $WMc%
    '
    Throwing in the towel.
    '
    A quote from Cool hand Luke movie "Some men you just can't reach;This is what we have here today"
  • Mike GMike G Posts: 2,702
    edited 2011-03-06 07:05
    Don't worry $WMc% you'll get it one of these days.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-06 11:12
    Mike G wrote: »
    Don't worry $WMc% you'll get it one of these days.
    '
    You guys are way over thinking this.
    '
    Do you have an answer to the post?
  • PublisonPublison Posts: 12,366
    edited 2011-03-06 12:56
    Why can't you accept the existence of Virtual Ports? They have been around since USB.

    My post to the FTDI driver page was to say that Virtual Com Ports exist, not to prove your point.

    @Eric

    Are we talking the the ability of talking to Parallax IDE's or some other program. You were a little vague in your first post.

    $WMc% wrote: »
    '
    You guys are way over thinking this.
    '
    Do you have an answer to the post?
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-06 15:43
    Not specifically. My problem more lies with modems. Dotnet doesn't give me a good way to access a modem, except as a com port.
  • Mike GMike G Posts: 2,702
    edited 2011-03-08 05:54
    I looked around for some code snippet, could not find anything. I think you would need a service running on the system that logs serial port connection events. I could not find a way to enumerate applications with an open connection.
  • $WMc%$WMc% Posts: 1,884
    edited 2011-03-08 18:35
    Mike G wrote: »
    I looked around for some code snippet, could not find anything. I think you would need a service running on the system that logs serial port connection events. I could not find a way to enumerate applications with an open connection.
    '
    Don't worry Mike G
    '
    You'll get it one of these days.
    '

    www.re-quest.net/computers/messenger-spam/

    www.pcreview.co.uk/.../com-port-open-problem-c-cf-2-0-wince-6-0-r3- t3936303p2.html

    www.eggheadcafe.com/.../port-dotnet-micro-framework-to-sony-clie-ux50. aspx

    www.filebuzz.com/files/Rs232_Sniffer/freeware-1.html -
    '
    These will look at the Hardware. Nothing Virtual in the Hardware.
  • Mike GMike G Posts: 2,702
    edited 2011-03-09 05:31
    I use a serial port monitor by HHD and an API. They both work like a charm and both can monitor any COM port virtual or hardware. The question on this forum is how to find a process that has opened a com port. The serial port monitor that I'm familiar with target a specific port. They do not monitor all ports by default. I'm sure there's some diagnostic software out there somewhere that will do the job.

    This is the software I use but I think it's overkill for this question. You could roll your own if all you need to know is what process opened the port not what's being transmitted over the wire.
    http://www.hhdsoftware.com/serial-port-monitoring-control

    $WMc%,Have you tried any of the software you suggested and verified it will not work with a virtual serial port?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-03-09 06:08
    Check out this Sysinternals (now Microsoft) port monitor utility:
    Portmon for Windows v3.02

    The output below is from using a Parallax USB/Serial adapter and the Basic Stamp software.
    You can use Windows Task Manager to see what process ID is associated with the named process e.g. Stampw.exe

    portmon.jpg
    1024 x 495 - 123K
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-09 06:17
    You know, I have tried that program, I cannot get it to connect to my machine correctly. I realize now that portmon is 32bit only. I am using win7 64.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-09 06:21
    Something like this might work, however, I don't want to buy this for every computer I diagnose.

    http://www.com-port-monitoring.com/portmonitor.html

    The other problem is that I think it has to be installed, then rebooted for the monitoring to work.
  • kwinnkwinn Posts: 8,697
    edited 2011-03-09 08:03
    Virtual ports have been around longer than USB. They were used over Ethernet to communicate with remote terminals and clusters of terminals. What makes them "virtual" is that they do not have a UART chip (or equivalent hardware) in the computer. They were a software driver that communicated over some type of hardware and emulated the functions of a true serial port.

    Most if not all software did not communicate directly with a modem since the early modems were all connected to the computer by a serial port. Even later designs that merged the UART and modem on a single chip still maintained the separate functions. The chip looked like a serial port with a modem plugged in to it to the computer.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-09 08:08
    I really don't think IRQ's apply to anything but a hardware port anyway, they way I understand the IRQ has to do with the interrupt priority of that specific port, thus it is unlikely that a usb or any type of vcp is going to use that setting.
  • KaosKiddKaosKidd Posts: 296
    edited 2011-03-10 09:20
    Ok, I believe I'll reply here.

    For the discussion at hand, and the original questions: All of these ports cited here are called Virtual Com Ports because they create a port (an access point) into the IO memory map from outside of the IO memory map. That's the real short and sweet answer. For more information, feel free to read on.


    $WMc% IS Right; and so is kwinn! 100% of the quoted Virtual Com ports everyone here cited is a device driver (software) that connects HIGH physical memory, such as a USB's drivers, to LOW IO memory. For any, and I reference ALL and ANY hardware to access a computer, it's hardware has to be "mapped" into the computer's memory. This location is a physical memory location located in low memory. This is because LOW memory will ALWAYS be there; all computers have a Minimum ram configuration and this is the primary reason.

    Because there is limited space in any IO memory map, device drivers create space in high ram and the "software" uses this space in HIGH memory to talk to the device driver which preforms all the services to access the physical IO memory located in LOW ram. Some drivers create Virtual Ram above the physical RAM that is installed execute it's driver code from. (This is another whole concept outside this discussion of Virtual Com Ports and IO Memory Maps) This device driver is responsible for creating and maintaining buffers, pointers and everything else needed to communicate with the hardware. Lastly, the device driver preforms the physical IO with the hardware by sending the appropriate commands/data from the device drivers memory space (again, located in HIGH ram), to the IO memory the hardware is physically connected to (again, located in LOW ram). Some physical hardware requires at least one byte in the IO Memory map, such as a true COM port, others more, such as a USB Cam that requires 16 bytes.. All of the buffering, pre and post processing of data and commands happen in the device driver space, located else where (not in the IO Memory map!) of the computer.

    :)

    KK

    I tried to keep it simple, so some things are left out. It's a concept I'm talking about.
  • ercoerco Posts: 20,259
    edited 2011-03-10 09:30
    Great info, KK! Informative and presented very diplomatically.
  • KaosKiddKaosKidd Posts: 296
    edited 2011-03-10 10:46
    Thanks erco!

    All I can say is that I try. The whole conversation never explained what a virtual com port was, and why someone was right and others were wrong. I've written a number of drivers in my life, and at that level of a PC, the hardware level, many things most users take for granted become issues. One of the biggest reasons why there are so many Virtual Com ports is because of how windows denies applications direct hardware access. In essence, the IO memory is protected memory, access is permitted only from drivers; thus windows can control which driver / software can access a port at any given moment in time; which, BTW, was originally designed so the IO memory could be shared between concurrent applications. In the days of DOS, you could have two TSR (Terminate and stay resident) applications that accessed the same IO Memory. Ok, I'm babbling AND dating myself...

    Thanks for the compliment erco.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-10 11:09
    I have been doing something interesting here lately. I had a client buy a trendnet 560-u modem, it would not work correctly on win7 64. Whenever I tried to "AT+FCLASS=8" it would respond with an error. So, I bought one, plugged it into my XP machine, it worked correct. So I modified the inf on my win7 machine so it would use usbser.sys instead of the stock driver, now it works, although the sound does not. I think I am going to try modifying the inf further so the computer only sees it as a com port. I suspect there is a program that scans the modem ports and randomly opens them. Could even be some obscure win7 setting.
  • KaosKiddKaosKidd Posts: 296
    edited 2011-03-10 11:23
    I have been doing something interesting here lately. I had a client buy a trendnet 560-u modem, it would not work correctly on win7 64. Whenever I tried to "AT+FCLASS=8" it would respond with an error. So, I bought one, plugged it into my XP machine, it worked correct. So I modified the inf on my win7 machine so it would use usbser.sys instead of the stock driver, now it works, although the sound does not. I think I am going to try modifying the inf further so the computer only sees it as a com port. I suspect there is a program that scans the modem ports and randomly opens them. Could even be some obscure win7 setting.


    I don't mean to be a pain: You do know that ALL usb devices are basically serial devices daisychaned on a tx/tx pair and accessed in a time domain, right? Knowing this, you could easially remove all of your USB devices (while the computer is off), and then boot. Then it wouldn't appear as random ports being opened. I can say with fairly much cerinty that your Win7 PC has a number of USB devices installed (or had them installed), and identifying which one is on which Virtual com port is the issue at hand. As for the modem, its only particually working because you specified a USB SERIAL driver for it, not an AT class serial Modem.

    Just trying to help.

    KK
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-03-10 11:29
    Yes, and that is fine. It was more just to see if their driver was the issue, which it was. Last time I called tech support they basically told me I was doing stuff it wasn't designed to do, which I don't agree with. Its tech support, but they don't know what an at command is.

    The serial port spy program I have installs its own drivers into the mix, I suppose everything gets shunted through their driver.
Sign In or Register to comment.