有带时间戳的Linux串行终端吗?

时间:2021-01-01 02:40:20

i still want to check my Bootloader + Linux Startupcode for an embedded device. Therefore i want to catch the time for every command printed to the serial port.

我仍然想检查我的引导加载程序+ Linux Startupcode的嵌入式设备。因此,我想要捕获打印到串行端口的每个命令的时间。

I know there are programs like putty (which i can dearly recommend), getty, cutecom, picocom, screen etc. But none of these add timestamps to the incomming messages on the host screen (I'm not really talking about the date, more like how many ms have gone since the first output). It actually sounds not like a big deal.

我知道有一些程序像putty(我非常推荐)、getty、cutecom、picocom、screen等等。但是这些程序都没有在主机屏幕上输入消息时添加时间戳(我并不是在谈论日期,更像是自从第一次输出以来有多少ms消失了)。听起来没什么大不了的。

I found out there is one script doing what i wanted to have, called grabserial but it's not working properly, since it's to slow to process the whole output. I discussed this problem in a different forum (if you want to know: grabserial problem but it's not part of the topic). So i can't use that script.

我发现有一个脚本正在做我想做的事情,叫做grabserial,但是它不能正常工作,因为它处理整个输出很慢。我在另一个论坛上讨论了这个问题(如果您想知道:grab串行问题,但它不是主题的一部分)。所以我不能用那个脚本。

Now again: can you tell me a terminal for Linux which adds timestamps to every line, which was received from a Serial Port?

现在再说一遍:您能告诉我一个Linux的终端吗?它向每一行添加时间戳,从串口接收到这些时间戳。

Thank you

谢谢你!

[Edit:] I've found a pretty rough workaround with cereal, which wants to have some settings, since it locks the port everytime you use it. In the end, it adds the actual date and time, not the startup time and difftime between each step, so as you can see I'm still looking for an adequate solution.

[编辑:]我找到了一个非常粗略的解决方案,它需要一些设置,因为每次你使用它时它都会锁住端口。最后,它添加了实际的日期和时间,而不是每个步骤之间的启动时间和扩散时间,因此您可以看到,我仍然在寻找合适的解决方案。

4 个解决方案

#1


5  

This might come 3 years too late, but minicom (https://en.wikipedia.org/wiki/Minicom) supports timestamps for every line printed on the terminal. In Ubuntu it's directly available in the default repos.

这可能晚了三年,但minicom (https://en.wikipedia.org/wiki/Minicom)支持终端上打印的每一行的时间戳。在Ubuntu中,它直接在默认的repos中可用。

#2


0  

If you are willing to build the binary by yourself, you can try a branched picocom (https://github.com/codepox/picocom). This is based on picocom 1.7 which is a little old.

如果您愿意自己构建二进制文件,您可以尝试一个分支picocom (https://github.com/codepox/picocom)。这是基于picocom 1.7,有点旧了。

I have forked and enhanced this picocom and made it be able to show either delta-time or wall-clock timestamp. You can find it here (https://github.com/tdwong/picocom-with-timestamp). You still have to build the binary by yourself.

我已经分叉和增强了这个picocom,并使它能够显示deltatime或墙上时钟时间戳。您可以在这里找到它(https://github.com/tdwong/picocom-with-timestamp)。你仍然需要自己构建二进制。

Here is how I use it. Note, N is the command to enable/toggle timestamp.

这就是我的用法。注意,N是启用/切换时间戳的命令。

$ picocom -b 115200 /dev/ttyUSB0
  ...
<ctrl-a> N      # enable delta-time timestamp
<ctrl-a> N      # toggle wall-clock timestamp
<ctrl-a> N      # disable timestamp

#3


-1  

You might want to look in to using strace to monitor the serial port. See How can I monitor data on a serial port in Linux?

您可能希望查看如何使用strace来监视串行端口。查看如何监视Linux中串行端口上的数据?

#4


-2  

I believe that ExtraPuTTY is the solution you are looking for.

我相信你正在寻找的解决方法是超调。

However, I wasn't clear if you wanted something to run ON Linux or just to be able to monitor it (SSH to Linux). If you didn't want a Windows solution, then I apologize.

但是,我不清楚您是想要在Linux上运行什么,还是仅仅想要监视它(从SSH到Linux)。如果你不想要Windows的解决方案,那我道歉。

#1


5  

This might come 3 years too late, but minicom (https://en.wikipedia.org/wiki/Minicom) supports timestamps for every line printed on the terminal. In Ubuntu it's directly available in the default repos.

这可能晚了三年,但minicom (https://en.wikipedia.org/wiki/Minicom)支持终端上打印的每一行的时间戳。在Ubuntu中,它直接在默认的repos中可用。

#2


0  

If you are willing to build the binary by yourself, you can try a branched picocom (https://github.com/codepox/picocom). This is based on picocom 1.7 which is a little old.

如果您愿意自己构建二进制文件,您可以尝试一个分支picocom (https://github.com/codepox/picocom)。这是基于picocom 1.7,有点旧了。

I have forked and enhanced this picocom and made it be able to show either delta-time or wall-clock timestamp. You can find it here (https://github.com/tdwong/picocom-with-timestamp). You still have to build the binary by yourself.

我已经分叉和增强了这个picocom,并使它能够显示deltatime或墙上时钟时间戳。您可以在这里找到它(https://github.com/tdwong/picocom-with-timestamp)。你仍然需要自己构建二进制。

Here is how I use it. Note, N is the command to enable/toggle timestamp.

这就是我的用法。注意,N是启用/切换时间戳的命令。

$ picocom -b 115200 /dev/ttyUSB0
  ...
<ctrl-a> N      # enable delta-time timestamp
<ctrl-a> N      # toggle wall-clock timestamp
<ctrl-a> N      # disable timestamp

#3


-1  

You might want to look in to using strace to monitor the serial port. See How can I monitor data on a serial port in Linux?

您可能希望查看如何使用strace来监视串行端口。查看如何监视Linux中串行端口上的数据?

#4


-2  

I believe that ExtraPuTTY is the solution you are looking for.

我相信你正在寻找的解决方法是超调。

However, I wasn't clear if you wanted something to run ON Linux or just to be able to monitor it (SSH to Linux). If you didn't want a Windows solution, then I apologize.

但是,我不清楚您是想要在Linux上运行什么,还是仅仅想要监视它(从SSH到Linux)。如果你不想要Windows的解决方案,那我道歉。