Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Conway-Jones dceejay

View GitHub Profile
@dceejay
dceejay / main.cpp
Last active Jan 5, 2021
Wemos temperature monitor
View main.cpp
#include <Arduino.h>
/* DS18B20 Temperature sensors - Deep Sleep - with Wifi and MQTT
*
* Connections:
* D0 -- RST
* Uses the folowing platformio.ini file
[env:d1_mini]
platform = espressif8266
@dceejay
dceejay / README.md
Last active Feb 9, 2017
Plotting planes using dump1090 and worldmap.
View README.md
@dceejay
dceejay / rebuildPiKernel.sh
Created Jan 18, 2016
Rebuild/Patch Pi kernel for Pizero microUSB 3Port USB/Ethernet hub...
View rebuildPiKernel.sh
#!/bin/bash
# Rebuild Pi kernel
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo apt-get -y install gcc make bc ncurses-dev build-essential git
sudo apt-get -y autoremove --purge
sudo apt-get -y autoclean
git clone --depth 1 git://github.com/raspberrypi/linux.git
@dceejay
dceejay / nssm.md
Last active Apr 14, 2021
Running Node-RED as a service on Windows using NSSM
View nssm.md

Running Node-RED as a service on Windows using NSSM

These instructions assume you installed Node-RED from an administrator enabled command prompt using the npm install -g node-red command to do so.

As an administrator, install nssm from https://nssm.cc/download

And then from the directory where you installed nssm, run the commands

mkdir c:\temp
nssm install Node-RED "c:\Users\\"%USERNAME%"\AppData\Roaming\npm\node-red.cmd"
View gist:6f0742ddce6fa02d6f40
#include <Adafruit_NeoPixel.h>
#define PIN 4
int led = 13;
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
View gist:72d92bb5fba32b1bc83c
[{"id":"718554ed.8e7aac","type":"inject","name":"","topic":"","payload":"hello","payloadType":"string","repeat":"","crontab":"","once":false,"x":151,"y":457,"z":"6b5c7d92.94a384","wires":[["31a4d6ce.ce5b2a"]]},{"id":"31a4d6ce.ce5b2a","type":"tcp request","server":"192.168.1.10","port":"55555","out":"time","splitc":"100","name":"","x":353,"y":507,"z":"6b5c7d92.94a384","wires":[["4e62b5b1.b19d4c"]]},{"id":"4e62b5b1.b19d4c","type":"function","name":"only pass changes","func":"\ncontext.old = context.old || \"\";\nmsg.payload = msg.payload.toString();\n\nif (msg.payload !== context.old) {\n context.old = msg.payload;\n return msg;\n}\nreturn null;","outputs":1,"valid":true,"x":551,"y":566,"z":"6b5c7d92.94a384","wires":[["f43c9e61.0bc36"]]},{"id":"253b6ef0.dac492","type":"inject","name":"","topic":"","payload":"goodbye","payloadType":"string","repeat":"","crontab":"","once":true,"x":151,"y":532,"z":"6b5c7d92.94a384","wires":[["31a4d6ce.ce5b2a"]]},{"id":"f43c9e61.0bc36","type":"debug","name":"","active":true,
@dceejay
dceejay / pinodered.sh
Last active Aug 29, 2015
Pi Node-RED install (and run) script
View pinodered.sh
#! /bin/bash
### This is for Pi Version 1 ONLY
### Once it completes Node-RED should be ready to run...
### To do this all in one command... copy and paste just the following command
### curl -sL https://gist.githubusercontent.com/dceejay/250502b143efcdc57fed/raw/ | bash -
cd ~
sudo apt-get update && sudo apt-get install -y build-essential python-dev python-rpi.gpio
wget http://node-arm.herokuapp.com/node_0.10.36_armhf.deb
sudo dpkg -i node_0.10.36_armhf.deb
@dceejay
dceejay / pi2nodered.sh
Last active Aug 29, 2015
Pi 2 Node-RED install (and run) script
View pi2nodered.sh
#! /bin/bash
### This is for Pi Version 2 ONLY
### Once it completes Node-RED should be ready to run...
### To do this all in one command... copy and paste just the following command
### curl -sL https://gist.githubusercontent.com/dceejay/ab527322584c3600f293/raw/ | bash -
cd ~
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs
node -v
@dceejay
dceejay / Dockerfile
Last active Nov 24, 2020
Dockerfile for Node-RED
View Dockerfile
# Dockerfile for Node-RED - pulls latest master code from git
# Use the node.js v4 LTS engine
FROM node:4-slim
MAINTAINER ceejay
RUN mkdir -p /root/.node-red
WORKDIR /root/.node-red
# download latest stable node-red
RUN npm install -g --unsafe-perm node-red
@dceejay
dceejay / README.md
Last active Jan 2, 2016
Range node simple test flow
View README.md

Range Node Tester

Simple example to exercise the range node...