Anyone configured an Avocent ESP16 Serial port hub (Serial over ethernet)?

From: Lynn Dixon 
------------------------------------------------------
So,  we have RHEL6 machine that is connected to several serial devices that
do monitoring in a lab over a serial-to-ethernet hub using an Avocent
ESP16.  I have the kernel compiled and the driver installed from Avocent
correctly, and the OS sees the new serials.
The people that make the instruments cant get the OS to "see" the devices
stating that the ports need to be configured as such:

Port type (Terminal)
Configure Port  (Incoming only)
Speed ( 9600)
Data bits (8)
Parity (None)

The driver software created 16 tty devices in /dev that are called ttyQ01e0
through ttyQ01ef

How do I configure these ports in unix with those parameters (N-8-1) at 9600
baud.?  I have never messed with serial before in Linux :(

=============================================================== From: "Daniel L. Appleget" ------------------------------------------------------ man setserial http://accesio.com/go.cgi?p=../software/linuxserial.html

=============================================================== From: William Wade ------------------------------------------------------ I believe you are might be looking for the stty command: man stty http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?stty Normally the program reading/writing to the serial port handles the setup. What is reading the information from the ports? es that cent e0 600

=============================================================== From: Lynn Dixon ------------------------------------------------------ There are 5 serial devices that plug into this 16 port hub. The hub then sends the serial data over ethernet. This RHEL machine has the ESP driver software installed, and we have it configured to mange the serial hub, and it sees it. However, their software on the RHEL machine cant talk to the serial devices for some reason. The onsite guy is saying its because its not 9600 n-8-1 on the RHEL box. I tried setserial and got this: [root@midalsf01t ~]# setserial /dev/ttyQ01ef autoconfig Cannot get serial info: Invalid argument I am reading up on stty now.

=============================================================== From: Stephen Haywood ------------------------------------------------------ Is there a management interface on the serial hub? Maybe you can configure it that way.

=============================================================== From: Lynn Dixon ------------------------------------------------------ The guy had previously set this up using SCO and just used scoadmin to configure the ports that the driver presented to the OS. I am thinking stty may be what we need, I just need to figure out the argument string to set it to 9600 n-8-1. If anyone knows this from the top of their head, shoot it to me :)

=============================================================== From: Stephen Kraus ------------------------------------------------------ Is this straight serial or GPIB over serial for lab instruments?

=============================================================== From: Lynn Dixon ------------------------------------------------------ Im assuming straight serial. Heres the product page from Avocent on the hub they are using: http://www.connectivity.avocent.com/products/network-based/esp

=============================================================== From: Stephen Kraus ------------------------------------------------------ I'd check if that was GPIB they are trying to run through it, most lab instruments use GPIB

=============================================================== From: Ed King ------------------------------------------------------ sounds a lot like the Digi Portserver thingy I bought from Aaron several years ago and still haven't hooked it up yet... I got distracted by car projects ;-) what are your serial devices monitoring? sounds interesting...

=============================================================== From: William Wade ------------------------------------------------------ I would guess we are talking more sensors than equipment, so likely it is just serial. Have you set the port settings on the hub? ftp://ftp.connectivity.avocent.com/manuals/esp

=============================================================== From: Lynn Dixon ------------------------------------------------------ OK. SO I have some more concrete information now. This redhat box is replacing a SCO system. I spoke with the app owner who has a thin client terminal that he is needing to connecti VIA serial to the redhat box. It sounds as if his program he has written sends text to each specific terminal (as in each terminal gets different data depending on its location) using these Serial over ethernet. These terminals will display info and prompt for info. So, while I had him on the phone, I tried an echo command like this: echo "hello user" >> /dev/ttyQ01e0 which is the exact port that the terminal is plugged into on the hub, and he did receive some text, but it was only he993434| (and other garbage characters). So, it looks like redhat sees it and can talk to it, but I must have the flow control, or parity or something else misconfigured for this port. I am still digging through getting stty to set this port to 9600 n-8-1. One odd thing he mentioned was that in SCO, he just set the ports up using scoadmin, but set each tty up as a "terminal" port type with all the mentioned flow settings.

=============================================================== From: Ed King ------------------------------------------------------ does each terminal login to the system? maybe you need to edit /etc/inittab look for the serial section, eg: # Example how to put a getty on a serial line (for a terminal) # #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 #T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

=============================================================== From: Dee Holtsclaw ------------------------------------------------------ stty 9600 cs8 -cstopb -parenb crtscts

=============================================================== From: Lynn Dixon ------------------------------------------------------ No Ed, from what the app owner was saying, his application sends plain text to the terminal port (ttyQ01e0), and then the user inputs data (probably from a prompt in his app). I think from my standpoint, if I can echo and cat plain text to the terminal without dropping characters, and then accepting keystrokes from that terminal I should be good. Dee, Here is the output of stty -a < /dev/ttyQ01e0 before running the command with the arguments you provided: [root@midalsf01t dev]# stty -a < /dev/ttyQ01e0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts -cdtrdsr -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke And here is that output after running the arguments you provided; [root@midalsf01t dev]# stty 9600 cs8 -cstopb -parenb crtscts < /dev/ttyQ01e0 [root@midalsf01t dev]# stty -a < /dev/ttyQ01e0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 hupcl -cstopb cread clocal crtscts -cdtrdsr -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

=============================================================== From: Dee Holtsclaw ------------------------------------------------------ What I get from this is: The default is 9600-E-8-1 (parenb & -parodd == Even parity) and XON/XOFF handshaking. Canonical input is on, including the Ctrl/C for interrupt, etc. (which only affects a process if the serial device is the "controlling terminal"). Post-processing is on with LF->CRLF translation. All characters input will be echoed back to the terminal. The CR from the terminal is translated to LF. Turning on the CTS/RTS or DSR/DTR will require wiring the appropriate RS-232 pins. Since it wasn't on before, I'd try omitting that and sticking with XON/XOFF unless/until you lose output. If output on the terminal starts appearing double-spaced (line wise), add "-onlcr" to disable the LF->CRLF translation. Likewise, if entering something from the terminal fails to act like it was completed, add "-icrnl" to disable the CR->LF input translation. Alternatively, you can just add "-opost -icanon" to stop all input & output translation but that might cause other problems (like breaking XON/XOFF).

=============================================================== From: Lynn Dixon ------------------------------------------------------ Dee, Thanks a million! I used the following string: stty 9600 cs8 -parenb -cstopb -crtscts < /dev/ttyQ01e0 and I called the app owner (he is in Dallas and I am in Dalton) to confirm. I was able to echo complete lines of text without any characters dropping or garbage coming through. Now, he has asked me to provide a normal Linux/Unix login on 2 of these devices (GAH!! it never ends) for the line supervisors. So, now I need to figure out how to get a normal console on 2 of these devices.

=============================================================== From: Ed King ------------------------------------------------------ see my previous email

=============================================================== From: Lynn Dixon ------------------------------------------------------ Ed, Thanks for pointing me to this. You lead me in the right path to what I think should work. It appears that RHEL6 doesnt use inittab to startup additional serial consoles, but uses an upstart job instead. So, heres what I am thinking. I create a file /etc/init/serial-ttyQ01e3.conf that contains the following: # Start up Serial console over Avocent Serial hub to /dev/ttyQ01e3 start on stopped rc RUNLEVEL=[2345] stop on starting runlevel [016] respawn exec /bin/stty 9600 cs8 -parenb -cstopb -crtscts < /dev/ttyQ01e3 exec /sbin/agetty /dev/ttyQ01e3 9600 vt100-nav ############################ So, does this look right? I added the stty string above the agetty command, but I am not sure I can stack those commands in an upstart job. I added because I dont think the stty string will be persistent across a reboot.

=============================================================== From: Ed King ------------------------------------------------------ I'm not familiar with RHEL upstart scripts... however... something about putting that stty command inside a "respawn" makes me queasy...

=============================================================== From: William Wade ------------------------------------------------------ What if you ran the stty inside screen? Like they do here for the Arduino: http://www.arduino.cc/playground/Interfacing/LinuxTTY Then you could easily have upstart check to make sure that the specific screen is not running before spawning it as well. thing about

=============================================================== From: Dee Holtsclaw ------------------------------------------------------ If this is a local terminal (not connected to a modem), I'd use: /sbin/agetty -L /dev/ttyQ01e3 9600 vt100-nav The "-L" forces "clocal" so that it doesn't try to watch for a carrier-detect. The "stty" is unnecessary since agetty will cycle through the bit-size and parity options on it's own (and agetty resets everything anyway). Also make sure the terminal type is correct for the actual terminal in use (or the emulation thereof).

=============================================================== From: Dee Holtsclaw ------------------------------------------------------ The "stty" command is superfluous and ought to be removed. And "respawn" would most definitely be needed else you could only login once without rebooting the box.

=============================================================== From: Lynn Dixon ------------------------------------------------------ Yeah, these terminals are not connected via modems. They are all going to be connected using that same serial-to-ethernet adapter I was having trouble configuring earlier in this thread. THe app owner is just needing the addiotnal ports (it has 16 total available) setup to host these dummy terminals via serial to this same RHEL6 box so his 2 admins can login to a normal shell.

=============================================================== From: Ed King ------------------------------------------------------ I didn't say not to respawn the getty ----- Original Message ---- From: Dee Holtsclaw To: CHUGALUG Sent: Thu, October 27, 2011 3:05:57 PM Subject: Re: [Chugalug] Anyone configured an Avocent ESP16 Serial port hub (Serial over ethernet)? The "stty" command is superfluous and ought to be removed. And "respawn" would most definitely be needed else you could only login once without rebooting the box.

=============================================================== From: Lynn Dixon ------------------------------------------------------ Just wanted to say thanks to everyone for helping, especially Dee and Ed. I got the Avocent box working 100% and got the 2 dummy terminals working through it as well. You folks are a wealth of information!

=============================================================== From: Lynn Dixon ------------------------------------------------------ After a few days of running this swtich, I have noticed a few things I cant get worked out. For one, the agetty sessions that I have started with the upstart job will eventually "timeout" and the dumb terminal will essentially lock up. Restarting the dumb terminal yields the same results. I can do a kill -1 on the agetty pid for that process but it doesn't respawn. I do have respawn in the upstart job, but this doesnt seem to work :( Here is what the upstart job looks like: # Start up Serial console over Avocent Serial hub to /dev/ttyQ01e3 start on stopped rc RUNLEVEL=[2345] stop on starting runlevel [016] respawn exec /sbin/agetty -L /dev/ttyQ01e3 9600 vt100-nav Any suggestions?