Skip to content

Instantly share code, notes, and snippets.

@sidoh
sidoh / virtual_led_strip.groovy
Last active March 9, 2017 03:57
SmartThings virtual device to control a LEDENET Magic UFO LED Controller with the help of a few other modules
import static java.util.UUID.randomUUID
import java.security.MessageDigest
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Mac
import java.security.SignatureException
import groovy.json.JsonOutput
metadata {
// Automatically generated. Make future change here.
definition (name: "HaGateway Light", namespace: "smartthings", author: "SmartThings") {
import static java.util.UUID.randomUUID
import java.security.MessageDigest
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Mac
import java.security.SignatureException
import groovy.json.JsonOutput
metadata {
// Automatically generated. Make future change here.
definition (name: "HaGateway Camera", namespace: "smartthings", author: "sidoh") {
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
/**
* Control a Switch with an API call
*
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
import static java.util.UUID.randomUUID
import java.security.MessageDigest
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Mac
import java.security.SignatureException
import groovy.json.JsonOutput
metadata {
// Automatically generated. Make future change here.
definition (name: "HaGateway Camera", namespace: "smartthings", author: "sidoh") {
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
lib_deps =
RF24
SPI
WiFiManager
ArduinoJson
Vector
#!/usr/bin/env ruby
require 'open-uri'
require 'timeout'
require 'socket'
require 'net/http'
NUM_TRIALS = 1000
hits = 0
#include <GxEPD.h>
// select the display class to use, only one
//#include <GxGDEP015OC1/GxGDEP015OC1.cpp> // 1.54" b/w
// #include <GxGDEW0154Z04/GxGDEW0154Z04.cpp> // 1.54" b/w/r
// #include <GxGDEW0154Z04_Fast.cpp> // 1.54" b/w/r
//#include <GxGDE0213B1/GxGDE0213B1.cpp> // 2.13" b/w
//#include <GxGDEW0213Z16/GxGDEW0213Z16.cpp> // 2.13" b/w/r
// #include <GxGDEH029A1/GxGDEH029A1.cpp> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.cpp> // 2.9" b/w/r
@sidoh
sidoh / png_to_bitfield.rb
Created December 11, 2017 00:04
Convert a PNG to a black/white bitfield
#!/usr/bin/env ruby
require 'chunky_png'
bg_color = ChunkyPNG::Color.rgba(255, 255, 255, 0)
file = ARGV[0]
out_file = ARGV[1]
img = ChunkyPNG::Image.from_file(file)
@sidoh
sidoh / fast_ap_recreate.log
Created December 15, 2017 04:04
WiFi debug logs
287) wifi: mode=0
V (289) wifi: mode=0
V (291) wifi: type=8 p1=1 p2=254 p3=254 p4=0 p5=fefefefe
V (296) wifi: ioctl: sync
V (296) wifi: ioctl_process: flag=1 type=8 p1=1 p2=254 p3=254 p4=0 p5=fefefefe