Connecting to HyperTerminal


A

Active View

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.
 
Ad

Advertisements

M

Martin DeMello

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
 
B

Ben Bleything

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
 
J

Jano Svitok

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).
 
B

Ben Bleything

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! :D

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 :) As it happens, Hyperterminal is about the only app I
use.

Ben
 
Ad

Advertisements

A

Active View

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.
 
B

Ben Bleything

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

Ben
 
A

Active View

Ben said:
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.
 
Ad

Advertisements

B

Ben Bleything

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
 
A

Active View

Ben said:
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.
 
E

Eli Bendersky

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.

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
(e-mail address removed)

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

Eli
 
T

Todd Benson

Ben said:
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.

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
 
Ad

Advertisements

J

James Tucker

Ben said:
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.

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.
 
Ad

Advertisements


Top