1

Rubyでgem serialportを使用すると、エラーコードが表示されますEOFError: end of file reached

irb
2.0.0-p451 :001 > require 'serialport'
 => true 
2.0.0-p451 :002 > serial_port = SerialPort.new "/dev/ttyUSB0", 115200
 => #<SerialPort:fd 7> 
2.0.0-p451 :009 > serial_port.write "@00RD0000020054*\r"
 => 17 
2.0.0-p451 :010 > r = serial_port.readline("\r")
EOFError: end of file reached
    from (irb):10:in `readline'
    from (irb):10
    from /home/user/.rvm/rubies/ruby-2.0.0-p451/bin/irb:12:in `<main>'

なにか提案を?

4

2 に答える 2