shokai / arduino_firmata

Arduino Firmata protocol implementation on Ruby
http://shokai.github.io/arduino_firmata
MIT License
104 stars 23 forks source link

Weird Error #18

Closed belohlavek closed 11 years ago

belohlavek commented 11 years ago

When I run a simple script:

require 'rubygems' require 'arduino_firmata'

arduino = ArduinoFirmata.connect arduino.digital_write 13, true sleep

I get:

/var/lib/gems/1.9.1/gems/arduino_firmata-0.2.3/lib/arduino_firmata/arduino.rb:163:in `write_nonblock': Resource temporarily unavailable - write would block (Errno::EAGAIN)

Somehow if I execute the scripts too quickly i get the error, but if I wait then the error vanishes and works, how can I fix this?

belohlavek commented 11 years ago

Never mind, kids: never forget to add "arduino.close" at the end of your scripts!

Edit: Still closing it at the end I get the error some times :-(

shokai commented 11 years ago

you should write

belohlavek commented 11 years ago

Ubuntu 12.10 Arduino UNO Ruby 1.9.3 but I tried to downgrade it to the lastest dev version, yet when I do "ruby -v" I get 1.9.3

shokai commented 11 years ago

Hi

I've tried Ubuntu+Arduino UNO on VirtualBox, but it not recognize Arduino.

I'm looking for no-VM ubuntu laptop.

shokai commented 11 years ago

I disabled nonblocking IO and all tests was passed.