From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 61ABA138247 for ; Mon, 13 Oct 2014 01:37:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A915E08AF; Mon, 13 Oct 2014 01:37:38 +0000 (UTC) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 29AE1E0807 for ; Mon, 13 Oct 2014 01:37:36 +0000 (UTC) Received: by mail-oi0-f48.google.com with SMTP id g201so11746075oib.21 for ; Sun, 12 Oct 2014 18:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=1qv2Cr3f6kM/d5+8uHrAa9rTgL3t8rYo5a7JC+4csgk=; b=SOiQN4PM/AKnmL+Kr+TYgZCQMb3qvGrVs4rNLiX2oV6Hkcbui8ZzdWWmCAZUBjj9u+ cTrTiZqthl4zgb+8BLJnSPsPcuNmKjuJ3qzs1b+OM8LtNCQ5djAmARSj/GoTF/iZc/FB 21P0sxTo61Ce0ZEWTx/DETri5RmfL4H3d/MiUC0AwsuJyYbhs5+poeGe2v0ts/s3+qCI p0kGXmEahqTOC6Q+5OFX53RiOHe2/tfD1yvc9aQhfiqtP98DmX8gBMle86H1Ss8BIZEk gOx2ALrRjGsS+36HKn7D4W5aAgr1D4n2AbWYVpWtlEP9c5QjbupVPu78HkFtzhiyaWEo 71ww== X-Received: by 10.60.35.9 with SMTP id d9mr5353625oej.27.1413164256113; Sun, 12 Oct 2014 18:37:36 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.60.52.176 with HTTP; Sun, 12 Oct 2014 18:36:55 -0700 (PDT) In-Reply-To: <4098449.4hDUJObNF8@bluering> References: <20141012120802.GA4800@solfire> <543AA15E.6090805@fastmail.co.uk> <4098449.4hDUJObNF8@bluering> From: Francisco Ares Date: Sun, 12 Oct 2014 22:36:55 -0300 Message-ID: Subject: Re: [gentoo-user] Writing to tty01 (serial port) in simple straight forward way...?!? To: gentoo-user Content-Type: multipart/alternative; boundary=089e01227fe27ebc11050543f133 X-Archives-Salt: e844629a-2c07-467b-b1b9-591141bf0c92 X-Archives-Hash: eb9548e2f71dfb4c1e68dd84bd5fa6c0 --089e01227fe27ebc11050543f133 Content-Type: text/plain; charset=UTF-8 2014-10-12 19:22 GMT-03:00 Paul Colquhoun : > On Sun, 12 Oct 2014 16:42:22 Kerin Millar wrote: > > > On 12/10/2014 13:08, meino.cramer@gmx.de wrote: > > > > Hi, > > > > > > > > I want to send commands to ttyO1 (serial port on an embedded system). > > > > The commands are one line each and terminated with CRL/LF (aka "DOS"). > > > > > > > > Since this will be done from a batch script, it should be possible > > > > via commandline tools and non-interactively. The serial port is > > > > already setup up the right way. > > > > > > > > I tried > > > > > > > > echo -n"blablabal\x0a\x0d" > > > > > > Firstly, this command is missing the -e switch. Secondly, the order of > > > the control characters is wrong. I would suggest the use of printf as it > > > has fewer pitfalls. > > > > > > # printf '%s\r\n' "command" > > > > > > --Kerin > > > > > > Also, are you sure that the standard output of the script is connected to > the serial port? Try adding "> /dev/tty01" to the end of the echo/printf > command lines and see if that helps. > > > > > > -- > > Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/ > > Asking for technical help in newsgroups? Read this first: > > http://catb.org/~esr/faqs/smart-questions.html#intro > > > Or, perhaps, /dev/ttyS0 , or even /dev/ttyUSB0, if it is connected through a USB to serial adapter. By using this approach, you might be able to send a command, but most probably (never tried) will not be able to receive the device's reply. Try minicom, a simple text serial console. Good luck Francisco --089e01227fe27ebc11050543f133 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2014-10-12 19:22 GMT-03:00 Paul Colquhoun <paulcol@andor.dr= opbear.id.au>:

On Sun, 12 Oct 2014 16:42:22 Kerin = Millar wrote:

> On 12/10/2014 13:08, meino.cramer@gmx.de w= rote:

> > Hi,

> >

> > I want to send commands t= o ttyO1 (serial port on an embedded system).

> > The commands are one line= each and terminated with CRL/LF (aka "DOS").

> >

> > Since this will be done f= rom a batch script, it should be possible

> > via commandline tools and= non-interactively. The serial port is

> > already setup up the righ= t way.

> >

> > I tried

> >

> > echo -n"blablabal\x0= a\x0d"

>

> Firstly, this command is missi= ng the -e switch. Secondly, the order of

> the control characters is wron= g. I would suggest the use of printf as it

> has fewer pitfalls.

>

> # printf '%s\r\n' &quo= t;command"

>

> --Kerin

=C2=A0

=C2=A0

Also, are you sure that= the standard output of the script is connected to the serial port? Try add= ing "> /dev/tty01" to the end of the echo/printf command lines= and see if that helps.

=C2=A0

=C2=A0

--

Reverend Paul Colquhoun, ULC. <= a href=3D"http://andor.dropbear.id.au/" target=3D"_blank">http://andor.drop= bear.id.au/

Asking for technical help in news= groups? Read this first:

http://catb.org/~esr/f= aqs/smart-questions.html#intro

=C2=A0

=
Or, perhaps, /dev/ttyS0 , or even /dev/ttyUSB0, if it is connected thro= ugh a USB to serial adapter.

By usi= ng this approach, you might be able to send a command, but most probably (n= ever tried) will not be able to receive the device's reply.

Try minicom, a simple text serial console.
=

Good = luck
Francisco

--089e01227fe27ebc11050543f133--