Arduino-Makefile icon indicating copy to clipboard operation
Arduino-Makefile copied to clipboard

monitor: why not use "cat"? (Question)

Open cdupont opened this issue 4 years ago • 2 comments
trafficstars

I see Arduino-Makefile uses "screen" for the monitor. However, it's not very well know for many users... Why not using a simple "cat"? I use this:

monitor:
         stty -F $(MONITOR_PORT) raw $(MONITOR_BAUDRATE)
         cat $(MONITOR_PORT)

It works well. You can quit with Ctrl-C.

cdupont avatar Dec 28 '20 14:12 cdupont

as i recall cat has buffering issues when you change baudrate - you see the previous output when you make the baudrate faster or something?

also stty is probably more unknown than screen and has differences between macos and linux versions.

you can change MONITOR_CMD in your local Makefile or bind ctrl-c to the kill command in gnu-screen

sej7278 avatar Dec 28 '20 14:12 sej7278

I would say that a more important reason is that cat is uni-directional: you cannot type any text to your arduino serial port and expect it to be readable using Serial.read or Serial.readBytes, while with gnu-screen you can.

rohoog avatar Apr 02 '21 11:04 rohoog