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
// Needs a config.json file with slack and twitter keys/secrets/tokens. | |
// Sample config at end of file. | |
"use strict" | |
let util = require('util') | |
var Twitter = require('twitter'); | |
let config = require('./config.json'); | |
let async = require('async'); |
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
"use strict" | |
// Needs a config.json file with slack and twitter keys/secrets/tokens. | |
// Sample config at end of file. | |
let util = require('util') | |
var Twitter = require('twitter'); | |
let config = require('./config.json'); | |
let async = require('async'); | |
let fs = require('fs'); |
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
# You can start an influxDB + grafana instance through Docker + docker-compose: see my gist here: | |
# https://gist.github.com/alexellis/ce7253d48b6d5a83ca17790ea6249c9b | |
import time | |
from envirophat import weather, leds | |
from influxdb import InfluxDBClient | |
# set this variables, influxDB may well be localhost | |
host = "192.168.0.x" | |
port = 8086 |
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
# This file will download + start up InfluxDB and Grafana and configure them for you. | |
# Then head over to localhost:3000, password: admin/admin. | |
# Add a datasource for InfluxDB and then add a dashboard and pick the meaurements you want to see. | |
version: "2.0" | |
services: | |
influx: | |
image: influxdb | |
ports: | |
- "8083:8083" | |
- "8086:8086" |
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 debian:stretch | |
ENV LC_ALL en_US.UTF-8 | |
ENV LANG en_US.UTF-8 | |
RUN apt-get update && apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gconf2 \ |
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
# This script outputs sensor data to InfluxDB which can then be dashboard'd and graph'd through Grafana. | |
# The script runs on the Pi, Grafana + InfluxDB run on a PC through Docker or manually as installed applications. | |
# For using Docker on your PC use my docker-compose.yml file: https://gist.github.com/alexellis/ce7253d48b6d5a83ca17790ea6249c9b | |
# When Grafana is up + running, this JSON file contains the configured dashboard: | |
# https://gist.github.com/alexellis/74ec5f682d5790d4985c5d50b30bc3b5 | |
# This program is to be run on each Pi with Envirophat. |
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
{ | |
"id": 1, | |
"title": "Environment", | |
"tags": [], | |
"style": "dark", | |
"timezone": "browser", | |
"editable": true, | |
"hideControls": false, | |
"sharedCrosshair": false, | |
"rows": [ |
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
# Copyright Alex Ellis 2016 | |
# License: MIT | |
import RPi.GPIO as GPIO | |
import time | |
class distanceMeasure: | |
def __init__(self,trigger,echo): | |
self.GPIO_ECHO=echo | |
self.GPIO_TRIGGER=trigger |
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
# Copyright Alex Ellis 2016 | |
# License: MIT | |
import RPi.GPIO as GPIO | |
import time | |
class distanceMeasure: | |
def __init__(self,trigger,echo): | |
self.GPIO_ECHO=echo | |
self.GPIO_TRIGGER=trigger |
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
# Copyright Alex Ellis 2016 | |
# License: MIT | |
import RPi.GPIO as GPIO | |
import time | |
class distanceMeasure: | |
def __init__(self,trigger,echo): | |
self.GPIO_ECHO=echo | |
self.GPIO_TRIGGER=trigger |