NetBSD-Users archive

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

Re: TTL/USB converter usage question



El mar, 15 oct 2024 a las 12:08, Martin Husemann
(<martin%duskware.de@localhost>) escribió:
>
> 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.

Thanks so much for help and for the NetBSD operating system that it is
giving me many hours of entertainment. It works really well in the Rpi
4.
>
> Funny exercise, I need to try it with a GPS receiver.

I think I am about throwing this GPS Jupiter-T  module to the bin. ;-)
I would check RF cables, supply voltages and everything before
reaching that point. This GPSDO have been working for years. It was
never quick when getting FIX when you switched it on after months of
no use, but this time seems to be dead. I suspected that the antenna
could be the culprit but I have a new spare one than also doesn't
appear to work.


>
> 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.

/dev/dtyU0 works fine with the cu command:

netbsd-raspa4$ cu -l /dev/dtyU0 -s 9600 |hexdump -C > dtymessages

netbsd-raspa4$ cat dtymessages
00000000  43 6f 6e 6e 65 63 74 65  64 0d 0a 0a 40 40 45 61  |Connected...@@Ea|
00000010  0a 0d 07 e8 0f 02 19 00  00 00 00 08 b1 53 8b ff  |.............S..|
00000020  35 fb a5 00 01 3d 1a 00  00 00 00 00 00 00 00 00  |5....=..........|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000050  00 00 00 00 4a 41 0d 0a  40 40 45 61 0a 0d 07 e8  |....JA..@@Ea....|
00000060  0f 02 1b 00 00 00 00 08  b1 53 8b ff 35 fb a5 00  |.........S..5...|
00000070  01 3d 1a 00 00 00 00 00  00 00 00 00 00 00 00 00  |.=..............|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|


>
> 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

Thanks for the tip.
Regards.

>
> 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