NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ldattach(8) alike util in NetBSD?



On 16 Feb 2015, at 03:34 , Christos Zoulas <christos%astron.com@localhost> wrote:
> In article <CBA94F53-88B0-454D-950E-489E95899CBF%nordu.net@localhost>,
> Fredrik Pettai  <pettai%nordu.net@localhost> wrote:
>> On 09 Feb 2015, at 09:16 , Marc Balmer <marc%msys.ch@localhost> wrote:
>>> Am 09.02.15 um 09:06 schrieb Fredrik Pettai:
>>> 
>>>> OpenBSD has ldattach(8) for setting for instance baudrate on a serial
>> device. 
>>>> 
>> http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man8/ldattach.8?query=ldattach&sec=8
>>>> 
>>>> Is there a similar util in NetBSD ?
>>> 
>>> slattach(8). You can set the baudrate using the -s option.
>>> 
>>> See http://netbsd.gw.com/cgi-bin/man-cgi?slattach++NetBSD-current
>> 
>> Hmmm, it doesn’t seem to work well…
>> 
>> rpi# slattach (-l) -n -s 460800 /dev/ttyU0 (or ttyU1)
>> slattach: TIOCSLINED: Device not configured
> 
> slattach is for slip (Serial Line IP, the precursor to ppp). I don't
> understand why Marc said it would do what you want. Perhaps you don't
> have slip configured in your kernel and that's the error about the line
> discipline.

Yes, well I should have mentioned that to avoid confusion.
This is the (linux) command I wanted to mimic:

ldattach -8 -n -1 -s 460800 tty /dev/ttyUSB0

>> dmesg says:
>> 
>> uftdi0 at uhub1 port 2
>> uftdi0: FTDI FT232R USB UART, rev 2.00/6.00, addr 4
>> ucom0 at uftdi0 portno 1
>> ucycomopen: unit=0
>> ucycomopen: sc=0x0
>> ucycomopen: unit=1
>> ucycomopen: sc=0x0
> 
> What are you trying to do here? Use a serial line from a program
> that does not understand how to set the baud rate?

Adjust the baud rate on the tty, then read the output from that tty
cat /dev/ttyU0 doesn’t seem to work, so I guess I need to set it in tty “raw” mode.

However, stty switches back to the original settings:

rpi# stty -f /dev/ttyU0 speed 460800
9600

rpi# stty -a -f /dev/ttyU0 | head
ispeed 0 baud; ospeed 9600 baud; 0 rows; 0 columns; queue = 1024; line = termios;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
	-echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
	-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
	brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl oxtabs onocr onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -mdmbuf
	-cdtrcts
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;


Home | Main Index | Thread Index | Old Index