This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_header_row(parameter_numbers, parameter_list): | |
'''This function creates the header for a CSV file. | |
The putput of this function should be appended to a CSV file upon creation | |
Input: | |
------ | |
Parameter List: A Python list consisting of strings corresponding to all electrical parameters provided by the smart meter | |
Parameter Numbers: A Python list corresponding to chosen parameters (to be logged to CSV) | |
Output: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from configuration import THRESHOLD_TIME, DATA_BASE_PATH, BASE_UPLOAD_PATH | |
from dbupload import DropboxConnection | |
import db_password | |
import glob | |
import os | |
import time | |
import requests | |
email=db_password.email | |
password=db_password.password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#First on Linux shell figure if the USB-serial convertor has been detected. | |
# Type dmesg|grep tty and you should probably see the convertor and the tty USB port it is allocated. I shall assume you got #/dev/ttyUSB0 | |
import serial,time | |
serial_port=serial.Serial('/dev/ttyUSB0') | |
file_pointer=open('data.csv','wb') | |
while True: | |
a=s.readline() | |
f.write(str(time.time.now())+","+a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# script by Alex Eames http://RasPi.tv/ | |
# http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
import time | |
# GPIO 23 set up as input. It is pulled up to stop false signals | |
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) | |
GPIO.setup(23,GPIO.OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "pandas_epoch" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web | |
import numpy as np | |
import time | |
urls = ("/*", "hello", | |
"/upload","upload" | |
) | |
app = web.application(urls, globals()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import pprint | |
import csv | |
file = open( "filename_destination2.csv", "w") | |
files_in_dir = os.listdir('/home/shailja/readfiles') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import matplotlib.dates as md | |
import numpy as np | |
import datetime as dt | |
import time | |
data = np.genfromtxt('/home/milan/Projects/Summer_Project/AC/Data/data_1.csv',delimiter=',',names=['time1','date','temperature','humidity']) | |
#data2 = np.genfromtxt('/home/milan/Projects/Summer_Project/AC/Data/data_2.csv',delimiter=',',names=['time2','power']) | |
time = data['time1'] | |
humidity = data['humidity'] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.