tbird20d / grabserial

Grabserial - python-based serial dump and timing program - good for embedded Linux development
GNU General Public License v2.0
195 stars 77 forks source link

Added some features for continuous logging #17

Closed Jeroen6 closed 7 years ago

Jeroen6 commented 7 years ago

I'm not a seasoned python developer, but I've added some features to make grabserial more useful when logging serial port data for longer periods of time.

Features like: -a, --again Restart application after -e expires or -q is triggered. -Q, --quiet Silent on stdout, serial port data is only written to file.

Modified -o, --output= to accept datetime formats like then "%Y-%m-%dT%H-%M-%S" when given a single "%". (iso 8601)

This was developed on windows, I'm not sure if the restart method like os.execv(sys.executable, ['python'] + sys.argv) will work properly on all platforms.

Let me know what you think.

tbird20d commented 7 years ago

In general it looks like a useful feature. I like the '%' thing for specifying a timestamped output file. I'm away from my test machine at the moment (was on vacation away from e-mail, and am now on a business trip). There's one or two things I'd like to change, but I'll take a closer look and do some testing when I'm in my office (probably tomorrow).

With regards to the restart option, I'd like to double-check that this method works on Linux. I'm sure we can find something that works on multiple platforms.

Thanks for the enhancements! -- Tim

Jeroen6 commented 7 years ago

The restart function can be better. Preferably, without full restart. I did however fix an file close issue. I have my latest master running on a raspberry pi for a week now. So it works on linux.