Glam Prestige Journal

Bright entertainment trends with youth appeal.

I am using cutecom for serial port as it have a timestamp because i need to reference for two different data. But i can't log these datas with timestamp and need ms precise. Is there any suggestion?

Thanks, Selim.

2

1 Answer

If you don't need a terminal emulator, you can use socat with the -v option which logs all i/o with a timestamp. For example,

socat -v READLINE /dev/ttyS0,b19200,raw,echo=0 2>/tmp/log

Whatever you type on the stdin of this command will be sent to the serial port ttyS0 at the given baud rate etc. And any input from the serial port will appear on stdout. In /tmp/log you will find lines like

> 2019/11/06 13:56:27.996129 length=6 from=0 to=5
hello
< 2019/11/06 13:56:37.024451 length=8 from=0 to=7
my reply

which corresponds to typing "hello\n" and getting "my reply" sent back.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy