Need assistance with serial port communications in Ruby

陌路散爱 提交于 2019-12-04 09:39:11

The serial port specification has not changed in forever, I wouldn't worry about how old the libraries are.

I'm assuming you saw this article from 2006 about ruby and serial ports

Here's someone who got the Ruby-SerialPort library mentioned there to work on macs this year.

There's also this old post from ruby talk, about interfacing to the Win32 Serial API.

Just because searching for ruby-serialport will lead you sometimes here:

toholio's github repo no longer seems to be active (as of 09/2010). The published gem comes from

http://github.com/hparra/ruby-serialport

While the serial standard has not changed, the way Ruby Gems interact with Ruby C extensions changed enough over the years so that the RubyForge serial port extension would not play well. There have been some patches over the years on RubyForge to fix that, but it hasn't been pretty. The great news is that Github has allowed an incredible acceleration in the activity to clean up the Ruby serial port extension. At least three different people are cross-branching their serial port code on Github. You can search on Github, but I believe that Toholio has the latest code, which recodes and repackages the Ruby serial port as a Ruby Gem. (Yea!)

http://github.com/toholio/ruby-serialport/tree/master

It works great for me on Linux, solving the earlier conflict with the latest Ruby Gems release. On Windows, I'm still having a problem getting it working. Compiling Ruby extensions on Windows is never very easy, but that is a whole 'nuther can of worms. I'm just happy that people are working on the Ruby serial port support again. I've asked Toholio to generate a Windows binary gem, which would solve everyone's problems, and he says it's on his list to do.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!