Connecting to HyperTerminal

Hi all…

I am doing a project using Ruby. It is a SMS to Email sort of thing.
Hence, I need to know if it is possible to connect to Hyperterminal
using Ruby. If it is, how?

I have already completed most of the stuff using scripting on
Hyperterminal. So, suggestions not to use Hyperterminal may not be a
good one.

Will appreciate if anyone here can help.

Thank you.

On Feb 18, 2008 9:27 AM, Active V. [email protected] wrote:

Hi all…

I am doing a project using Ruby. It is a SMS to Email sort of thing.
Hence, I need to know if it is possible to connect to Hyperterminal
using Ruby. If it is, how?

Does hyperterminal export a COM interface? Ruby can automate that
fairly effortlessly.

martin

On Tue, Feb 19, 2008, Active V. wrote:

I have already completed most of the stuff using scripting on
Hyperterminal. So, suggestions not to use Hyperterminal may not be a
good one.

You can talk directly to a serial port using Ruby… I understand that
you’ve already written scripts for HT, but is there any compelling
technical reason for using those? I think you’ll have less pain porting
your scripts to Ruby than trying to interact with HT.

Ben

On Feb 18, 2008 1:32 PM, Jano S. [email protected] wrote:

Thanks.
I’ve used ruby-serialport with success talking to a GPS…

http://rubyforge.org/projects/ruby-serialport/

Todd

On Feb 18, 2008 8:21 PM, Ben B. [email protected] wrote:

You can talk directly to a serial port using Ruby… I understand that
you’ve already written scripts for HT, but is there any compelling
technical reason for using those? I think you’ll have less pain porting
your scripts to Ruby than trying to interact with HT.

Can you recommend good (working) free serial comm lib for ruby that
works on windows?
Last time I checked I could find only commercial ones.

Thanks.

And to not totally hijack this thread: I agree that rewriting could be
better that working with HT.
However, if OP wants to go this way and everything else fails,
AutoIt might be the way - there’s a dll
that you can call from ruby (the cons are: too much work, too many
layers/wrappers).

On Tue, Feb 19, 2008, Jano S. wrote:

Can you recommend good (working) free serial comm lib for ruby that
works on windows?
Last time I checked I could find only commercial ones.

ruby-serialport works in Windows as far as I know. They list it as a
feature at any rate! :smiley:

http://ruby-serialport.rubyforge.org/

And to not totally hijack this thread: I agree that rewriting could be
better that working with HT.
However, if OP wants to go this way and everything else fails,
AutoIt might be the way - there’s a dll
that you can call from ruby (the cons are: too much work, too many
layers/wrappers).

ooo interesting. I’m basically completely ignorant of the Windows world
these days… I only use it when I’m programming microcontrollers with
the serial port :slight_smile: As it happens, Hyperterminal is about the only app I
use.

Ben

I don’t know much about cygwin. Have you tried with the Ruby one-click
installer?

Ben

Hey people…

Thank you real lots for the replies… I am figuring out on how to use
the ruby-serial… Tried compiling it using Cygwin… But it seems to
have problem with the make file. Makefile:106 target pattern contains no
‘%’. Stop. Any idea what causes this problem?? I am seriously new to
this. So if I am asking some not-so-intelligent questions, my apologies.

Thank you once again.

Ben B. wrote:

I don’t know much about cygwin. Have you tried with the Ruby one-click
installer?

Ben

Is there for MS? Hmm… I can’t seem to find it… =[

Thank you.

On Wed, Feb 20, 2008, Active V. wrote:

Is there for MS? Hmm… I can’t seem to find it… =[

Did you try google?

http://www.google.com/search?q=ruby+one-click+installer

first hit.

:slight_smile:

Ben B. wrote:

On Wed, Feb 20, 2008, Active V. wrote:

Is there for MS? Hmm… I can’t seem to find it… =[

Did you try google?

ruby one-click installer - Google Search

first hit.

:slight_smile:

Hmm… Thanks… I thought that was an overall installer for Ruby?? Or
was it an installation file with all the libraries in?

Thank you.

On Wed, Feb 20, 2008, Active V. wrote:

Hmm… Thanks… I thought that was an overall installer for Ruby?? Or
was it an installation file with all the libraries in?

It is an installer for Ruby. What I’m suggesting is that instead of
using cygwin, which is an overly complex mess, use the OCI instead.
Install Ruby using the OCI and then install ruby-serialport.

Ben

Ben B. wrote:

On Wed, Feb 20, 2008, Active V. wrote:

Hmm… Thanks… I thought that was an overall installer for Ruby?? Or
was it an installation file with all the libraries in?

It is an installer for Ruby. What I’m suggesting is that instead of
using cygwin, which is an overly complex mess, use the OCI instead.
Install Ruby using the OCI and then install ruby-serialport.

Ben

Hmm… I already have Ruby installed in my computer and it was done
using the OCI. So now I only need to install the serialport libraries
and it is giving me real lot of headaches… =[

Thank you.

On Feb 18, 7:27 pm, Active V. [email protected] wrote:

Will appreciate if anyone here can help.

I just want to provide an alternative to the Ruby module.

I work a lot with the serial port, including from Perl. After a lot of
bloody battles trying to install and then use Perl’s libraries for the
serial port(*) I solved the problem in a completely different way.
I’ve implemented a bi-directional serial2socket bridge as a smallish C+

  • executable (about 100KB in size). This, along with a simple Perl
    module that uses the preinstalled libs to talk with it using a socket,
    allows me to comfortably control the port with Perl. It should be
    similarly simple with Ruby. You can download it here:

http://eli.thegreenplace.net/files/prog_code/perl_serial_comm.zip

If there are any questions, don’t hesitate to ask me at
[email protected]

(*) Perl actually has a library that installs on Windows, but it’s
pretty bad, buggy and very poorly documented.

Eli

On Feb 19, 2008 10:52 AM, Active V. [email protected] wrote:

Ben

Hmm… I already have Ruby installed in my computer and it was done
using the OCI. So now I only need to install the serialport libraries
and it is giving me real lot of headaches… =[

Thank you.

I’ve only worked with the serial port on *nixes, but doing a little
googling, there’s also

http://grub.ath.cx/win32serial/

a conversation about which you can find at

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/235343

hth,
Todd

On 20 Feb 2008, at 19:48, Todd B. wrote:

Install Ruby using the OCI and then install ruby-serialport.
I’ve only worked with the serial port on *nixes, but doing a little
googling, there’s also

http://grub.ath.cx/win32serial/

a conversation about wh

We’ve got a couple of production apps (sold to real customers) using
parsing data from serial ports using ruby.

The solutions work great on several platforms, but there are no non-
GPL’d implementations that I have ever been able to find. To date,
ruby-serialport requires some patches in order to build and run (in
the very least the patch that opens up .create).

The win32 specific lib was never really much interest to me as we are
supporting *nix and win32, and ideally I wanted a well abstracted
solution.

So I wrote two libs, one in ruby-termios (for *nix) and one using the
win32api, or more specifically using the overlapped IO interfaces, and
SetCommState.

Someone recently attached ruby-serialport to eventmachine, and I had
been thinking about making a GPL serial-port proxy server, but at this
point in time I am not aware of enough demand to make such a project
at all worth doing. The ruby-serialport lib is also in need of some
maintenance, as I mentioned earlier.

I recently connected my own serial port abstractions to eventmachine a
wholly different way, using a timer to poll at a relatively low speed
(after all, 9600 baud is nothing these days), as I couldn’t get the
overalapped IO implementation to work with the reactor core select loop.

As far as connecting to Hyperterminal is concerned, you can easily
connect back to yourself if you have two serial ports. I used Virtual
Serial Port Kit on win32 for a lot of our testing however, as I can do
things like breach the baud rate for running long-running tests in a
reasonable time frame. This obviously involves building a mock replica
of your hardware, in software however.