Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using serialport prevents puts from writing to terminal? #67

Open
sjalloq opened this issue Mar 13, 2018 · 1 comment
Open

Using serialport prevents puts from writing to terminal? #67

sjalloq opened this issue Mar 13, 2018 · 1 comment

Comments

@sjalloq
Copy link

sjalloq commented Mar 13, 2018

Hi,

I've only just started playing with this but have been confused for an hour or so after trying to print debug information to the terminal I'm running my script from. When using any of the IO.read* methods, I don't get any output to my terminal when trying to print/puts.

I've setup a simple echo server with a virtual terminal and the script is working but fails to print anything to the terminal. What's going on?

require 'serialport'

NONE = 0

s = SerialPort.new(3,9600,8,1,NONE)

puts "Read timeout is set to '#{s.read_timeout}'"
puts "SerialPort params are: #{s.get_modem_params}"

while true do
  c = s.readline("\n")
  s.printf(c)
  puts c
end
@sjalloq
Copy link
Author

sjalloq commented Mar 14, 2018

So having tried this on OS X now, it seems to be an issue with using MSYS on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant