예제 #1
0
 def datalog(self):
     # instantiate a harvest dispatcher
     dispatch = EkoDispatcher(self.context)
     dispatch.import_configs()
     self.logger.info("Start polling sensors")
     dispatch.dispatch_all()
     self.logger.info("Finish polling sensors")
     return
 def datalog(self):
     # instantiate a harvest dispatcher
     dispatch = EkoDispatcher()
     dispatch.import_configs()
     self.logger.info("Dispatching all sensor polling operations.")
     dispatch.dispatch_all()
     self.logger.info("All sensors polled.")
     return
예제 #3
0
 def datalog(self):
     # instantiate a harvest dispatcher
     try:
         x = Beagleboard.set_gpio_usbhub_power()
         x = Beagleboard.handle_modprobe_ehcihcd()
     except (OSError, IOError):
         self.logger.exception("Error encountered when attempting to turn on USB Hub.")
         x = False
     time.sleep(10)
     dispatch = EkoDispatcher()
     dispatch.import_configs()
     self.logger.info("Dispatching all sensor polling operations.")
     dispatch.dispatch_all()
     self.logger.info("All sensors polled.")
     try:
         x = Beagleboard.handle_modprobe_ehcihcd(insert = False)
         x = Beagleboard.set_gpio_usbhub_power(on = False)
     except:
         self.logger.exception("Error encountered when attempting to power off USB hub.")
     return
예제 #4
0
from ConfigParser import ConfigParser

import eko.Util.LogHelper as LogHelper
import eko.Util.DBSetup as DBSetup

import os.path

from os import makedirs

from eko.Sensors.Dispatcher import EkoDispatcher

import eko.SystemInterface.OSTools as OSTools

import eko.SystemInterface.Beagleboard as Beagleboard


logger = LogHelper.getLoggerInstance()
logger.setLevel(logging.DEBUG)

if __name__=="__main__":
    if not os.path.exists('/data/configdumps'):
        makedirs('/data/configdumps')
    if len(sys.argv) <  2:
        print 'USAGE: configsingle.py [PATH TO CONFIG FILES]'
        sys.exit(0)
    cfgpath = sys.argv[1]
    dispatch = EkoDispatcher(datapath='/data/configdumps', sensorcfgpath=cfgpath)
    dispatch.import_configs()
    logger.info("Dispatching all sensor config operations.")
    dispatch.dispatch_all()