NetBSD-Users archive

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

Re: TTL/USB converter usage question



On Tue, Oct 15, 2024 at 11:48:25AM +0200, Ramiro Aceves wrote:
> Sorry if this thread is making unuseful noise in the list. I can read
> the device correctly using the cu command, that is very good and out
> of any doubt.  But I do not know where I read that could read the
> device using stty first and cat command after that. Probably It was
> CHATGPT who gave me the idea. It did not work and that was the origin
> of this thread.

No problem, just wanted to know if hints how to do it at the C source
level would help.

Funny exercise, I need to try it with a GPS receiver.

The problem is that you open the device at the shell level (the redirect <
will be done first), which will already block and wait for a connection.
When that open completes, the part in the ( ) will run and only then stty
will do the magic.

Or something like that.

Not sure why it fails with the dtyU0 device.

I ususally set such device globaly to not care about modem signals, by
adding something like this to /etc/ttys:

ttyU0	"/usr/libexec/getty std.9600"	vt100	off	local

and making sure to run ttyflags -a as root (or wait untill after the
next reboot) before trying to access it.

Martin


Home | Main Index | Thread Index | Old Index