austinbv/dino

Board Not Found

Closed this issue · 16 comments

After having followed the steps.. I just keep getting

/dino/lib/dino/tx_rx/usb_serial.rb:17:in `io': Dino::BoardNotFound (Dino::BoardNotFound)
    from /home/nm/projects/dino/lib/dino/tx_rx/usb_serial.rb:44:in `write'
    from /home/nm/projects/dino/lib/dino/board.rb:47:in `write'
    from /home/nm/projects/dino/lib/dino/board.rb:111:in `send_clearing_bytes'
    from /home/nm/projects/dino/lib/dino/board.rb:9:in `initialize'
    from examples/led/led.rb:8:in `new'
    from examples/led/led.rb:8:in `<main>'

If you don't mind saying how you solved it?

I had to run the program as a 'root' user. The user I was running with was not authorized to create serial connection. (Linux)

ah good to know for anyone in the future

@nishantmodak Tried to run the file as root user, I'm still not able to get rid of the error!

@vishaltelangre What version of dino and what operating system? Can you post the backtrace you get?

@vickash: This is the backtrace of the error that I am getting:

/home/dipak/.rvm/gems/ruby-1.9.3-p385/gems/dino-0.11.2/lib/dino/tx_rx/base.rb:52:in `handshake': Dino::BoardNotFound (Dino::BoardNotFound)
    from /home/dipak/.rvm/gems/ruby-1.9.3-p385/gems/dino-0.11.2/lib/dino/tx_rx/serial.rb:23:in `handshake'
    from /home/dipak/.rvm/gems/ruby-1.9.3-p385/gems/dino-0.11.2/lib/dino/board.rb:13:in `handshake'
    from /home/dipak/.rvm/gems/ruby-1.9.3-p385/gems/dino-0.11.2/lib/dino/board.rb:9:in `initialize'
    from led.rb:9:in `new'
    from led.rb:9:in `<main>

Dino version I am using is: 0.11.2
Operating system is: Ubuntu 12.10.

Do you know what device your arduino mounts to?

Well, I think it must be FTDI driver, here is the dmesg's output:

$ dmesg | grep ttyUSB
[  341.973252] usb 2-1.2: >GSM modem (1-port) converter now attached to ttyUSB0
[  341.973405] usb 2-1.2: >GSM modem (1-port) converter now attached to ttyUSB1
[  341.974871] usb 2-1.2: >GSM modem (1-port) converter now attached to ttyUSB2
[  341.975128] usb 2-1.2: >GSM modem (1-port) converter now attached to ttyUSB3
[  341.975387] usb 2-1.2: >GSM modem (1-port) converter now attached to ttyUSB4
[ 1668.697701] usb 2-1.1: >FTDI USB Serial Device converter now attached to ttyUSB5
[ 1806.854468] option1 ttyUSB0: >GSM modem (1-port) converter now disconnected from ttyUSB0
[ 1806.854816] option1 ttyUSB1: >GSM modem (1-port) converter now disconnected from ttyUSB1
[ 1806.855326] option1 ttyUSB2: >GSM modem (1-port) converter now disconnected from ttyUSB2
[ 1806.855766] option1 ttyUSB3: >option_instat_callback: error -108
[ 1806.857075] option1 ttyUSB3: >GSM modem (1-port) converter now disconnected from ttyUSB3
[ 1806.857470] option1 ttyUSB4: >option_instat_callback: error -108
[ 1806.857630] option1 ttyUSB4: >GSM modem (1-port) converter now disconnected from ttyUSB4
[ 1827.600387] usb 2-1.3: >GSM modem (1-port) converter now attached to ttyUSB0
[ 1827.600846] usb 2-1.3: >GSM modem (1-port) converter now attached to ttyUSB1
[ 1827.601535] usb 2-1.3: >GSM modem (1-port) converter now attached to ttyUSB2
[ 1827.602128] usb 2-1.3: >GSM modem (1-port) converter now attached to ttyUSB3
[ 1827.602871] usb 2-1.3: >GSM modem (1-port) converter now attached to ttyUSB4

And, I did confirmed that the ttyUSB5 was the needed serial port, but Dino didn't recognised it though.

Sorry I forgot to respond to this. Which board are you using? Also, have you tried using the master branch (0.11.3)? The handshake routine was too aggressive in 0.11.2, since I wrote it using only an Uno for testing. It should be much better in 0.11.3.

I am using Dino 0.11.2 and test an Arduino Uno on Ubuntu 12.04. Just started learning this very interesting Ruby language and tried the jumpstartlab excellent tutoriol. When the baudrate from the default value given by the tutoriol (115200).. everything work fine eventhough the same warnings are given,, but the terminal and arduno board indicate both are communication. But when change to 9600 baudrate the same warnings appear but ardunio and Ruby does not work.. Hope this helps

regards
Aziz

Have you changed the baud rate in the sketch and re-flashed the board? Both the board and the ruby script need to use the same baud rate.

Dear Mr Vickash

Yup.. I change the baudrate in du.ino ( using Arduino IDE 1.0.1) from 115200 to 9600(not working) and flash the modified sketch to the arduino board. I cannot find baudrate setting for blink.rb. I only change the baudrate for the serial port and arduino sketch..

Initializing the board (and TxRx) should look something like this if you have to set baud to 9600:

board = Dino::Board.new(Dino::TxRx::Serial.new(baud: 9600)

Try that and see if it works.

Dear Mr Viskash

Do i have to add require 'serialport' ?.. and additional close bracket. When I change the baudrate to the serial port, du.ino sketch and blink.rb , the board and ruby is no loger talking and i have the following messages

/home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/tx_rx/base.rb:43: warning: ambiguous first argument; put parentheses or even spaces
/home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/tx_rx/serial.rb:40: warning: ambiguous first argument; put parentheses or even spaces
/home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/board.rb:99: warning: ambiguous first argument; put parentheses or even spaces
/home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/tx_rx/base.rb:52:in handshake': Dino::BoardNotFound (Dino::BoardNotFound) from /home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/tx_rx/serial.rb:23:inhandshake'
from /home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/board.rb:13:in handshake' from /home/toshiba/.rvm/gems/ruby-2.1.1/gems/dino-0.11.2/lib/dino/board.rb:9:ininitialize'
from dino.rb:9:in new' from dino.rb:9:in

'

If I change back the baudrate 115200 to all setting.. work fine (after remove the require 'serialport' (make mistake i think).. I might like to change different baudrate higher that 9600 ..I havent sleep for 24 hours learningg Ruby!!

Dear Mr Vickash

The program works at baudrate 38400 , 57600.. I guess it will also works at higher baudrate
Anyway.. I thank you very much for helping me

Sorry. There was a mistake in my code above. Forgot a ")" at the end.

It should be:

board = Dino::Board.new(Dino::TxRx::Serial.new(baud: 9600))

If you got it to work at higher rates, I guess you figured that out eventually.

Another thing you can try is using the 0.12-wip branch. You will need to know a little about git and Ruby's gem command to get it going. Because it isn't released yet, you can't use gem install, but google for "build gem from source" and you should be able to figure it out.

It uses a much better serial library. That may work at 9600. I've never tested at 9600 to be honest.