Randomnerdtutorials: ESP8266 Controlled with Android App (MIT App Inventor)

 

ESP8266 Controlled with Android App (MIT App Inventor)

 

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

const char *ssid = "KMTRONIC";
const char *password = "12345678";

ESP8266WebServer server(80);

const int led = D0;

void handleRoot() {
 digitalWrite(led, 1);
 server.send(200, "text/plain", "hello from esp8266!");
 digitalWrite(led, 0);
}

void handleNotFound(){
 digitalWrite(led, 1);
 String message = "File Not Found\n\n";
 message += "URI: ";
 message += server.uri();
 message += "\nMethod: ";
 message += (server.method() == HTTP_GET)?"GET":"POST";
 message += "\nArguments: ";
 message += server.args();
 message += "\n";
 for (uint8_t i=0; i<server.args(); i++){
 message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
 }
 server.send(404, "text/plain", message);
 digitalWrite(led, 0);
}

void setup(void){
 pinMode(led, OUTPUT);
 digitalWrite(led, 0);
 Serial.begin(115200);
 WiFi.mode(WIFI_STA);
 WiFi.begin(ssid, password);
 Serial.println("");

// Wait for connection
 while (WiFi.status() != WL_CONNECTED) {
 delay(500);
 Serial.print(".");
 }
 Serial.println("");
 Serial.print("Connected to ");
 Serial.println(ssid);
 Serial.print("IP address: ");
 Serial.println(WiFi.localIP());

if (MDNS.begin("esp8266")) {
 Serial.println("MDNS responder started");
 }

server.on("/", handleRoot);

server.on("/ON1", [](){
 server.send(200, "text/plain", "this works as well");
 digitalWrite(led, 0);
 });

server.on("/OFF1", [](){
 server.send(200, "text/plain", "this works as well");
 digitalWrite(led, 1);
 });

server.onNotFound(handleNotFound);

server.begin();
 Serial.println("HTTP server started");
}

void loop(void){
 server.handleClient();
}

 

 

Randomnerdtutorials: ESP8266 Controlled with Android App (MIT App Inventor)
Randomnerdtutorials: ESP8266 Controlled with Android App (MIT App Inventor)

 

 

Melissa – control your AC from your smartphone

We receive for test Melissa AC Control unit

 

How it works?
After you have connected Melissa to your home Wi-Fi network, you will be able to send her commands and receive information about the current temperature and humidity at home through the Internet. When Melissa receives your command, she sends Infrared signals to your AC to change its settings.

More info:
http://seemelissa.com/en/melissa/meet-melissa

 

Melissa - control your AC from your smartphone
Melissa – control your AC from your smartphone

 

Melissa - control your AC from your smartphone
Melissa – control your AC from your smartphone

Save money and control your Air Conditioner remotely, schedule your home comfort with timers or just let your Melissa do it for you! Wi-Fi for all brands Air Conditioner.

Melissa - control your AC from your smartphone
Melissa – control your AC from your smartphone

 

M Melissa Climate

https://play.google.com/store/apps/details?id=at.cloudfaces.melissa&hl=en

 

Irdroid – Rpi infrared transceiver for Raspberry Pi

Irdroid-Rpi infrared transceiver for Raspberry Pi

 

LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls.

http://www.lirc.org

1.  Install:

sudo apt-get install lirc

2.  Setting:

In example I use Irdroid – Rpi infrared transceiver for Raspberry Pi 

from http://www.irdroid.com/irdroid-rpi-infrared-transceiver

 

Add this to your /etc/modules file:

sudo nano /etc/modules
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17

My file:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
i2c-bcm2708
i2c-dev
w1-gpio
w1-therm
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
etc/modules file
etc/modules file

3. Change your /etc/lirc/hardware.conf file to:

########################################################
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--uinput"

# Don't start lircmd even if there seems to be a good config file
# START_LIRCMD=false

# Don't start irexec, even if a good config file seems to exist.
# START_IREXEC=false

# Try to load appropriate kernel modules
LOAD_MODULES=true

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="devinput"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""
########################################################

 

4. Start using:

sudo /etc/init.d/lirc start

sudo /etc/init.d/lirc stop

5. Read RAW remote codes:

sudo lircd -d /dev/lirc0
mode2 -d /dev/lirc0

6 . Press any button your remote

7. Result:

space 5514491
pulse 8888
space 4396
pulse 576
space 570
pulse 555
space 529
pulse 557
space 551
pulse 567
...
...
...