Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Sending commands to serial port - question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom  
View profile  
 More options Nov 2 2011, 11:17 am
Newsgroups: comp.protocols.kermit.misc
From: Tom <tdenham...@gmail.com>
Date: Wed, 2 Nov 2011 08:17:19 -0700 (PDT)
Local: Wed, Nov 2 2011 11:17 am
Subject: Sending commands to serial port - question
Hello,

I'm new to Kermit...this is my first very simple script.

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.

From here I can type ^S004AUX0 and toggle the device off (or on), but
would like to automate this part.  It's probably pretty simple for
anyone who's used kermit more than a day:)

Can this be automated in the kermit script?  If so...can someone show
an example?

Thanks in advance!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Nov 2 2011, 11:25 am
Newsgroups: comp.protocols.kermit.misc
From: Tom <tdenham...@gmail.com>
Date: Wed, 2 Nov 2011 08:25:38 -0700 (PDT)
Local: Wed, Nov 2 2011 11:25 am
Subject: Re: Sending commands to serial port - question
On Nov 2, 11:17 am, Tom <tdenham...@gmail.com> wrote:

Also...how would one exit the script after running.  Thanks.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Pechter  
View profile  
 More options Nov 2 2011, 1:38 pm
Newsgroups: comp.protocols.kermit.misc
From: pech...@pechter.dyndns.org (Bill Pechter)
Date: Wed, 2 Nov 2011 17:38:49 +0000 (UTC)
Local: Wed, Nov 2 2011 1:38 pm
Subject: Re: Sending commands to serial port - question
In article <b2118d91-abe7-4967-b026-42c421648...@h34g2000yqd.googlegroups.com>,

You may need to set flow to something other than xon/xoff. ^S is xoff.
So... when you send ^S (I assume it's control-s) and not Caret-S you
stop the data flow.

Bill

--
--
Digital had it then.  Don't you wish you could buy it now!
              pechter-at-pechter.dyndns.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Corti  
View profile  
 More options Nov 2 2011, 1:15 pm
Newsgroups: comp.protocols.kermit.misc
From: Christian Corti <u...@reply.to>
Date: Wed, 2 Nov 2011 18:15:38 +0100
Local: Wed, Nov 2 2011 1:15 pm
Subject: Re: Sending commands to serial port - question

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bonomi  
View profile  
 More options Nov 3 2011, 5:28 am
Newsgroups: comp.protocols.kermit.misc
From: bon...@host122.r-bonomi.com (Robert Bonomi)
Date: Thu, 03 Nov 2011 04:28:04 -0500
Local: Thurs, Nov 3 2011 5:28 am
Subject: Re: Sending commands to serial port - question
In article <b2118d91-abe7-4967-b026-42c421648...@h34g2000yqd.googlegroups.com>,

Trivially.

the secret is "do -not- use 'connect'".

At the kermit prompt, type "help output".

>                                             If so...can someone show
>an example?

kermit> output ^S004AUX0

Note: if '^S' is [CTRL-S], aka [XOFF], aka [DC3], you probably want
'set flow-control none' --  if that control-s is echoed back to the
port on the PC, kermit's xon/xoff flow-control support wills *STOP*
sending any further characters to the device until an XON/[CTRL-Q]/
[DC1] character is received from the other device.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »