- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Automating I/O over a serial port
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 09:43 AM
07-23-2003 09:43 AM
I just bought a routing switch which is configured via text commands over a serial port. I am using cu to open the serial port and connect to the switch. Does anyone know of a utility which can batch up a set of commands and send them over the serial port to the switch. I'm trying to automate the switch setup, reduce workload on operators and eliminate typos and user errors. Thanx.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 09:53 AM
07-23-2003 09:53 AM
Re: Automating I/O over a serial port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:08 AM
07-23-2003 10:08 AM
Re: Automating I/O over a serial port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:28 AM
07-23-2003 10:28 AM
Re: Automating I/O over a serial port
echo "my stuff" > /dev/ttyd0p3.
The problems arise when you need to assert lines like DTR,CTS, or DCD. You need to either hard-wire the desired pins with a custom cable or run a process that asserts these settings along with baudrate, wordlength,parity, & stopbits. The good news is that the port settings are independent of the process so that if you have a process which holds the port open and asserts the proper signals then a separate echo can send anything you like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:29 AM
07-23-2003 10:29 AM
Re: Automating I/O over a serial port
I remember back in my propriatary hardware days having to tweek a vendor specific gettydefs / Dialer combination to send commands to set up concentrators, but I'm likely forgetting the details.
Maybe a script with commands redirected > /dev/serialxx, otherwise I'll be quiet now... :^)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:43 AM
07-23-2003 10:43 AM
Solutionhttp://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6c7dabe92dabd5118ff10090279cd0f9,00.html
You would compile it like this:
cc holdport.c -o holdport
then use it like this:
holdport -t /dev/ttyd0p3 -s 19200
to set up a port at 19200 baud.
After holdport, you can then do something
like this, if necessary.
'stty -crts rtsxoff ctsxon < /dev/ttyd0p3'.
You can then simply echo any characters you like to the port.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 12:16 PM
07-23-2003 12:16 PM
Re: Automating I/O over a serial port
Thanks for your suggestions, especially the holdport program. Just what I was looking for. I also found an article on the web site that said that you can set port parameters as long as a process has the port open. You also mentioned that in your earlier response. I came up with the following and its working for me.
First, I opened the port via 'cu -ltty0p0' and then ran 'stty -g I then closed the cu session and opened the port via 'cat < /dev/tty0p0'.
Then I ran 'stty $port_settings < /dev/tty0p0' where port_settings was the string returned from 'stty -g'. This set the port parameters the same as 'cu'.
I was then able to 'echo $string > /dev/tty0p0' and see the output in the window I was running 'cat' in.
Not the cleanest way to do things but it's working.
I'm going to compile the holdport program and try that out next. Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 01:15 AM
07-24-2003 01:15 AM
Re: Automating I/O over a serial port
An alternative to the other good suggestions above is to use Kermit. You don't have to use other programs, it's already installed on your systems and you don't need to worry about stty settings.
Initially you can just run Kermit and manually step through the commands to configure the port and send the text commands to your switch. When you're happy with this, put the commands into a file and run kermit -y
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2003 07:07 AM
07-30-2003 07:07 AM