OpenScale
OpenScale copied to clipboard
Using Ruby 'rubyserial' or 'serialport' gems to read data
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 - 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 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.