Forum: Ruby Cant connect to serial port

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
William V. (Guest)
on 2016-12-26 19:33
I have a A/D converter board attached to a serial port that I access
though Ruby. The problem is that the program won't connect to the serial
port unless I first connect to the port using Putty. I'd like to resolve
this issue so I can run the program automatically after a reboot. It
hangs when .new is called. I think it has to do with the flow control -
it needs to be None but I don't see a way of setting that before calling

Also is there a way to programmically determine the COM port? I was COM3
and then suddenly changed to COM4.

The relevant code section is:

parameters = { "baud"=>9600,

com = 3
sp =, parameters)
sp.flow_control = SerialPort::NONE
This topic is locked and can not be replied to.