I'm using Raspbian Lite. My default console is serial port now and I want to use printf also on HDMI console.
How I can use printf to work also on the HDMI console?
That is your controlling terminal. Usually the same as your stdin, stdout, stderr. If all of those have been redirected you can still use /dev/tty to get back to the terminal.
Thank you for your reply. It works!jojopi wrote: ↑Wed Oct 28, 2020 7:30 amprintf() writes to standard output, which will normally be the terminal where you started your program. You can open other devices with fopen() and write to them with fprintf().
"/dev/tty0" (zero) represents the currently-active virtual console, which will be visible over HDMI if no GUI is running. You will need to be root or a member of the tty group to open the device for writing.