--- /dev/null
+#!/usr/bin/env python
+
+import argparse
+import sys
+import time
+
+import serial
+
+parser = argparse.ArgumentParser()
+parser.add_argument('--timestamps', action='store_true', help='Add timestamps to the output')
+parser.add_argument('device', help='The serial port to open')
+args = parser.parse_args()
+
+
+ser = serial.Serial(args.device, baudrate=38400, timeout=0.1)
+
+output = sys.stdout
+
+last_time = int(time.time()) - 1
+
+try:
+ while True:
+ now = int(time.time())
+ if args.timestamps and now != last_time:
+ output.write(b'#{}\n'.format(now))
+ last_time = now
+ line = ser.readline()
+ if not line: continue
+ line = line.strip()
+ output.write(line + b'\n')
+ output.flush()
+except KeyboardInterrupt:
+ sys.stderr.write(b'Ctrl-C pressed, exiting...\n')
+ sys.exit(1)
+