NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Fwd: TTL/USB converter usage question
---------- Forwarded message ---------
De: Ramiro Aceves <ea1abz%gmail.com@localhost>
Date: vie, 18 oct 2024 a las 12:26
Subject: Re: TTL/USB converter usage question
To: Michael van Elst <mlelstv%serpens.de@localhost>
El jue, 17 oct 2024 a las 7:51, Michael van Elst
(<mlelstv%serpens.de@localhost>) escribió:
>
> rvp%SDF.ORG@localhost (RVP) writes:
>
> >On Wed, 16 Oct 2024, Ramiro Aceves wrote:
>
> >> netbsd-raspa4$ { sleep 1; stty -f /dev/ttyU0 9600 raw clocal cread
> >> -crtscts; } & cat -u -v /dev/ttyU0
> >> stty: /dev/ttyU0: Resource temporarily unavailable
> >>
>
> >Wrong device--use /dev/dtyU0.
>
>
> You don't need to open the device twice and you don't need non-blocking mode.
>
> ( stty 9600 raw clocal cread -crtscts ; cat ) < /dev/dtyU0
>
Yessss!!! It works this way!
netbsd-raspa4$ ( stty 9600 raw clocal cread -crtscts ; cat ) < /dev/dtyU0
@@Ea
�
�¿½Y"�5�|6i
3� -�!H�
@@Ea
�
�Y!�5�w6i�
3� -�!H�
^C
> will configure the interface and read from it. The dial-out device will
> avoid waiting for a carrier-detect signal, so the open is not blocked.
> Then stty disables flow control, so that cat then won't stall on the
> 3-wire connection (clocal and cread aren't necessary then, or you could
> just use clocal).
>
> The next problem is then the binary protocol. The shell won't be
> able to parse it and 'cat' will try to read big chunks. You can
> try to work around this with dd, e.g. this would read single byte
> chunks.
>
> ( stty 9600 raw clocal cread -crtscts ; dd msgfmt=quiet ibs=1 obs=1 | hexdump -vC ) < /dev/dtyU0
>
>
netbsd-raspa4$ ( stty 9600 raw clocal cread -crtscts ; dd msgfmt=quiet
ibs=1 obs=1 | hexdump -vC ) < /dev/dtyU0
00000000 0a 40 40 45 61 0a 12 07 e8 0a 15 1b 00 00 00 02 |.@@Ea...........|
00000010 08 b1 59 46 ff 35 e3 a0 00 01 36 69 00 00 00 00 |..YF.5....6i....|
00000020 00 0a 01 e8 00 00 00 0b 03 07 08 32 a2 09 08 2d |...........2...-|
00000030 a2 04 07 21 00 00 00 00 00 00 00 00 00 00 00 00 |...!............|
00000040 00 00 00 00 00 00 00 00 00 48 34 0d 0a 40 40 45 |.........H4..@@E|
00000050 61 0a 12 07 e8 0a 15 1f 00 00 00 02 08 b1 59 49 |a.............YI|
00000060 ff 35 e3 a9 00 01 36 69 00 00 00 00 00 02 07 4a |.5....6i.......J|
00000070 00 00 00 0b 03 07 08 33 a2 09 08 2d a2 04 07 21 |.......3...-...!|
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
^C
netbsd-raspa4$
Thanks so much Michael and all for the effort! I take my hat off to
your wisdom. It is a pleasure to have people like all of you that are
experts in all this, I am a fan that can barely defend myself using
the operating system but without knowing the ins and outs.
Regards!
Home |
Main Index |
Thread Index |
Old Index