4 ms·
I use pexpect frequently for automating serial-port communications. It’s very useful for implementing test/flashing automation that needs some kind of a serial-
by nrclark 2y ago
I use pexpect frequently for automating serial-port communications. It’s very useful for implementing test/flashing automation that needs some kind of a serial-port step (such as asking u-boot to run a few commands).
- PhilipRoman 2y agoI do something very similar, how do you deal with random serial port data loss (dropped bytes)? Maybe it is specific to my environment, but I get mangled commands about 1% of time, which really sucks for automated workflows. I mostly countered this by writing commands to a tmp file, verifying md5sum and then executing the file on the device side.
- orev 2y agoSerial is slow but typically very reliable. If you’re seeing random dropped bytes, I’d take a look at your wiring and PC interface UART which might be low quality. FTDI UARTs in particular are often counterfeit (the real ones are good).
- nrclark 2y agoAcross a large enough sample set, I definitely see occasional serial errors (although they're rare). For me, I detect them by checking the exit-code on each command that I run, and also by looking for expected output in response to the commands. Corrective action is usually a full-stage retry.