Maker Pro
Maker Pro

Intermittent serial connection

JohnHPG

Jul 1, 2015
2
Joined
Jul 1, 2015
Messages
2
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
 

shrtrnd

Jan 15, 2010
3,876
Joined
Jan 15, 2010
Messages
3,876
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.
 

JohnHPG

Jul 1, 2015
2
Joined
Jul 1, 2015
Messages
2
Thanks for the opinion, it got me thinking about a couple of things I might try. Thanks again!
 
Top