# Experience with ruby on serialport

**URL:** <https://www.ruby-forum.com/t/experience-with-ruby-on-serialport/153246>\
**Category:** Ruby\
**Created:** [November 13, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/experience-with-ruby-on-serialport/153246 "2008-11-13T22:20:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Stefan\_E](https://www.ruby-forum.com/u/Stefan_E)\
**Post date:** [November 13, 2008, 10:20pm UTC](https://www.ruby-forum.com/t/experience-with-ruby-on-serialport/153246/1 "2008-11-13T22:20:27Z")

</div>

Hi,

i want to use [http://rubyforge.org/projects/ruby-serialport/](http://rubyforge.org/projects/ruby-serialport/) to  
communicate  
with /dev/ttyS0 (com1). Has anyone experience with this library or  
perhaps  
an example code?

Cheers,  
Stefan

---

<div class="post-metadata">

**Author:** ![Stefan\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Stefan\_E](https://www.ruby-forum.com/u/Stefan_E)\
**Post date:** [November 15, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/experience-with-ruby-on-serialport/153246/2 "2008-11-15T22:59:50Z")

</div>

Maybe this is useful?  
[http://www.computerkraft.com/wiki/index.php?title=Ruby/serial\_demo](http://www.computerkraft.com/wiki/index.php?title=Ruby/serial_demo)

Cheers  
Robert

---

<div class="post-metadata">

**Author:** ![Stefan\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@Stefan\_E](https://www.ruby-forum.com/u/Stefan_E)\
**Post date:** [November 17, 2008, 5:57am UTC](https://www.ruby-forum.com/t/experience-with-ruby-on-serialport/153246/3 "2008-11-17T05:57:45Z")

</div>

On Fri, Nov 14, 2008 at 5:17 AM, Stefan E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,
> 
> i want to use [http://rubyforge.org/projects/ruby-serialport/](http://rubyforge.org/projects/ruby-serialport/) to communicate  
> with /dev/ttyS0 (com1). Has anyone experience with this library or perhaps  
> an example code?

I actually used EventMachine and the Ruby-Serialport project you  
reference to do it:

[http://rubyforge.org/pipermail/eventmachine-talk/2008-January/001567.html](http://rubyforge.org/pipermail/eventmachine-talk/2008-January/001567.html)

The code snippet in that link only works with Eventmachine 0.10.x. I  
think the core changed in later versions. Using that code snippet, you  
can do event-driven programming on a serial port the way one would  
program a network client in EventMachine.
