Skip to content

Instantly share code, notes, and snippets.

@kartiksubbarao
kartiksubbarao / btmon-3.1.1.patched.py
Last active December 13, 2015 15:13
Patched version of btmon.py 3.1.1 that handles data transmission glitches from the GEM unit
#!/usr/bin/python -u
__version__ = '3.1.1'
"""Data collector/processor for Brultech monitoring devices.
Collect data from Brultech ECM-1240, ECM-1220, and GEM power monitors. Print
the data, save the data to database, or upload the data to a server.
Includes support for uploading to the following services:
* MyEnerSave * SmartEnergyGroups * xively * WattzOn
* PlotWatt * PeoplePower * thingspeak * Eragy
#! /usr/bin/python
import sys
import collections
import json
import numpy as np
import matplotlib.pyplot as plt
config = {}
eegdata, channels = (collections.OrderedDict() for i in range(2))