28
HOME AUTOMATION BY ESP8266 GLEB VINNIKOV

R0boCamp2016 Гліб Вінніков Home automation by ESP8266

Embed Size (px)

Citation preview

Page 1: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

HOME AUTOMATION BY

ESP8266

GLEB VINNIKOV

Page 2: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

I AM

• Many years in IT :)

• FullStack Developer

• JavaScript, NodeJS, AngularJS, etc …

• Independent contractor/IT Expert/CTO

• Pet projects: IoT, Arduino, Hardware, etc …

Page 3: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

PLAN

• Already finished

• Habits

• Standard tasks

Page 4: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

PRODUCTION

• A lot of communications

• Constant changes

• Interference

Page 5: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

???

• Beginners

• Documentations

• Examples on github/stackoverflow

• Ready projects

• Easy toolchains, IDE

• Large community

• Cheap

• Wide specifications

• Flexible

Page 6: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

ESP8266

• http://espressif.com

• http://bbs.espressif.com/

• CPU: Tensilica L106 32-bit micro controller

• Operating Voltage: 3.0 ~ 3.6V

• Operating Current: ~80mA

Page 7: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

ESP8266 FAMILY

• ESP01 - 12

• Form factors

• Diff. antennas

• Flash memory 512K-4M

Page 8: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

WI-FI

• Wi-Fi: 802.11 b/g/n

• Wi-Fi mode: station/softAP/SoftAP+station, WPA/WPA2, WEP/TKIP/AES

• Types of Antenna: PCB Trace, External, IPEX Connector, Ceramic Chip

Page 9: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

NETWORK PROTOCOLS

• IPv4

• TCP

• UDP

• HTTP/HTTPS

• FTP

Page 10: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

PERIPHERAL BUS

• UART

• SDIO

• SPI

• I2C

• I2S

• GPIO

• ADC

• PWM

Page 11: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

ESPRESSIF

FIRMWARES

• http://bbs.espressif.com

• AT commands

• SDK> AT > OK

> AT+GMR > AT version:0.60.0.0(Feb 2 2016 18:43:31) SDK version:1.5.2(80914727) compile time:Feb 2 2016 18:59:50 OK

Page 12: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

NODEMCU

FIRMWARES

• http://nodemcu.com/

• LUA

• NodeMCU DevKit

• http://esp8266.ru/esplorer/

• Libs <

• need much more memory

• upload by file

Page 13: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

ARDUINO

FIRMWARES

• Arduino IDE

• C/C++

• Libs >

• https://github.com/esp8266/Arduino

• gitter community!

• load common bundle

Page 14: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

FIRMWARES

• MicroPython

• https://github.com/micropython/micropython

• cesanta/mongoose-iot

Page 15: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

TOOLCHAINS

• esptool.py

• https://github.com/nodemcu/nodemcu-flasher

• Espressif

Page 16: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

TOOLCHAINS

• Arduino IDE

• http://platformio.org/

• http://codebender.cc

• http://www.blynk.cc/

Page 17: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

FIRMWARE UPGRADE

• UART Download

• OTA (via network if 2x RAM)

Page 18: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

DEV BOARDS

• ready dev boards

• adapters

• FDTI

Page 19: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

DARK SIDE

• Power consumptions: up to 170Ma

• Stability

• Range distance

Page 20: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

WHAT’S NEXT?

• Work without i-net

• Network, routing , VPN, port forwarding

• Heterogeneous env

• Device management (DHCP, DNS, Provisioning)

• Automatization

• Visualization

• Access from inside/outside

• Web/mobile

Page 21: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

HA SERVERS

• create IoT network

• home-assistant.io

• openhab.org

• http://freedomotic.com/

Page 22: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

HOME ASSISTANT

• http://home-assistant.io

• Opensource

• Python

• Win, Mac, Ubuntu, RPI, …

• Components >

• Mobile, Desktop

• Automate

Page 23: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

COMMUNICATION

Page 24: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

MQTT

• MQ Telemetry Transport

• Lightweight

• PubSub

• QoS

• TCP based

Page 25: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

HTTP VS MQTT

HTTP

• Overhead

• No QoS

MQTT

• Lightweight

• QoS

• TCP based

http://stephendnicholas.com/posts/power-profiling-mqtt-vs-https

Page 26: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

MQTT SOFT

• Mosquitto - Open Source MQTT

• Clients for all langs

• Mob. apps

• Browser extensions`

• cloudmqtt.com

• https://thingmq.com/

Page 27: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

MORE EXAMPLES!

Page 28: R0boCamp2016  Гліб Вінніков  Home automation by ESP8266

THANKS!

• http://www.slideshare.net/glebvinnikov

[email protected]

• https://twitter.com/Gleb_V