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 08:27 , Jukka Marin <jmarin%embedtronics.fi@localhost> wrote:
> On Mon, Feb 16, 2015 at 08:14:07AM +0100, Marc Balmer wrote:
>> Am 16.02.15 um 03:34 schrieb Christos Zoulas:
>>> 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.
>> 
>> Actually "our" slattach can attach any line discipline, not only slip.
>> ldattach in OpenBSD supersedes slattach, which in contrast to ours can
>> not attach arbitrary line disciplines.
> 
> You can set serial line speed with stty:
> 
> $ stty -f /dev/tty00 speed 115200
> 
> When the port is closed, the parameters (including speed) return to their
> default values.

I tried this, even on another NetBSD machine with the USB serial device 
attached, but ttyU0 immediately defaults back to 9600.
I guess the USB serial port doesn’t act like an normal serial device, and
is therefore regarded as closed and then return back to the defaults...

The USB serial device I’m trying to connect only spits our random data and 
doesn’t act like a “normal" serial device. 
Is there any way to hardcode /dev/ttyU0 as “raw” and with higher baud rate? 

Because "stty -f /dev/ttyU0 speed 115200 raw” doesn’t seem to do the trick :(

/P


Home | Main Index | Thread Index | Old Index