Skip to content

Instantly share code, notes, and snippets.

@compilerexe
compilerexe / ESP8266-TCP.ino
Created June 21, 2015 18:15
ESP8266-TCP.ino
#include <ESP8266WiFi.h>
#include <WiFiServer.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <AsciiToString.h>
#define MAX_CLIENTS 1 // MAX Telnet client
/*=== Variable WiFi Static IP ===*/
const char* ssid = "__Your__SSID__"; // Change your name wifi
@compilerexe
compilerexe / config.js
Last active August 29, 2015 14:24
ESP8266_Convert_Watt
host = '_Your_IP_MQTT_'; // hostname or IP address
port = 9001;
topic = 'esp8266/18:fe:34:a6:f6:16/status'; // topic to subscribe to
useTLS = false;
username = null;
password = null;
// username = "jjolie";
// password = "aa";
cleansession = true;
#define DEBUG_MODE
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
#include <MqttWrapper.h>
#include <PubSubClient.h>
const char* ssid = "CMMC.47";
const char* pass = "guestnetwork";
@compilerexe
compilerexe / ESP8266_WiFi_AP_Config.ino
Last active August 29, 2015 14:25
ESP8266_WiFi_AP_Config
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
/*=== WiFiAccessPoint ===*/
const char* ssidAP = "__Your__WiFi__AP__"; // Change your name access point
const char* ssidPass = ""; // Change your password access point
const char* wifi_ip[4] = {"192", "168", "10", "200"}; // Change your ip local network
const char* wifi_subnet[4] = {"255", "255", "255", "0"}; // Change your subnet local network
const char* wifi_gateway[4] = {"192", "168", "10", "1"}; // Change your gateway local network
@compilerexe
compilerexe / SmartEmo.ino
Last active August 29, 2015 14:27
ESP8266-12 Config wifi on web browser / send message to MQTT
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
/*=== OLED ===*/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <ESP_Adafruit_SSD1306.h>
@compilerexe
compilerexe / MQTT.ino
Last active September 6, 2015 18:35
Publish and Subscribe
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char *ssid = "__Your_SSID_WiFi__";
const char *pass = "__Your_Password_WiFi__";
String MQTT_server("m11.cloudmqtt.com");
String MQTT_username = "sintilob";
String MQTT_password = "ZNUXlWaU6Emv";
String MQTT_topic = "compiler/data";
@compilerexe
compilerexe / Read_PushButton.ino
Last active October 5, 2015 14:00
Read push button and show led.
int ledPin = 14;
int pushButton_Pin = 12;
int value = 0;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(pushButton_Pin, INPUT);
}
@compilerexe
compilerexe / MQTT_Restaurant.ino
Last active January 1, 2016 15:30
MQTT Restaurant
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char *ssid = "__YOUR_WIFI_SSID__";
const char *pass = "__YOUR_WIFI_PASSWORD__";
String MQTT_server("__YOUR_MQTT_SERVER__");
/* MQTT_clienId USE ONE NUMBER TO ONE BOARD EXAMPLE TABLE-1 NOT USE DOUBLE NUMBER TABLE OTHER BOARD */
String MQTT_clienId = "__NUMBER_TABLE__";
String MQTT_username = "__YOUR_MQTT_USERNAME__";
@compilerexe
compilerexe / EEPROM_24LC256.ino
Created February 7, 2016 00:48
External I2C EEPROM to Arduino (24LC256)
#include <Wire.h>
#define disk1 0x50 //Address of 24LC256 eeprom chip
void setup(void)
{
Serial.begin(9600);
Wire.begin();
unsigned int address = 0;
#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <RTClib.h>
#include <DHT.h>
#include <ESP8266WiFi.h>
#include <Esp.h>
#include <EEPROM.h>
#include <WiFiClient.h>