Last Updated: February 25, 2016
·
1.044K
· dwilkins

Ruby-serialport on Fedora requires a baud change

When using Ruby-serialport on Fedora 18 Linux (and maybe others), you have to change the baud rate after you "open the file" to keep it from hanging up:

@@arduino = SerialPort.new("/dev/ttyUSB0", {baud: 300, databits: 8, stopbits: 1})
@@arduino.baud = 115200
@@arduino.flow_control = SerialPort::NONE
@@arduino.read_timeout = 50