pyserial: Unexpected Local Echo

Discussion in 'Python' started by Steven Woody, Jan 11, 2010.

  1. Steven Woody

    Steven Woody Guest

    Hi,

    I am using pyserial. But I always get the local echo after I write
    some characters onto serial port and I find no way to disable this
    behavior. When I say 'local echo', I mean the next read operation will
    get characters that was just write to the same port.

    I run my program on cygwin (pyserial was also built on the system from
    source code) and the serial port i am using is a USB adapter that
    simulates a port (COM4 on my XP) because my laptop don't have a real
    serial port. But I checked my COM4 settings, there is no any think
    like 'local echo'.


    Thanks in advance.

    --
    Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

    narke
    public key at http://subkeys.pgp.net:11371 ()
     
    Steven Woody, Jan 11, 2010
    #1
    1. Advertising

  2. Steven Woody

    Nobody Guest

    On Mon, 11 Jan 2010 23:27:03 +0800, Steven Woody wrote:

    > I am using pyserial. But I always get the local echo after I write
    > some characters onto serial port and I find no way to disable this
    > behavior. When I say 'local echo', I mean the next read operation will
    > get characters that was just write to the same port.


    That explains the "echo" part. What makes you think that it's local?
     
    Nobody, Jan 11, 2010
    #2
    1. Advertising

  3. On 2010-01-11, Steven Woody <> wrote:

    > I am using pyserial. But I always get the local echo after I
    > write some characters onto serial port


    I really doubt you're getting a local echo. Is the data coming
    out the serial port? Do you get the echo if you disconnect the
    serial cable?

    > and I find no way to disable this behavior. When I say 'local
    > echo', I mean the next read operation will get characters that
    > was just write to the same port.


    The device to which you're connected is echoing them. There's
    also a chance that your rxd line is floating and there's enough
    crosstalk in the cable to "echo" the data, but I'll bet money
    it's not being done locally (in the serial driver or port).

    > I run my program on cygwin (pyserial was also built on the
    > system from source code) and the serial port i am using is a
    > USB adapter that simulates a port (COM4 on my XP) because my
    > laptop don't have a real serial port. But I checked my COM4
    > settings, there is no any think like 'local echo'.


    --
    Grant Edwards grante Yow! Will it improve my
    at CASH FLOW?
    visi.com
     
    Grant Edwards, Jan 11, 2010
    #3
  4. Steven Woody

    John Nagle Guest

    Grant Edwards wrote:
    > On 2010-01-11, Steven Woody <> wrote:
    >
    >> I am using pyserial. But I always get the local echo after I
    >> write some characters onto serial port

    >
    > I really doubt you're getting a local echo. Is the data coming
    > out the serial port? Do you get the echo if you disconnect the
    > serial cable?
    >
    >> and I find no way to disable this behavior. When I say 'local
    >> echo', I mean the next read operation will get characters that
    >> was just write to the same port.

    >
    > The device to which you're connected is echoing them. There's
    > also a chance that your rxd line is floating and there's enough
    > crosstalk in the cable to "echo" the data, but I'll bet money
    > it's not being done locally (in the serial driver or port).
    >
    >> I run my program on cygwin (pyserial was also built on the
    >> system from source code) and the serial port i am using is a
    >> USB adapter that simulates a port (COM4 on my XP) because my
    >> laptop don't have a real serial port. But I checked my COM4
    >> settings, there is no any think like 'local echo'.


    You're using what? Some version of Python built on Cygwin
    running on a Windows XP system? What if you just run a stock
    Python built for Windows on Windows XP? Or run Linux? That
    half-and-half environment may not work right. pyserial has
    special cases in it for Windows and Linux, and it's not
    clear what it will do on Cygwin.

    That said, if you're getting echo from output back to input,
    I'd look at the USB to serial device. I've used devices with
    the Silicon Laboratories CP2102 part, and they work fine.
    ("http://www.aetherltd.com/connectingusb.html")

    Do you have something plugged into the serial port? If
    so, what?

    John Nagle
     
    John Nagle, Jan 15, 2010
    #4
  5. Steven Woody

    Steven Woody Guest

    2010/1/16 John Nagle <>:
    > Grant Edwards wrote:
    >>
    >> On 2010-01-11, Steven Woody <> wrote:
    >>
    >>> I am using pyserial.  But I always get the local echo after I
    >>> write some characters onto serial port

    >>
    >> I really doubt you're getting a local echo.  Is the data coming
    >> out the serial port?  Do you get the echo if you disconnect the
    >> serial cable?
    >>
    >>> and I find no way to disable this behavior. When I say 'local
    >>> echo', I mean the next read operation will get characters that
    >>> was just write to the same port.

    >>
    >> The device to which you're connected is echoing them.  There's
    >> also a chance that your rxd line is floating and there's enough
    >> crosstalk in the cable to "echo" the data, but I'll bet money
    >> it's not being done locally (in the serial driver or port).
    >>
    >>> I run my program on cygwin (pyserial was also built on the
    >>> system from source code) and the serial port i am using is a
    >>> USB adapter that simulates a port (COM4 on my XP) because my
    >>> laptop don't have a real serial port.  But I checked my COM4
    >>> settings, there is no any think like 'local echo'.

    >
    >    You're using what?  Some version of Python built on Cygwin
    > running on a Windows XP system?   What if you just run a stock
    > Python built for Windows on Windows XP?  Or run Linux?  That
    > half-and-half environment may not work right.  pyserial has
    > special cases in it for Windows and Linux, and it's not
    > clear what it will do on Cygwin.
    >
    >    That said, if you're getting echo from output back to input,
    > I'd look at the USB to serial device.  I've used devices with
    > the Silicon Laboratories CP2102 part, and they work fine.
    > ("http://www.aetherltd.com/connectingusb.html")
    >
    >    Do you have something plugged into the serial port?  If
    > so, what?
    >
    >                                John Nagle
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >


    Now I tried run the same test code using pure Windows python +
    pyserial, the result is same.

    Actually, the USB device is a optic head, that read data from an
    electric energy meter:

    PC USB Port -> Optic Head -> Meter

    I get the echo even when the meter itself is disconnected, that mean
    the echo is not generated by firmware inside the meter. So, if the
    echo is also not generated from my PC, that much be from the optic
    head itself. Is it possible?

    Regards,
    woody

    --
    Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

    narke
    public key at http://subkeys.pgp.net:11371 ()
     
    Steven Woody, Jan 17, 2010
    #5
  6. Steven Woody

    Steve Holden Guest

    Steven Woody wrote:
    > 2010/1/16 John Nagle <>:
    >> Grant Edwards wrote:
    >>> On 2010-01-11, Steven Woody <> wrote:
    >>>
    >>>> I am using pyserial. But I always get the local echo after I
    >>>> write some characters onto serial port
    >>> I really doubt you're getting a local echo. Is the data coming
    >>> out the serial port? Do you get the echo if you disconnect the
    >>> serial cable?
    >>>
    >>>> and I find no way to disable this behavior. When I say 'local
    >>>> echo', I mean the next read operation will get characters that
    >>>> was just write to the same port.
    >>> The device to which you're connected is echoing them. There's
    >>> also a chance that your rxd line is floating and there's enough
    >>> crosstalk in the cable to "echo" the data, but I'll bet money
    >>> it's not being done locally (in the serial driver or port).
    >>>
    >>>> I run my program on cygwin (pyserial was also built on the
    >>>> system from source code) and the serial port i am using is a
    >>>> USB adapter that simulates a port (COM4 on my XP) because my
    >>>> laptop don't have a real serial port. But I checked my COM4
    >>>> settings, there is no any think like 'local echo'.

    >> You're using what? Some version of Python built on Cygwin
    >> running on a Windows XP system? What if you just run a stock
    >> Python built for Windows on Windows XP? Or run Linux? That
    >> half-and-half environment may not work right. pyserial has
    >> special cases in it for Windows and Linux, and it's not
    >> clear what it will do on Cygwin.
    >>
    >> That said, if you're getting echo from output back to input,
    >> I'd look at the USB to serial device. I've used devices with
    >> the Silicon Laboratories CP2102 part, and they work fine.
    >> ("http://www.aetherltd.com/connectingusb.html")
    >>
    >> Do you have something plugged into the serial port? If
    >> so, what?
    >>
    >> John Nagle
    >> --
    >> http://mail.python.org/mailman/listinfo/python-list
    >>

    >
    > Now I tried run the same test code using pure Windows python +
    > pyserial, the result is same.
    >
    > Actually, the USB device is a optic head, that read data from an
    > electric energy meter:
    >
    > PC USB Port -> Optic Head -> Meter
    >
    > I get the echo even when the meter itself is disconnected, that mean
    > the echo is not generated by firmware inside the meter. So, if the
    > echo is also not generated from my PC, that much be from the optic
    > head itself. Is it possible?
    >
    > Regards,
    > woody
    >

    Of course this echo is good, as it allows you to verify that your
    transmission has been received ... somewhere ...

    regards
    Steve

    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
    Holden Web LLC http://www.holdenweb.com/
    UPCOMING EVENTS: http://holdenweb.eventbrite.com/
     
    Steve Holden, Jan 18, 2010
    #6
    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. Leszek Dubiel
    Replies:
    3
    Views:
    9,878
  2. Guest

    echo user input

    Guest, May 26, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    480
    William F. Robertson, Jr.
    May 27, 2005
  3. =?Utf-8?B?Q3JhaWc=?=

    echo for a session variable

    =?Utf-8?B?Q3JhaWc=?=, Aug 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    361
  4. Josef Garvi

    Re: echo servers

    Josef Garvi, Aug 3, 2003, in forum: Java
    Replies:
    0
    Views:
    410
    Josef Garvi
    Aug 3, 2003
  5. John Nagle
    Replies:
    1
    Views:
    2,148
    John Nagle
    Feb 22, 2009
Loading...

Share This Page