OpenScale icon indicating copy to clipboard operation
OpenScale copied to clipboard

Using Ruby 'rubyserial' or 'serialport' gems to read data

Open asachs01 opened this issue 6 years ago • 2 comments

Has anyone used either of these gems to successfully read data from the board? I can get the data via the serial connection by itself, but can't seem to get either of the gems, or pyserial for that matter, to read the data produced by the board.

asachs01 avatar May 16 '18 21:05 asachs01

@asachs01 - Any luck? We're not really ruby folks. Let us know if you were able to hook in to the serial stream. It would be helpful to know for other users.

nseidle avatar Nov 06 '18 21:11 nseidle

@nseidle I did make some progress over the past couple months. What I have now that's sort of working is this:

  def initialize
    sp = Serial.new config[:port]
    sp.write("config[:writechar]")
    weight = sp.read(config[:readbytes]).split(',')
    if weight.nil?
      do weight
    else

    end
  end

It's not complete (this is part of a side project outside of $dayjob), but it gets close to working.

asachs01 avatar Nov 07 '18 03:11 asachs01