Connecting to HyperTerminal

Discussion in 'Ruby' started by Active View, Feb 18, 2008.

  1. Active View

    Active View Guest

    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.
     
    Active View, Feb 18, 2008
    #1
    1. Advertisements

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

    martin
     
    Martin DeMello, Feb 18, 2008
    #2
    1. Advertisements

  3. 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
     
    Ben Bleything, Feb 18, 2008
    #3
  4. Active View

    Jano Svitok Guest

    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).
     
    Jano Svitok, Feb 18, 2008
    #4
  5. Active View

    Todd Benson Guest

    I've used ruby-serialport with success talking to a GPS...

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

    Todd
     
    Todd Benson, Feb 18, 2008
    #5
  6. 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/
    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
     
    Ben Bleything, Feb 18, 2008
    #6
  7. Active View

    Active View Guest

    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.
     
    Active View, Feb 19, 2008
    #7
  8. I don't know much about cygwin. Have you tried with the Ruby one-click
    installer?

    Ben
     
    Ben Bleything, Feb 19, 2008
    #8
  9. Active View

    Active View Guest

    Is there for MS? Hmm... I can't seem to find it... =[

    Thank you.
     
    Active View, Feb 19, 2008
    #9
  10. Ben Bleything, Feb 19, 2008
    #10
  11. Active View

    Active View Guest

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

    Thank you.
     
    Active View, Feb 19, 2008
    #11
  12. 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 Bleything, Feb 19, 2008
    #12
  13. Active View

    Active View Guest

    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.
     
    Active View, Feb 19, 2008
    #13
  14. 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


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

    Eli
     
    Eli Bendersky, Feb 19, 2008
    #14
  15. Active View

    Todd Benson Guest

    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
     
    Todd Benson, Feb 20, 2008
    #15
  16. Active View

    James Tucker Guest


    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.
     
    James Tucker, Feb 21, 2008
    #16
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.