5

I'm using ( sudo picocom -b 115200 /dev/ttyUSB0 ) to connect to a real-time embedded system based on ThreadX system.

Once I'm connected to this device, I use some ThreadX commands to display some logs.

Currently I'm using a manual copy past maneuver to save the logs. Is there any other way to save all the output (logs) displayed on the terminal to a file on my computer?

  • Your comment is useless @SorenA – jcarballo Apr 22 '19 at 5:38
6

Using tee:

picocom /dev/ttyUSB1 -b 115200 -l | tee my.log
| improve this answer | |
4

You can run it under script - see man script and do:

script my.log
sudo picocom -b 115200 /dev/ttyUSB0
...
exit

And all the inputs and outpuits will be in my.log.

| improve this answer | |
  • Great, that exactly what I need. Thank you very much ! – YounLee Feb 27 '18 at 19:40
  • @younlee Consider upvoting and accepting the answer if you found it useful. – bohrax Aug 29 '18 at 16:28
1

picocom has a logging feature -g. You can use it like;

picocom -b 115200 /dev/ttyUSB0 -g my_picocom_logfile.txt

from the manpage;

--logfile | -g
              Use specified file for logging (recording) serial input, and possibly serial output.  If the file exists, it is appended to.  Every
              character read from the serial port is written to the specified file (before input mapping is performed).  If local-echo mode is is enabled
              (see --echo option and C-c command), then every character written to the serial port (after output mapping is performed) is also logged to
              the same file.  (Default: no logging)
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.