Regarding the display of serial port screens

Hello fellow developers,

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?

openwrt will by default output to the serial port, if you want stats there are applications for it.
google is your friend.

There are lots of steps involved in this type of projects... How far have you reached so far?

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.

Well, yes, that is basics; have you investigated further into it?

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?

There's no logon using serial, just hit enter.

Apologies.

To clarify, what I mean as in you want something other than a getty waiting for an enter to then execute /bin/sh etc?

i.e. in this example I was classifying pressing enter as requiring user action which isn't an auto login. But I see your point.....

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).

1 Like

Haha good point. I read it as using a separate USB-TTL on the router already?
i.e. a second serial port was in play.