Re: USB-serial adapter suggestions needed

From: Bernd Walter <freebsd-arm_at_cicely.de>
Date: Sun, 24 Dec 2023 17:01:00 UTC
On Sun, Dec 24, 2023 at 07:46:40AM -0800, bob prohaska wrote:
> On Sun, Dec 24, 2023 at 01:21:40AM +0000, Marcin Cieslak wrote:
> > On Sat, 23 Dec 2023, bob prohaska wrote:
> > 
> > > On Sun, Dec 24, 2023 at 12:47:56AM +0000, Marcin Cieslak wrote:
> > > > On Sat, 23 Dec 2023, bob prohaska wrote:
> > > > 
> > > > > What are the best-supported usb-serial adapters for use with FreeBSD on arm systems?
> > > > 
> > > > I am using uchcom(4)-based CH340, the reason I have it is selectable 3.3V/5V level.
> > > > I don't have a Raspberry but I use it for other arm boards.
> > > > 
> > > > Not sure it is "better" than, say ft232
> > > 
> > > Have you run into any oddities using the ch340? Noise on the lines,
> > > dropped connections, irreproducible behavior?
> > 
> > Only this https://lists.freebsd.org/archives/freebsd-arm/2023-March/002422.html -
> > responding to your post about halted boot - but this is an EFI console problem.
> > 
> > > Thanks for writing & confirming ch340 is an option!
> > 
> > Are you still troubleshooting your broken tip connections?
> 
> I'm still seeing tip sessions and the associated ssh connections drop,
> but am no closer to understanding what's wrong. There does seem to be
> a (somewhat imperfect) association between dropped tip sessions and
> the use of FTDI-232 usb-serial adapters, but the sample is too small
> (7 units) and too erratic (mix of Pi2, Pi3 & Pi4 hosts) to be sure of
> anything. 

If you see ssh connections drop then this is network related and has nothing
to do with the USB adapter.
In case an USB adapter fails you will just drop out of tip into the shell.
Most likly this is a statefull network device - e.g. NAT expire on either
your or ISP side.
TCPKeepAlive is active per default on OpenSSH, but often not enough for some
agressive ISP equipment.
You might also want to check if you have local firewalls in between, which
are misconfigured to expire TCP states too early.
If you run through equipment, which isn't in your hands at best you have
an OpenVPN or similar connection to handle network instabilities and run
ssh on top of it.

If however this is not ssh session dropped and just tip, then look up kernel
messages if the USB adapter was disconnected.
If yes and you have that problem with multiple adapters then this is most
likely power related, especially since both systems are connected via ground
and can have all kind of electrical issues.
In some cases it might be required to have an isolated adapter.

That said, beside all chips work well.
There are some bad boards however, which are unrelated to the chips themselves.
Also at least with the PL2303, CP2102 and some FTDI there are fake chips on
the market.
Other than that you might need specific features, some FTDI and CH340 can do
higher bps rates, which some rockchip based boards may need.
Also FTDI and CP2102 and a few others can have uniquie serial numbers, which
makes them easier to identify if you have multiple.
That's the reason why I like to use FT4232H based for my bench tests.
They can handle higher speeds and have serial numbers, plus they support
multiple uart at the same time.
I also have lots of CP2102, which I build myself and know those are technically
good.

> That's surprising given the Pl2303's rather poor repute and the ft232's
> sterling reputation, but far from decisive. In my initial testing a few
> years ago it seemed the reputations of the pl2303 and ft232 were more or
> less deserved; the pl2303 seemed a little flakier and the ft232. Now that
> situation seems to be reversed. 

The PL203 pure repute is that there had been tons of crappy adapters out there
and also fake chips had been an issue early on.
A quality board with a genuine Prolific chip works fine.
Still today you will get a bad board with fake chips more likely than a good
one if you buy from a random source.

> If there's another usb-serial bridge option which open-source programmers 
> prefer it seems wise to adopt it. That's what I'm fishing for. 
> 
> Thanks for reading!
> 
> bob prohaska
>  
> 
> 

-- 
B.Walter <bernd@bwct.de> https://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.