Plotting and Logging Overview

The API is structured around classes that inherit from thread so that they can interact with multiple serial ports simultaneously without affecting the performance of the main thread. There are three procedures running in separate threads:

  1. serial port communication (see Serial Port Monitoring)
  2. periodic aggregation and logging of serial stream (see Data Logging)
  3. plotting of live streams for multiple sensors (see Data Plotting)

livemon.py provides script access to each of these procedures and handles connecting them together so that plotting and logging can happen simultaneously.

liveserial.livemon.run(args, runtime=None, testmode=False)[source]

Starts monitoring of the serial data in a separate thread. Starts the plotting or logging based on command-line args.

Parameters:
  • args (dict) – result of _parser_options() call that parses the command-line arguments. Could also be script_options to use all default values.
  • runtime (float) – how many seconds to run for before terminating.
  • testmode (bool) – when True, the plotting backend is changed so that no window is produced; plotting functions are altered slightly to make testing possible.