Reading from USB serial port under Cygwin

command linecygwin;serial portusb

I am actually using Cygwin, but it is my understanding that it responds to Unix commands so hopefully I am in the correct place.

I have an Arduino hooked up via USB to my LapTop for data reading.

I want to be able to simultaneously be able to output the serial port data to the shell for my viewing and also save all that data as a text file.

Is there a command I can use to do this?

Best Answer

The command tee duplicates its input onto several output streams.

Cygwin presents serial ports as /dev/ttyS0, /dev/ttyS1, … corresponding to Windows's COM1, COM2, … (there's an offset of 1).

Figure out which serial port number Windows assigns to your serial device. Say the device is COM4:

tee </dev/ttyS3 serial-log.txt
Related Question