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 23:42 , Dave Huang <khym%azeotrope.org@localhost> wrote:
> On Feb 16, 2015, at 16:08, Fredrik Pettai <pettai%nordu.net@localhost> wrote:
>> 
>> 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...
> 
> I'm not sure what you mean by a "normal serial device". The serial 
> device, whether it's USB or not, is regarded as closed when no process 
> has it open. So if no process has ttyU0 open, stty will open it, set 
> the baud rate, close it, and the baud rate will be back to 9600.

Ok, now I understand why it just bumps back.

Yes, starting an "od -Ax -t x1 /dev/ttyU0" and then go on setting the baud
rate works (the baud rate setting stays), but I can’t see any output coming :(

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

rpi# stty -a -f /dev/ttyU0 | head  -1
speed 115200 baud; 0 rows; 0 columns; queue = 1024; line = termios;


> What are you trying to use the serial port for? The program that's 
> using the serial port should let you set the baud rate. E.g., if you're 
> using tip or cu, specify the baud rate there. If the port is to be 
> configured as a terminal that presents a login prompt, you can 
> configure the baud rate using /etc/ttys and /etc/gettytab.

I just want to read the input from the serial device attached.
It’s a source of extra entropy that I want to collect…

Adding this line to /etc/remote:

# grep entropy /etc/remote
entropy:dv=/dev/ttyU0:br#460800:pa=none:dc:

and doing a "tip entropy | od -Ax -t x1” works and gave me lots of output
at least, so it works (but not in the way I expected it to get working…)

thx,
/P


Home | Main Index | Thread Index | Old Index