Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Cannot unplug and re-plug USB Serial device on OSX #60

Open
nilbus opened this issue Feb 11, 2015 · 2 comments
Open

Cannot unplug and re-plug USB Serial device on OSX #60

nilbus opened this issue Feb 11, 2015 · 2 comments
Labels

Comments

@nilbus
Copy link
Owner

nilbus commented Feb 11, 2015

Reported by @everetteallen in #57:

If I unplug and replug "hot" I get:

sudo foreman start
19:42:29 web.1  | started with pid 844
19:42:30 web.1  | Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
19:42:32 web.1  | I, [2015-02-10T19:42:32.521912 #844]  INFO -- : Sensor watch started w/ device search path: "/dev/tty.usbserial"
19:44:15 web.1  | E, [2015-02-10T19:44:15.629024 #844] ERROR -- : Actor crashed!
19:44:15 web.1  | Errno::ENXIO: Device not configured
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:44:in `block in sysread'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:390:in `synchronize'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:42:in `sysread'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:322:in `fill_rbuff'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:159:in `gets'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-io-0.15.0/lib/celluloid/io/stream.rb:181:in `each'
19:44:15 web.1  |   /Users/ega/pinewood-derby-master/lib/serial_device.rb:33:in `monitor_input'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:122:in `dispatch'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
19:44:15 web.1  |   /Library/Ruby/Gems/2.0.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'

My derby_config.yml is:

admin_password: <%= ENV['DERBY_ADMIN_KEY'] %>
# device_glob: "/dev/tty{USB,.usbserial}*"
device_glob: "/dev/tty.usbserial"
lane_count: 3
sensor_class_name: MicroWizardFastTrack
@nilbus nilbus added the bug label Feb 11, 2015
@nilbus
Copy link
Owner Author

nilbus commented Feb 11, 2015

@everetteallen Unfortunately right now I don't have a USB serial adapter to test with, and my free time is limited. For now, you may have to restart the rails app server if the USB device gets unplugged. Restarting the server will not cause any data loss, as everything is persisted in the database.

@nilbus
Copy link
Owner Author

nilbus commented Feb 11, 2015

@everetteallen Can you confirm that you can receive data from the track sensor up until you unplug the USB adapter? It seems like it, since the log shows nearly 2 minutes between the app startup and the actor crash.

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

No branches or pull requests

1 participant