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

Fix close problem on Webrick & speed up #28

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@odarriba

odarriba commented Aug 27, 2013

Using rails 3.2.14 and Webrick in development stage, the web server can't close because the call to exit in the catching of signals fire an exception on Webrick's code.

Now the close of the connection to Serial port is made in an at_exit block as described here:
http://www.bigfastblog.com/ruby-exit-exit-systemexit-and-at_exit-blunder

Also, I've reduced sleep times, so the connection is faster.

@shokai

This comment has been minimized.

Show comment
Hide comment
@shokai

shokai Aug 28, 2013

Owner

Hi odarriba thank you for pull request.

I'll use that you suggested at_exit.
But I could not merge your speedup code because those sleep are necessary to support old arduino series.

Owner

shokai commented Aug 28, 2013

Hi odarriba thank you for pull request.

I'll use that you suggested at_exit.
But I could not merge your speedup code because those sleep are necessary to support old arduino series.

@odarriba

This comment has been minimized.

Show comment
Hide comment
@odarriba

odarriba Aug 28, 2013

Do you want to receive a new merge? I can make the changes only to at_exit code.

What do you think about using another internal parameter to switch between fast and slow mode? It's because the gem takes too long to connect to Arduino even if the Arduino is newer.
If you like the idea, I can do the changes too :)

odarriba commented Aug 28, 2013

Do you want to receive a new merge? I can make the changes only to at_exit code.

What do you think about using another internal parameter to switch between fast and slow mode? It's because the gem takes too long to connect to Arduino even if the Arduino is newer.
If you like the idea, I can do the changes too :)

@odarriba

This comment has been minimized.

Show comment
Hide comment
@odarriba

odarriba Aug 28, 2013

I have only one thing to say: Thanks, your gem solves me a huge problem of implementation

odarriba commented Aug 28, 2013

I have only one thing to say: Thanks, your gem solves me a huge problem of implementation

shokai added a commit that referenced this pull request Aug 28, 2013

@shokai

This comment has been minimized.

Show comment
Hide comment
@shokai

shokai Aug 28, 2013

Owner

I'm trying to detect old arduino from USB device-name.

Debian Linux(raspberry pi)

  • /dev/ttyACM0 -> Leonard, Micro, UNO
  • /dev/ttyUSB0 -> Decimilla, Duemillanove

Mac OSX

  • /dev/tty.usbmodem1234 -> Leonard, Micro, UNO
  • /dev/tty.usbserial-A1234 -> Decimilla, Duemillanove

If the name matches /(usbmodem|ACM)/ they don't need sleep.

Owner

shokai commented Aug 28, 2013

I'm trying to detect old arduino from USB device-name.

Debian Linux(raspberry pi)

  • /dev/ttyACM0 -> Leonard, Micro, UNO
  • /dev/ttyUSB0 -> Decimilla, Duemillanove

Mac OSX

  • /dev/tty.usbmodem1234 -> Leonard, Micro, UNO
  • /dev/tty.usbserial-A1234 -> Decimilla, Duemillanove

If the name matches /(usbmodem|ACM)/ they don't need sleep.

@odarriba

This comment has been minimized.

Show comment
Hide comment
@odarriba

odarriba Aug 28, 2013

Ok, I'm going to work on it now, and do a new merge request

odarriba commented Aug 28, 2013

Ok, I'm going to work on it now, and do a new merge request

@shokai

This comment has been minimized.

Show comment
Hide comment
@shokai

shokai Aug 28, 2013

Owner

I've push v0.3.2 to rubygems.org.
Thanks a lot of suggestions @odarriba

Owner

shokai commented Aug 28, 2013

I've push v0.3.2 to rubygems.org.
Thanks a lot of suggestions @odarriba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment