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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <string.h> | |
// Update with values suitable for your network. | |
const char* mqtt_server = "pine64"; | |
WiFiClient espClient; | |
PubSubClient client(espClient); | |
long lastMsg = 0; |
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
/* | |
Just s simple script to test some particle stuff on the Oak | |
*/ | |
// this makes the Oak only automatically connect to wifi, not particle | |
SYSTEM_MODE(SEMI_AUTOMATIC) | |
// the setup function runs once when you reset or power the board | |
void setup() | |
{ |
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
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#include <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
#include <elapsedMillis.h> |
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
/* | |
Door Monitor | |
Monitors a reed switch for an open door, and posts to particle. | |
Created 2 June 2016 | |
Updated 17th October | |
by Peter Feerick | |
*/ | |
const int LED_PIN = 1; //The LED is connected to P1 on the Oak |
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
//SEMI_AUTOMATIC mode to ensure variable is available | |
//Probably isn't needed if you don't use Particle.variable in your code | |
SYSTEM_MODE(SEMI_AUTOMATIC); | |
#include <ESP8266WiFi.h> | |
char myIpString[24]; | |
IPAddress myIp; | |
void setup() |
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
#!/bin/bash | |
read -p "Please enter the path of your USB-Serial Adapter (ex: /dev/ttyUSB0):" comport | |
read -p "Ensure Oak is attached as shown here and press a key: digistump.com/wiki/oak/serialupdate" -n1 -s | |
echo | |
echo "Updating..." | |
python esptool.py --baud 115200 --port $comport write_flash -fs 32m 0x1000 blank.bin 0x2000 firmware_v1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin | |
echo "Done!" | |
read -n1 -s -t3 |
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
SYSTEM_MODE(MANUAL); | |
#include <ESP8266WiFi.h> | |
//Static IP stuff | |
char SSID[] = "yournetwork"; // your network SSID | |
char passwd[] = "yourpassword"; // your network password | |
//WiFi config stuff | |
IPAddress ip(192, 168, 0, 70); //your static IP |
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
SYSTEM_MODE(MANUAL); | |
#include <ESP8266WiFi.h> | |
//Static IP stuff | |
char SSID[] = "yournetwork"; // your network SSID | |
char passwd[] = "yourpassword"; // your network password | |
void setup() | |
{ |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include <string.h> | |
// Update with values suitable for your network. | |
const char* mqtt_server = "pine64"; | |
WiFiClient espClient; | |
PubSubClient client(espClient); | |
long lastMsg = 0; |
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
#!/bin/bash | |
set -e | |
DISTRO="" | |
if hash apt-get 2>/dev/null; then | |
DISTRO=debian | |
fi | |
if [ -z "$DISTRO" ]; then |
OlderNewer