Original by chriscook8 from esp8266.com I just modified to use ESP8266WebServer library for easy to handle the http request.
This is sample code not yet complete.
- when Wifi connected need to close the softAP.
/* | |
* This sketch demonstrates how to use ESP8266 to control Xiaomi Yi Camera. | |
* | |
* @author Emmanuel Granatello | |
* @version 0.1 | |
* @since 2016-02-16 | |
*/ | |
#include "ESP8266WiFi.h" | |
// https://github.com/urish/arduino-slack-bot | |
#include <Arduino.h> | |
#include <Hash.h> | |
#include <ESP8266WiFiMulti.h> | |
#include <ESP8266HTTPClient.h> | |
#include <WebSocketsClient.h> | |
#include <ArduinoJson.h> | |
#define WIFI_SSID "接続したいSSID" |
// 80MHZ NODEMCU V.1 | |
// slackbot testing using https://github.com/urish/arduino-slack-bot | |
/** | |
Arduino Real-Time Slack Bot | |
Copyright (C) 2016, Uri Shaked. | |
Licensed under the MIT License | |
*/ |
#include <IRremoteESP8266.h> | |
//#include <IRremote.h> | |
int RECV_PIN = 14; | |
IRrecv irrecv(RECV_PIN); | |
void setup ( ) | |
{ | |
Serial.begin(115200); | |
irrecv.enableIRIn(); |
/* | |
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server. | |
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE): | |
* | |
* - https://github.com/adafruit/Adafruit_ADS1X15 | |
* | |
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software: | |
* | |
* https://github.com/esp8266/Arduino | |
* |
// CPU 80MHZ, FLASH 4M/1M | |
/* | |
*** Sample using esp-01, D16 is connected to RST | |
*** If DHT22 is powered by a gpio( VCC of DHT22 is connected to a gpio) and OUTPUT of DHT22 is connected to D2, boot will fail. | |
*** Power off ----> D2 is in LOW( == DHT22 is in LOW) ==> SDIO boot mode. | |
Temperature and humidity values are each read out the results of the last measurement. | |
For real-time data that need continuous read twice, we recommend repeatedly to read sensors, | |
and each read sensor interval is greater than 2 seconds to obtain accuratethe data. |
#include <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
int senderId; | |
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 | |
//Contacts from the radio to connect NRF24L01 pinamnam -> Arduino |
<?php | |
//Options | |
$token = 'YOUR_TOKEN_HERE'; | |
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE'; | |
$channel = '#general'; | |
$bot_name = 'Webhook'; | |
$icon = ':alien:'; | |
$message = 'Your message'; |
/* | |
* XSS filter | |
* | |
* This was built from numerous sources | |
* (thanks all, sorry I didn't track to credit you) | |
* | |
* It was tested against *most* exploits here: http://ha.ckers.org/xss.html | |
* WARNING: Some weren't tested!!! | |
* Those include the Actionscript and SSI samples, or any newer than Jan 2011 | |
* |