artoo-raspi
artoo-raspi copied to clipboard
ERROR -- : Artoo::Adaptors::Raspi crashed!
Hi, I'm trying out artoo for our makerspace based on a talk you guys gave at the Miami RubyConf last weekend.
Googling hasn't helped and I couldn't find a place to put this. I was hoping to eventually add mcp3008, and other i2c related code up here.
Just testing out the simple led example with the Pi https://github.com/hybridgroup/artoo-raspi
and I'm getting :
I, [2013-11-14T16:46:55.764633 #3044] INFO -- : Preparing work...
I, [2013-11-14T16:46:55.777544 #3044] INFO -- : Initializing connection raspi...
I, [2013-11-14T16:46:55.866557 #3044] INFO -- : Initializing device board...
I, [2013-11-14T16:46:55.898742 #3044] INFO -- : Initializing device led...
I, [2013-11-14T16:46:56.008247 #3044] INFO -- : Starting work...
I, [2013-11-14T16:46:56.016834 #3044] INFO -- : Connecting to 'raspi' on port 'none'...
I, [2013-11-14T16:46:56.069279 #3044] INFO -- : Starting driver 'Artoo::Drivers::DeviceInfo'...
Starting driver 'Artoo::Drivers::Led'...
Firmware name: Raspberry Pi
E, [2013-11-14T16:46:56.119757 #3044] ERROR -- : Artoo::Adaptors::Raspi crashed!
NameError: uninitialized constant Artoo::Raspi
/var/lib/gems/1.9.1/gems/artoo-raspi-0.5.0/lib/artoo/adaptors/raspi.rb:56:in version' /var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in
public_send'
/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in dispatch' /var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in
dispatch'
/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in block in handle_message' /var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in
block in task'
/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in block in initialize' /var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in
block in create'
Disconnecting all PWM pins...E, [2013-11-14T16:46:56.123695 #3044] ERROR -- : uninitialized constant Artoo::Raspi
E, [2013-11-14T16:46:56.136144 #3044] ERROR -- : ["/var/lib/gems/1.9.1/gems/artoo-raspi-0.5.0/lib/artoo/adaptors/raspi.rb:56:in version'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in
public_send'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in dispatch'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in
dispatch'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in block in handle_message'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in
block in task'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in block in initialize'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in
block in create'", "(celluloid):0:in remote procedure call'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:92:in
value'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/proxies/sync_proxy.rb:33:in method_missing'", "/var/lib/gems/1.9.1/gems/artoo-1.4.1/lib/artoo/connection.rb:86:in
method_missing'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in public_send'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in
dispatch'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in dispatch'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in
block in handle_message'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in block in task'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in
block in initialize'", "/var/lib/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'"]
Firmata version:
Thanks. @edgarSilva can you please look into this?
Let me know if there are any logs I can provide.
So sleuthing I found some of the problems. In your artoo-raspi/lib/artoo-raspi.rb your require paths are wrong (no libs).. Also there seems to be a file in artoo-raspi/lib/artoo-raspi/ drivers.rb that is missing.
here is the work around (without hacking too much of your work)
gem 'artoo-raspi' require 'artoo' require 'artoo/adaptors/raspi' require 'artoo-raspi/version'
connection :raspi, :adaptor => :raspi device :board, :driver => :device_info device :led, :driver => :led, :pin => 11
work do puts "Firmware name: #{board.firmware_name}" puts "Firmata version: #{board.version}"
every 1.second do led.toggle end end
Thanks for looking into it. @prussiap I committed some code to master branch that should address your problem. @edgarSilva can you please verify my changes?
Sure, I'll check them out and test. On Nov 23, 2013 12:31 PM, "Ron Evans" [email protected] wrote:
Thanks for looking into it. @prussiap https://github.com/prussiap I committed some code to master branch that should address your problem. @edgarSilva https://github.com/edgarSilva can you please verify my changes?
— Reply to this email directly or view it on GitHubhttps://github.com/hybridgroup/artoo-raspi/issues/6#issuecomment-29140929 .
I'm actually having the same issue with the latest version of artoo-raspi (0.6.0) with a Raspberry PI 2.
The output from running the sample code is:
I, [2015-06-21T20:59:02.576965 #11000] INFO -- : Registering connection 'raspi'...
I, [2015-06-21T20:59:02.577640 #11000] INFO -- : Registering device 'board'...
I, [2015-06-21T20:59:02.578060 #11000] INFO -- : Registering device 'led'...
I, [2015-06-21T20:59:02.578452 #11000] INFO -- : Preparing work...
I, [2015-06-21T20:59:02.583872 #11000] INFO -- : Initializing artoo::connection raspi...
I, [2015-06-21T20:59:02.647383 #11000] INFO -- : Initializing artoo::device board...
I, [2015-06-21T20:59:02.660966 #11000] INFO -- : Initializing artoo::device led...
I, [2015-06-21T20:59:02.684878 #11000] INFO -- : Starting work...
I, [2015-06-21T20:59:02.686690 #11000] INFO -- : Connecting to 'raspi' on port 'none'...
I, [2015-06-21T20:59:02.705908 #11000] INFO -- : Starting driver 'Artoo::Drivers::DeviceInfo'...
I, [2015-06-21T20:59:02.707136 #11000] INFO -- : Starting driver 'Artoo::Drivers::Led'...
Firmware name: Raspberry Pi
E, [2015-06-21T20:59:02.727084 #11000] ERROR -- : Actor crashed!
NameError: uninitialized constant Artoo::Raspi
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/artoo-raspi-0.6.0/lib/artoo/adaptors/raspi.rb:56:in `version'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
Disconnecting all PWM pins...
E, [2015-06-21T20:59:02.728253 #11000] ERROR -- : uninitialized constant Artoo::Raspi
E, [2015-06-21T20:59:02.730272 #11000] ERROR -- : ["/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/artoo-raspi-0.6.0/lib/artoo/adaptors/raspi.rb:56:in `version'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'", "(celluloid):0:in `remote procedure call'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:92:in `value'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/artoo-1.8.1/lib/artoo/connection.rb:85:in `method_missing'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'", "/home/pi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'"]
Firmata version:
^CI, [2015-06-21T20:59:03.730614 #11000] INFO -- : Shutting down...
D, [2015-06-21T20:59:03.734477 #11000] DEBUG -- : Terminating 10 actors...
@zaid Have you solved this issue? I've got stuck with the same one.
Just out of curiosity, can you try running under sudo? Just wondering if your current user does not have the needed privileges.
@deadprogram, same problem with sudo. Is it compatible with ruby 2.3.0dev?
I've not tried with any version > 2.0.x
@forme I ended up forking the repository and doing a minor change which fixed the issue for me. You can try my fork at https://github.com/zaid/artoo-raspi
Hi @zaid would you be willing to submit a PR with that change?
@deadprogram sure thing, I'll clean up the commit and submit a PR.
@deadprogram I created a pull request which failed the Travis build for Rubinius version 2.1.1 & JRuby version 1.7.9 which seems unrelated to my changes but I could be wrong...
You are correct. I need to make a few tweaks to the .travis.yml
file to accommodate this.
@forme does version 0.6.1 fix the issue for you?
I am having this problem on a raspberry pi 3.
@LTheGreats using the latest release of artoo-raspi (version 0.7.1) ? Which version of Ruby are you using?
I'm using ruby 2.1.5