Groups | Search | Server Info | Login | Register


Groups > comp.protocols.kermit.misc > #16

Re: Sending commands to serial port - question

From Christian Corti <use@reply.to>
Newsgroups comp.protocols.kermit.misc
Subject Re: Sending commands to serial port - question
Date 2011-11-02 18:15 +0100
Organization Kompetenzzentrum fyr Minimal- und Retrocomputing
Message-ID <qea8o8-117.ln1@news.online.de> (permalink)
References <b2118d91-abe7-4967-b026-42c421648141@h34g2000yqd.googlegroups.com>

Show all headers | View raw


Tom <tdenham735@gmail.com> wrote:
> I am running Ubuntu and trying to make a script to automate a way to
> send commands to a serial device.

> I need to toggle the device with ^S004AUX0 (off) and ^S004AUX1 (on).

> I'm able to connect like so:

> #!/usr/bin/kermit +

> set modem type Serial       ; There is no modem
> set line /dev/ttyUSB0         ; Specify device name
> set carrier-watch off           ; If DTR and CD are not cross-
> connected
> set speed 9600                 ; Or other desired speed
> set flow xon/xoff                ; If you can't use RTS/CTS
> set parity none                  ; (or "mark" or "space", if
> necessary)
> set stop-bits 1                   ; (rarely necessary)
> connect                            ; this is where I get lost on the
> automation and have to enter manual.

Hm, I'd use a totally different approach:

# stty -F /dev/ttyUSB0 ixon 9600 -parenb (only needed once after boot)
# echo -n "^S004AUX0" >/dev/ttyUSB0
or
# echo -n "^S004AUX1" >/dev/ttyUSB0

You can ommit the -n parameter if a CR after the command won't hurt.

Christian

Back to comp.protocols.kermit.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Sending commands to serial port - question Tom <tdenham735@gmail.com> - 2011-11-02 08:17 -0700
  Re: Sending commands to serial port - question Tom <tdenham735@gmail.com> - 2011-11-02 08:25 -0700
  Re: Sending commands to serial port - question pechter@pechter.dyndns.org (Bill Pechter) - 2011-11-02 17:38 +0000
  Re: Sending commands to serial port - question Christian Corti <use@reply.to> - 2011-11-02 18:15 +0100
  Re: Sending commands to serial port - question bonomi@host122.r-bonomi.com (Robert Bonomi) - 2011-11-03 04:28 -0500

csiph-web