I am a beginner user who is eager to learn and seek guidance from all the experts here. I am interested in displaying content from OpenWrt on a serial port screen. I plan to connect the router to the screen via a TTL-to-USB adapter. However, due to my limited exposure to this area, I am at a loss for how to proceed. Could you please guide me on how to send information (such as network speed, CPU status) from OpenWrt to the screen?
I have roughly learned that we need to design the UI interface of the screen first, and then send instructions to the screen through the router to display information in real time.
I think the keywords you are after is terminal (ANSI) escape sequences.
But you probably want to use a library....
I think we need a better understanding of your existing capabilities and we can start from there, but this isn't really a generic programming support forum?
Perhaps pipe the output of the commands to the serial port?
What's reading on the other side?
Can you please clarify this point?
My quick hack would be set up what you want to see on a tmux session then use tmux screen captures, then pipe that to your serial port. There's plenty of existing applications that can monitor what you're after. atop?btop?
Is it like you want an auto login on a tty on boot and then run a program as that user?
Unless you really, really, really have to, don't abuse the first/ native serial UART (there are only few contemporary routers with two serial UARTs) for this purpose, prefer the USB route instead (if necessary, with a cheap usb2serial adapter).