1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to Open Port

Discussion in 'Relay Modules' started by Thomas Allgood, Jun 16, 2015.

  1. Thomas Allgood

    Thomas Allgood New Member

    Joined:
    Jun 16, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    asdlkjfasd
    I have installed the USB Driver and device manager says it's working properly. I set the Port to 19200 8 N 1 on port 2 in in the Device manager and checked the Code in the excel App but it always returns a Unable to open port. Do you have some suggestions.
     
  2. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    Hello Thomas,

    Can you please check and confirm if the device can be opened and operated using Hyperterminal or Teraterm ?

    Thanks,
    Tom
     
  3. rickd

    rickd New Member

    Joined:
    Apr 17, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Georgia
    Hello Tom - I am also having an intermittent issue failing to open Com Ports, however it seems to be limited to older Dell 32 bit Hardware. I try to close the port before opening however that does not help. If I reboot the machine then the port becomes available again. I am using this relay as part of a security system and need 99.9% uptime. I've got one system working reliably and one that will go a week or so before failing.
    Thanks,

    Rick
     
  4. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    Hello rickd,

    Your issue looks like different from what Thomas is experiencing. A similar problem below mentioned on one of the Micropython's Github issues pages (https://github.com/micropython/micropython/issues/587). Below is the quote from user markusgritsch on June 2, 2014.

    This is also discussed at the MSDN discussion below.

    https://social.msdn.microsoft.com/F...nnect-reconnect-then-cant-open-port?forum=wdk

    As I understand, what is happening is that the device is getting disconnected during operation when the port is opened by your application. And when the device reappears, the application can not talk with it until after a reboot. Can you please check if the board is getting reset or Windows is somehow resetting the board ? If the board is deployed in an environment where there are EMF/RFI interference, a large dose of EMI could reset the board unless the board is protected with shielding. Same applies to USB cable as well, especially if the USB cable is run along with power cables. EMI related issues are very rare but can still happen. Since this behavior is due to a bug in Microsofts driver, our best workaround would be to make sure that the device does not reset (or disconnect/reconnect) when the port is open. I will do a detailed research and post here if I can find any other solution.

    Thanks,
    Tom
     
  5. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
  6. rickd

    rickd New Member

    Joined:
    Apr 17, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Georgia
    Hello Tom - I may have stumbled upon the answer. I will need to do some experimenting to solidify my theory. I am using the usb relay to trigger an alarm that signals that a person is alone in a secure location. This is accomplished via a windows service that reads from a database table. Person cards into a room and a database entry is added. Leaves the room entry is removed.

    The machines that have been provided to me by my employer have been older PCs running Windows 7 (usb 1.1). The reliability of opening a Com Port has been spoty at best. Then I replaced one of the two PCs with a box that had usb 2.0 ports. Since installing that machine I have had no problems at that location. In the other location I still have an old PC with usb 1.1 and it stopped working completely. I compiled your sample code and installed it on the old PC and it will open and close the port and relay no problem. I am thinking that maybe the response time of the USB 1.1 port is too slow to be open / closed by a service.

    Any Thoughts?
     
  7. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    If this specific machine's host controller or motherboard has any problems, it could affect the working of the relay board. For example, if the DC-DC converter or power supply circuit on the motherboard that supplies power to the USB port is starting to fail, it could cause the relay board to reset. This is less likely but not impossible.

    Another reason I can think of is that the particular location where the failing machine is located may be more noisy (in terms of EMI). The only way to rule this out is to swap the failing machine with a known working machine if possible. I would recommend to put a good machine in the bad machines place and put the bad machine in the good machine's place. This way we can find out if the problem is following the machine or the location. I don't know if this is practically possible in your specific situation, but this is the easiest test I can think of.

    Thanks,
    Tom
     
  8. rickd

    rickd New Member

    Joined:
    Apr 17, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Georgia
    I am unable to swap machines between locations, since the one location is working they want it to remain working. I found a brand new Dell Optiplex that was sitting unused so I borrowed it. I'll load my windows service on it and give it a go. Both locations have the machines located in a server room so I would expect there to be alot of RF. I also have a couple spare relays so I can swap one out if I need to. Each relay closes a circuit that activate a higher amperage solid state relay which in turn sounds a horn. I'll put this PC in place at the beginning of the week. We'll see what happens.

    Rick
     

Share This Page