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 envirophat import motion | |
from ISStreamer.Streamer import Streamer | |
import time | |
# --------- User Settings --------- | |
# Initial State settings | |
BUCKET_NAME = "Envir:cloud: pHAT Motion" | |
BUCKET_KEY = "ephm0720" | |
ACCESS_KEY = "PUT YOUR INITIAL STATE ACCESS_KEY HERE" | |
# Set the time between sensor reads |
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 subprocess import PIPE, Popen | |
import psutil | |
import time | |
from ISStreamer.Streamer import Streamer | |
def get_cpu_temperature(): | |
process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE) | |
output, _error = process.communicate() | |
return float(output[output.index('=') + 1:output.rindex("'")]) |
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
{ | |
"latitude":42.3601, | |
"longitude":-71.0589, | |
"timezone":"America/New_York", | |
"currently":{ | |
"time":1528402806, | |
"summary":"Mostly Cloudy", | |
"icon":"partly-cloudy-day", | |
"nearestStormDistance":2, | |
"nearestStormBearing":164, |
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
function streamDataTime(signalName, value, timestamp, enable) { | |
if (!signalName) { | |
signalName = 'UnknownData'; | |
} | |
var headersIS = { | |
'X-IS-AccessKey': 'PLACE YOUR ACCESS KEY HERE', | |
'X-IS-BucketKey': 'PLACE YOUR BUCKET KEY HERE', | |
'Accept-Version': '~0' | |
} | |
var data = { |
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 ISStreamer.Streamer import Streamer | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
BUCKET_NAME = "Python Test" | |
# create a Streamer instance | |
streamer = Streamer(bucket_name=BUCKET_NAME, bucket_key=BUCKET_KEY, access_key=ACCESS_KEY) | |
# send some data |
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 requests | |
import json | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
def streamData(name, value): | |
url = 'https://groker.init.st/api/events' | |
headers = { | |
'Content-Type': 'application/json', |
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 requests | |
import json | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
BUCKET_NAME = "Python Test" | |
def createBucket(bucketKey, bucketName): | |
url = 'https://groker.init.st/api/buckets' | |
headers = { |
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 requests | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
def streamData(name, value): | |
url = 'https://groker.init.st/api/events?accessKey=' + ACCESS_KEY + '&bucketKey=' + BUCKET_KEY + '&' + name + '=' + str(value) | |
r = requests.get(url=url) | |
return r |
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 requests | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
BUCKET_KEY = "reqtest1" | |
BUCKET_NAME = "Python Test" | |
def createBucket(bucketKey, bucketName): | |
url = 'https://groker.init.st/api/buckets?accessKey=' + ACCESS_KEY + '&bucketKey=' + bucketKey + '&bucketName=' + bucketName | |
r = requests.get(url=url) | |
return r |
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 Adafruit_DHT | |
from ISStreamer.Streamer import Streamer | |
import time | |
# --------- User Settings --------- | |
SENSOR_LOCATION_NAME = "Office" | |
BUCKET_NAME = ":partly_sunny: Room Temperatures" | |
BUCKET_KEY = "rt0129" | |
ACCESS_KEY = "PLACE YOUR INITIAL STATE ACCESS KEY HERE" | |
MINUTES_BETWEEN_READS = 10 |
OlderNewer