Operating System - HP-UX
1820390 Members
3440 Online
109623 Solutions
New Discussion юеВ

How to set the Baud rate for the serial ports on HP unix Visualize B180L

 
Najam_1
Occasional Contributor

How to set the Baud rate for the serial ports on HP unix Visualize B180L

Hi, I wan to connect a device to the serial port for which I have to set the speed to 115200 Baud, I tried the following but it does not work
nohup sleep 99999 >/dev/tty1p0 &
stty 115200 also tried
stty ospeed 115200 but when I run
stty it shows the speed as 300 Baud.
I aslo checked to make sure that there is no getty process for this device.
Thanks in advance
-Najam
New to HP Unix
4 REPLIES 4
Jordan Bean
Honored Contributor

Re: How to set the Baud rate for the serial ports on HP unix Visualize B180L


Is this a remote console port? If so, is it enabled in SPU? Does it support 115200? Is the device currently attached to it?
Najam_1
Occasional Contributor

Re: How to set the Baud rate for the serial ports on HP unix Visualize B180L

The device is actually a serial smartcard reader connected to the serial port, I dont know what SPU means. This HP box does support 115200 baud rate for the RS232 interface. I even tried setting the baud rate to 9600 but it still shows 300.
thanks,
Najam
New to HP Unix
Vincent Fleming
Honored Contributor

Re: How to set the Baud rate for the serial ports on HP unix Visualize B180L

It's been a while since I've done something like this, but as I recall, the device on the other end needs to keep DTR (pin 20 on a 25pin serial port, pin 4 on a 9-pin) high in order for speed to be set in most UNIX systems.

If you have a breakout box, put it on the line and check what pins it's holding high, if any. If it's not holding DTR high, use the breakout box to force it high, and try your stty again.

If you don't have a breakout box, get one - they're virtually required to do any serial communications.

There's lots of info on the web about serial communications... here's one:
http://www.taltech.com/TALtech_web/resources/intro-sc.html
that looks like it has a lot of good information.

Good luck!
No matter where you go, there you are.
Wodisch
Honored Contributor

Re: How to set the Baud rate for the serial ports on HP unix Visualize B180L

Hi Najam,

the "stty(1)" command uses the input channel to decide which tty to configure. And after the last process closes this channel it will be reset automatically to the default values as determined by the programmers of the device driver. Then UN*X usually only permits baud rates from 300 to 38400 baud, and the two highest speeds only with the special words "exta" and "extb". Hence try:

sleep 99999 < /dev/tty1p0 &
stty extb < /dev/tty1p0
stty -a < /dev/tty1p0

For faster speeds you'll need to do some C programming, using the system-call "ioctl" on that device...

HTH,
Wodisch