Re: RS232 communication

Discussion in 'Java' started by bronby, Apr 14, 2005.

  1. bronby

    bronby Guest

    hey .. i'm a newbie in java...

    i just searched google about serial programming in java...
    i'm thinking if you could help me.
    i got a new programming assignment in communicating with serial ports...
    a handler that links a POS terminal with that of a bank equipment (pin
    pad) .. connected in serial port...

    could u help me?

    i usually program using databases, reports, maintenance and stuff usin
    other languages. but this one quite new to me even the concept of serial
    port stuff.


    can u give me idea on how to tackle this?
    or even just an introduction to serial programming in simple words ..
    hehe...

    i'm using jbuilder as IDE on LINUX..
    i think i successfuly installed java.comm already hehehe...


    hope u guys could really help me
    thanks.
     
    bronby, Apr 14, 2005
    #1
    1. Advertising

  2. bronby

    Betty Guest

    "bronby" <> wrote in message
    news:...
    > hey .. i'm a newbie in java...
    >
    > i just searched google about serial programming in java...
    > i'm thinking if you could help me.
    > i got a new programming assignment in communicating with serial ports...
    > a handler that links a POS terminal with that of a bank equipment (pin
    > pad) .. connected in serial port...
    >
    > could u help me?
    >
    > i usually program using databases, reports, maintenance and stuff usin
    > other languages. but this one quite new to me even the concept of serial
    > port stuff.
    >
    >
    > can u give me idea on how to tackle this?
    > or even just an introduction to serial programming in simple words ..
    > hehe...
    >
    > i'm using jbuilder as IDE on LINUX..
    > i think i successfuly installed java.comm already hehehe...
    >
    >
    > hope u guys could really help me
    > thanks.
    >


    I have not tried this sort of thing yet, but I think you have
    a fun time ahead. Much more so than just reports etc.
     
    Betty, Apr 14, 2005
    #2
    1. Advertising

  3. bronby

    James Korman Guest

    On Wed, 13 Apr 2005 21:27:23 -0400, "bronby" <>
    wrote:

    >hey .. i'm a newbie in java...
    >
    >i just searched google about serial programming in java...
    >i'm thinking if you could help me.
    >i got a new programming assignment in communicating with serial ports...
    >a handler that links a POS terminal with that of a bank equipment (pin
    >pad) .. connected in serial port...
    >
    >could u help me?
    >
    >i usually program using databases, reports, maintenance and stuff usin
    >other languages. but this one quite new to me even the concept of serial
    >port stuff.
    >
    >
    >can u give me idea on how to tackle this?
    >or even just an introduction to serial programming in simple words ..
    >hehe...
    >
    >i'm using jbuilder as IDE on LINUX..
    >i think i successfuly installed java.comm already hehehe...
    >
    >
    >hope u guys could really help me
    >thanks.
    >


    First thing if you haven't is download the commapi stuff

    http://java.sun.com/products/javacomm/downloads/index.html


    There are several good example programs in the demos.

    The Linux support however doesn't seem to be all that great.

    Another api

    http://www.sc-systems.com/products/serialport/serialport.htm

    is commerical, I haven't tried it, but it looks pretty good.

    Jim
     
    James Korman, Apr 14, 2005
    #3
  4. bronby wrote:
    > hey .. i'm a newbie in java...
    >
    > i just searched google about serial programming in java...
    > i'm thinking if you could help me.
    > i got a new programming assignment in communicating with serial ports...
    > a handler that links a POS terminal with that of a bank equipment (pin
    > pad) .. connected in serial port...
    >
    > could u help me?
    >
    > i usually program using databases, reports, maintenance and stuff usin
    > other languages. but this one quite new to me even the concept of serial
    > port stuff.
    >
    >
    > can u give me idea on how to tackle this?
    > or even just an introduction to serial programming in simple words ..
    > hehe...
    >
    > i'm using jbuilder as IDE on LINUX..
    > i think i successfuly installed java.comm already hehehe...
    >
    >
    > hope u guys could really help me
    > thanks.
    >
    >


    I make only one suggestion, consider using an IP to serial conversion
    adapter and use Java socket classes. Devices such as these are widely
    available, many for low cost. One example is the following.

    http://www.taltech.com/products/tcpcom.html

    IMHO serial communications is a dying art out side of device micro code,
    and while your are in Linux today, implementing with Java sockets will
    open new sales opportunities.

    Joseph
     
    Joseph Dionne, Apr 14, 2005
    #4
  5. bronby

    bronby Guest

    oh thanks... i've just downloaded java commm stuff ... i've tried running
    this serialTest java program
    it's "serial programming in java"
    http://stage.itp.tsoa.nyu.edu/~dano/cgi/wiki.cgi?Connections

    there's no syntax error but a run time error message


    =========================
    <begin of error msg>

    54 1108548444
    RXTX WARNING: This library requires the user running applications to be
    in
    group uucp. Please consult the INSTALL documentation. More information
    is
    avaiable under the topic 'How can I use Lock Files with rxtx?'
    check_lock_status: No permission to create lock file.
    please see: How can I use Lock Files with rxtx? in INSTALL

    <end of error runtime error msg>
    =============


    ANYONE ENCOUNTERED THIS?
    AND HOW WILL I FIX IT ?.. THANKS
     
    bronby, Apr 20, 2005
    #5
  6. bronby wrote:
    > =========================
    > <begin of error msg>
    >
    > 54 1108548444
    > RXTX WARNING: This library requires the user running applications to be
    > in
    > group uucp. Please consult the INSTALL documentation. More information
    > is
    > avaiable under the topic 'How can I use Lock Files with rxtx?'
    > check_lock_status: No permission to create lock file.
    > please see: How can I use Lock Files with rxtx? in INSTALL
    >
    > <end of error runtime error msg>
    > =============
    >
    >
    > ANYONE ENCOUNTERED THIS?
    > AND HOW WILL I FIX IT ?.. THANKS


    Please don't shout. This is considered rude on Usenet. Instead, please
    read the error message again, an do what it tells you. Particular the
    part telling you:

    > This library requires the user running applications to be in group uucp.



    /Thomas




    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
     
    Thomas Weidenfeller, Apr 20, 2005
    #6
  7. bronby

    bronby Guest

    oops!
    my apologies sir.

    user is already in group uucp :(
    can't also find install doc. it was referring to...
     
    bronby, Apr 20, 2005
    #7
  8. bronby

    bronby Guest

    oops!
    my apologies sir.

    user is already in group uucp :(
    can't also find install doc. it was referring to...
     
    bronby, Apr 20, 2005
    #8
  9. bronby

    JScoobyCed Guest

    bronby wrote:
    > oops!
    > my apologies sir.
    >
    > user is already in group uucp :(
    > can't also find install doc. it was referring to...
    >
    >
    >
    >


    Download an older version of the lib, and the INSTALL file contains a
    section:
    T. How can I use Lock Files with rxtx?

    Redhat users. Note that Redhat changed group uucp to group lock with
    Redhat 7.2.

    Mandrake users. Note that /var/lock needs to be group uucp for this to
    work.

    Mac OS X users. Note that you may need to create the lock directory
    with group uucp ownership.

    RXTX uses lock files by default. configure --disable-lockfiles to
    generate rxtx libraries without lock files. Its strongly recommended
    that you do use lock files to prevent rxtx from stomping on other
    programs using serial ports.

    Lock files are used to prevent more than one program accessing a port at
    a time. Lock files require a bit of sysadmin to work properly..

    Rxtx has support for lock files on Linux only. It may work on other
    platforms but read the source before blindly trying it.

    Before you use lock files you need to do one of two things:

    1. Be the root or uucp user on your machine whenever you use rxtx
    2. add the specific user that needs to use rxtx to the group uucp.
    (preferred)

    To add a user to the uucp group edit /etc/group as root and change the
    following:
    uucp::14:uucp
    to something like:
    uucp::14:uucp,jarvi
    In this case jarvi is the login name for the user that needs to use lock
    files.
    Do not change the number (14). Whatever is in your group file is correct.

    User jarvi in this case can now use rxtx with lock files.

    The lock file code does not support kermit style lock files or lock files in
    /var/spool. Its sure to fail if you're using subdirectories in /dev or
    do not have /dev.

    Still cant get things to run under a root account?

    Vadim Tkachenko writes:

    "Maybe you remember - couple of months back I've run into inability to
    run the JDK 1.3+ from under root account. Today, absolutely suddenly,
    something clicked in my head and the cause was found: libsafe. To make
    JDK work, it is enough to disable libsafe (unset LD_PRELOAD)."

    As another option it is possible to use a Lock File Server. In this
    case, a server runs in group uucp or lock and rxtx then connects to
    localhost to lock and unlock the port. The server and install
    instructions can be found in src/lfd. RXTX will need to be configured
    to use the server:
    configure --enable-lockfile_server

    Any user can then lock the ports if they are not already locked.




    Good luck

    ---
    JSC
     
    JScoobyCed, Apr 21, 2005
    #9
  10. bronby

    bronby Guest

    It worked JScooby!!!! ...

    Thanks everyone! ...

    hmmnn.. someone told me like Joseph has mentioned to use java sockets...?
    is that the same with that one program i tested ?
     
    bronby, Apr 22, 2005
    #10
  11. bronby

    bronby Guest

    hi joseph...

    forgive me sir but i'm really new in this pinpad device interfacing and
    with java too .

    do u have any suggestion that i can read or further explore on it? a
    simple program maybe or share a concept on this type of communication.?
    thanx
     
    bronby, May 17, 2005
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnaud
    Replies:
    1
    Views:
    1,359
    Jonathan Bromley
    Mar 1, 2004
  2. fpgawizz
    Replies:
    5
    Views:
    4,298
    dutchgoldtony
    Mar 14, 2005
  3. Tjodleik
    Replies:
    1
    Views:
    671
    Bjoern
    Oct 23, 2003
  4. deena102

    RS232 Communication problem

    deena102, Apr 12, 2009, in forum: VHDL
    Replies:
    0
    Views:
    521
    deena102
    Apr 12, 2009
  5. faleni
    Replies:
    0
    Views:
    1,882
    faleni
    Apr 20, 2010
Loading...

Share This Page