Connect with us

Intermittent serial connection

Discussion in 'General Electronics Discussion' started by JohnHPG, Jul 1, 2015.

Scroll to continue with content
  1. JohnHPG

    JohnHPG

    2
    0
    Jul 1, 2015
    Hello!

    I am completely new to this, so excuse (and correct) any mistakes and please bear with me.

    I am developing a packaged chrome app that communicates with a serial device. To make a long story short, here are the facts:
    • I can open a connection successfully with the serial port when a page loads
    • I can execute a particular command that takes about 20-60 seconds to return whether or not it was successful using a button.
    • I cannot, consistently, execute the same command as above when a page loads.
    I have tried:
    • Chaining the function that executes the command with other functions and then firing them onload.
    • Using setTimeout to run the function a while after the page loads.
    • Using a while loop that checks whether the function has been fired before or not (usually ends up running the command twice or none at all)
    • Inserted breakpoints to identify the problem (hint. the function fires but when it is time to connect to the serial port using the Chrome API something goes wrong)
    Now, I am sure it is not an error in the programming side since the command executes perfectly upon clicking a button, but fails when the command is executed upon a page loading. I suspect it is an issue of flushing the serial port or disconnecting and connecting again after each try, I honestly have no clue and therefore would like to hear your opinions regarding what might be causing this strange behavior.

    Thanks in advance
     
  2. shrtrnd

    shrtrnd

    3,767
    487
    Jan 15, 2010
    I'm not a computer person, maybe someone here can point you in the right direction.
    Your post made me remember an issue that sounds like yours, that happened to me many years ago.
    At that time, if I remember correctly, the computer guy who worked the problem said he had to do something with the
    computer software bios to match operating speeds. I may be totally off base here, and somebody more knowledgeable will help you with this.
    You asked for opinions, so this was your first.
    Good luck.
     
  3. JohnHPG

    JohnHPG

    2
    0
    Jul 1, 2015
    Thanks for the opinion, it got me thinking about a couple of things I might try. Thanks again!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-