SELECT
timestamp/1000 as time_sec,
data.value as value,
properties.value as metric
FROM data
LEFT JOIN properties ON (properties.entity_id = data.channel_id)
LEFT JOIN entities ON (entities.id = data.channel_id)
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#define DEBUG | |
// Wi-Fi Settings | |
const char* ssid = "freifunk-myk.de"; // your wireless network name (SSID) | |
const char* password = ""; // your Wi-Fi network password | |
WiFiClient client; | |
// ThingSpeak Settings |
This file contains hidden or 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
/** | |
* NeoClock | |
* | |
* Clock using 60 WS2812B/Neopixel LEDs and DS3231 RTC | |
* | |
* Libraries needed: | |
* * Adafruit NeoPixel (Library Manager) - Phil Burgess / Paint Your Dragon for Adafruit Industries - LGPL3 | |
* * Rtc by Makuna (Library Manager) - Michael C. Miller | |
* * Arduino Timezone Library (https://github.com/JChristensen/Timezone) - Jack Christensen - CC-BY-SA | |
* * Time Library (https://github.com/PaulStoffregen/Time) - Paul Stoffregen, Michael Margolis - LGPL2.1 |
This file contains hidden or 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
#!/bin/sh | |
#Taken from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md, here to allow for simple installation | |
#Use at your own risk. | |
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] |
This file contains hidden or 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
unsigned long last1 = 0; | |
unsigned long last2 = 0; | |
unsigned long lasts = 0; | |
unsigned int dur1 = 0; | |
unsigned int dur2 = 0; | |
byte tgt1 = 128; | |
byte tgt2 = 128; | |
void setup() { | |
Serial.begin(115200); |
This file contains hidden or 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
#include <Bounce2.h> | |
//Pin mapping | |
const byte LED[] = {2,4,3,5}; //Jepp, I screwed up while soldering ;) | |
const byte SW = 6; | |
const byte SYSLED = LED_BUILTIN; | |
//ATT: When powering on or switching voltages the output may provide +10V for a brief moment | |
const String volt[] = { |
This file contains hidden or 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
<?php | |
$port = STDIN; | |
$out = array(); | |
$b=0; | |
$dlc = -1; | |
$buffer = array(); | |
while(!feof($port)) { | |
$curByte = ord(fread($port, 1)); |
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#include <ESP8266HTTPClient.h> | |
#include <NMEAGPS.h> | |
#include <SoftwareSerial.h> | |
/** | |
* Required libs (see manager): | |
* - SoftwareSerial | |
* - NeoGPS | |
*/ |
This file contains hidden or 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
#include <LiquidCrystal.h> | |
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
const char *ssid = "freifunk-myk.de"; | |
const char *password = ""; | |
const char *netname = "esp-lcd"; |
This file contains hidden or 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
#include <ESP8266WiFi.h> | |
#include <ESP8266mDNS.h> | |
#include <PubSubClient.h> | |
const char* cfg_wifi_ssid = "freifunk-myk.de"; | |
const char* cfg_wifi_pwd = ""; | |
const char* mqtt_server = "deinserver.local"; | |
const unsigned int mqtt_port = 1883; |