Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino doesn't receive messages for 2 seconds after connection #12

Closed
austinbv opened this issue Nov 17, 2012 · 4 comments
Closed

Arduino doesn't receive messages for 2 seconds after connection #12

austinbv opened this issue Nov 17, 2012 · 4 comments
Labels

Comments

@austinbv
Copy link
Owner

I am not sure what causes it but the arduino seems to not get any messages for about 2 seconds after connecting.

Possible places to check

  • IO actually going out
  • board no reading IO
  • IO being off
@vickash
Copy link
Collaborator

vickash commented Feb 4, 2013

I realized just now that it's because most of the Arduino boards reset themselves when you connect via the built in serial to USB converter. Article from the Arduino site:

http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection.

In short: a 10uF capacitor between RESET and GROUND will prevent it with the UNO. Most of the other boards require a 120 Ohm resistor between RESET and 5V. Leonardo doesn't auto reset by default.

I've tried the 10uF cap on my UNO and it works. Starts up quickly. It doesn't look like there's anything we can do about this in software though.

@austinbv
Copy link
Owner Author

good find I thought it was something to do with IO flush for a while. I still think we need to make sure IO is always flushing to the board at execution time rather than buffering. http://www.ruby-doc.org/core-1.9.3/IO.html#method-i-sync is the solution

@vickash
Copy link
Collaborator

vickash commented Feb 26, 2013

Both TCPSocket and SerialPort have sync set to true by default. Maybe we should call fsync after each write as well?

http://www.ruby-doc.org/core-1.9.3/IO.html#method-i-fsync

@austinbv
Copy link
Owner Author

that makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants