Difference between revisions of "ESPEasy"

From Let's Control It
Jump to navigation Jump to search
(46 intermediate revisions by 5 users not shown)
Line 12: Line 12:
 
| style="width:18%; font-size:95%;" |
 
| style="width:18%; font-size:95%;" |
 
* [[ESP Hardware|ESP Hardware]]
 
* [[ESP Hardware|ESP Hardware]]
* [[Devices|Devices]]
+
* [[Devices|Supported Sensors/Actuators]]
 
* [[Modded Hardware|Modded Hardware]]
 
* [[Modded Hardware|Modded Hardware]]
 
| style="width:35%; font-size:95%;" |
 
| style="width:35%; font-size:95%;" |
Line 20: Line 20:
 
| style="width:25%; font-size:95%;" |
 
| style="width:25%; font-size:95%;" |
 
* [[History of ESP Easy|History of ESP Easy]]
 
* [[History of ESP Easy|History of ESP Easy]]
* [[PMilestonesRoadmap|Milestones/Roadmap]]
+
* [[MilestonesRoadmap|Milestones/Roadmap]]
 
* [[Contributors|Contributors]]
 
* [[Contributors|Contributors]]
 
|}
 
|}
Line 33: Line 33:
 
= Get started =
 
= Get started =
  
Getting started with the ESP Easy takes a few basic steps. In most cases your ESP module comes with the AT firmware or the NodeMCU LUA firmware. We need to replace the existing firmware with the ESP Easy firmware. We provide a (Windows only) flashtool to make this process an easy job.
+
Getting started with the ESP Easy takes a few basic steps. In most cases your ESP module comes with the AT firmware or the NodeMCU LUA firmware. We need to replace the existing firmware with the ESP Easy firmware. We provide a (Windows only) flashtool to make this process an easy job. Below you find the general flow of this but an in [[Basics:_Connecting_and_flashing_the_ESP8266|depth guide is found here]].
  
 
<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">
 
<div class="center" style="width: auto; margin-left: auto; margin-right: auto;">
Line 44: Line 44:
 
<br/><span style="font-size:60%">Note necessity for GPIO to be LOW to enter flashmode</span>
 
<br/><span style="font-size:60%">Note necessity for GPIO to be LOW to enter flashmode</span>
 
<br/>&darr;<br/>
 
<br/>&darr;<br/>
<span style="color: white; background:#0077dd">4. Restart ESP. WiFi <nowiki />"AP ESP_0" will appear</span>
+
<span style="color: white; background:#0077dd">4. Restart ESP. WiFi AP <nowiki />"ESP_Easy_0" will appear</span><br/>(prior to 2.0 the AP was named ESP_0)
 +
<br/><span style="font-size:60%">If you're not automatically taken to the log-in page, browse to 192.168.4.1</span>
 
<br/>&darr;<br/>
 
<br/>&darr;<br/>
 
<span style="color: white; background:#0077dd">5. Search for you routers WiFi and connect</span>
 
<span style="color: white; background:#0077dd">5. Search for you routers WiFi and connect</span>
Line 51: Line 52:
 
</div>
 
</div>
  
= Supported Hardware =
+
= [[ESP_Hardware|Supported Hardware]] =
  
ESP Easy can be installed/flashed on nearly every piece of Hardware that has an ESP8266 built-in, newest 2.0.0 version even does support the ESP8285 (basically an ESP8266 with buildtin 1M Flash). Please see the list [[ESP Hardware|here]] for more in depth detail about the hardware.
+
ESP Easy can be installed/flashed on nearly every piece of Hardware that has an ESP8266 built-in, newest 2.0.0 version even does support the ESP8285 (basically an ESP8266 with built-in 1M Flash). Please see the list [[ESP Hardware|here]] for more in depth detail about the hardware.
  
 
= [[Devices|Supported Sensors/Actuators]] =
 
= [[Devices|Supported Sensors/Actuators]] =
Line 59: Line 60:
 
The in depth list of devices (sensors and actuators) is found [[Devices|here]].
 
The in depth list of devices (sensors and actuators) is found [[Devices|here]].
  
= OLD Supported Sensors/Actuators List =
+
= [[Modded_Hardware|Modded Hardware Products]] =
 
 
This list is being migrated to the new list found [[Devices|here]].
 
 
 
{| class="wikitable"
 
!colspan="2" style="font-size:24px; color:white; background-color: black;"|Sensors (Input)
 
|-
 
 
 
 
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Distance || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Switch
 
|-
 
| [[DistanceSensor | HC-SR04]] [[File:HC-SR04.jpg|100px|link=]] || [[Switch | Switch]] [[File:Lightswitch.jpg|100px|link=]] [[File:Door Switch.png|100px|link=]] [[File:PIR.jpg|100px|link=]]
 
|-
 
 
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Analog || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| More Analog
 
|-
 
| [[ Analog | Analog]] [[File:Analog.png|100px|link=]] || [[PCF8591 | PCF8591]] [[File:PCF8591Module.jpg|100px|link=]]<br/>[[ADS1115 | ADS1115]] [[File:ADS1115.jpg|100px|link=]]
 
|-
 
 
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Digital inputs || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Infrared Receivers
 
|-
 
| [[MCP23017 | MCP23017]] [[File:MCP23017DIP28.jpg|100px|link=]]<br/>[[PCF8574 | PCF8574]] [[File:PCF8574.jpg|100px|link=]]  || [[IR | IR]] [[File:TSOP4838.png|100px|link=]]
 
|-
 
 
 
 
 
| style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Motion
 
|-
 
| [[MPU6050 | MPU 6050]] [[File:Mpu-6050.jpg|80px|link=]]
 
|-
 
 
 
 
 
 
 
{| class="wikitable"
 
!colspan="2" style="font-size:24px; color:white; background-color: black;"|Actuators (Output)
 
|-
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Digital output || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Servo
 
|-
 
| [[GPIO | Output pin]] [[File:LED.jpg|100px|link=]]<br/>[[Relais | Relays]] [[File:Relaisbordje.jpg|100px|link=]] || [[Servo | Servo]] [[File:Servo.png|100px|link=]]
 
|-
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| IR-Transmit || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Extra IO
 
|-
 
|[[IRTX | IR Led]] [[File:IRLED.png|100px|link=]] || [[MCP23017 | MCP23017]] [[File:MCP23017DIP28.jpg|100px|link=]]<br/>[[PCF8574 | PCF8574]] [[File:PCF8574.jpg|100px|link=]]
 
|-
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| PWM || style="font-size:16px; color:white; background-color: #0077dd;" align="center"|  Motor Shield
 
|-
 
| [[PCA9685 | PCA9685]] [[File:PCA9685Module.jpg|100px|link=]]<br/>[[PWM GPIO| PWM GPIO]][[File:MosFET.png|100px|link=]] || [["Adafruit_Motor_Shield_v2"| Adafruit Motor Shield v2]] [[File:Motor_shield_klein.jpg|100px|link=]]
 
|-
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Buzzer (RTTL) || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| 
 
|-
 
| [[Buzzer (RTTL) | RTTL]] [[File:buzzer.jpg|100px|link=]]
 
|}
 
 
 
 
 
{| class="wikitable"
 
!colspan="3" style="font-size:24px; color:white; background-color: black;"|Other
 
|-
 
|style="font-size:16px; color:white; background-color: #0077dd;" align="center"| LCD || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| OLED || style="font-size:16px; color:white; background-color: #0077dd;" align="center"| Level Shifter
 
|-
 
| [[LCDDisplay | LCD Display]] [[File:LCDDemo.jpg|100px|link=]] ||  [[OLEDDisplay | OLED Display]] [[File:OLED.png|100px|link=]] ||  [[Level Shifter | Level Shifter]] [[File:Level_shifter_example.jpg|100px|link=]]
 
|}
 
 
 
= Modded Hardware Products =
 
  
 
A list of (officially) modded hardware products is found [[Modded Hardware|here]].
 
A list of (officially) modded hardware products is found [[Modded Hardware|here]].
Line 127: Line 67:
 
* [[Tutorial_ESPEasy_Firmware_Upload | Using the flashtool to upload the ESP Easy firmware]]
 
* [[Tutorial_ESPEasy_Firmware_Upload | Using the flashtool to upload the ESP Easy firmware]]
 
* [[Tutorial_Arduino_Firmware_Upload | Using the Arduino IDE to upload the ESP Easy firmware]]
 
* [[Tutorial_Arduino_Firmware_Upload | Using the Arduino IDE to upload the ESP Easy firmware]]
 +
* [[EasySetup | How to setup ESPEasy after flashing it.]]
 +
 
* [[Tutorial_Domoticz_Switch | Using the ESP Easy as a simple input switch in Domoticz]]
 
* [[Tutorial_Domoticz_Switch | Using the ESP Easy as a simple input switch in Domoticz]]
 
* [[Tutorial_OpenHAB_Switch | Using the ESP Easy to control a LED of Relay from OpenHAB]]
 
* [[Tutorial_OpenHAB_Switch | Using the ESP Easy to control a LED of Relay from OpenHAB]]
Line 132: Line 74:
 
* [[EasyGlobalSync | GlobalSync ]]
 
* [[EasyGlobalSync | GlobalSync ]]
  
= Hardware Tips 'n Tricks=
+
= Loading firmware =
* [[Power | Power stability]]
+
 
* [[Relays | Relays]]
+
* Current stable: [http://www.letscontrolit.com/downloads/ESPEasy_R120.zip ESPEasy R120] (will be replaced by v2.0.0!)
* [[Breadboards | Breadboards]]
+
 
* [[Interference | WiFi interference]]
+
* Old release candidate: [http://www.letscontrolit.com/downloads/ESPEasy_R147_RC8.zip ESPEasy R147_RC8] (is now part of the dev build for v2.0.0)
 +
 
 +
* New release candidates are on github: [https://github.com/letscontrolit/ESPEasy/releases ESPEasy version 2.0  and higher]
 +
 
 +
* [https://www.letscontrolit.com/wiki/index.php/Basics:_Connecting_and_flashing_the_ESP8266 Connecting and flashing tutorial]
  
= Examples =
+
== 2.0+ firmware on 1MB modules ==
* [[Analog Pressure sensor | Analog Pressure Sensor]]
 
* [[DC Voltage divider | DC Voltage divider]]
 
  
= Loading firmware =
+
''If you are running the stock Mega edition firmware on 1MB modules, you will find that you can no longer load newer images because there's insufficient free space to upload the image (344kB as of 2.0.0.-Dev 9 edition). You can compile smaller images to solve this issue or use a small image that has been build just to upload newer images. So you would always have to use a two-step process to renew using OTA on 1MB modules. Using the uploader image as an in-between step, you can use images up to 604kB.''
  
* Current stable: [http://www.letscontrolit.com/downloads/ESPEasy_R120.zip ESPEasy R120]
+
[http://www.letscontrolit.com/downloads/ESPEasyUploaderMega.zip ESPEasyUploaderMega]
  
* Old release candidate: [http://www.letscontrolit.com/downloads/ESPEasy_R147_RC8.zip ESPEasy R147_RC8]  (is being replaced by version 2.0)
+
''The uploader uses SPIFFS so it uses the same configuration regarding SSID, WPA key and IP. It will connect to your Wifi network as usual, but it will only present this small web page:
 +
''
  
* New release candidates are on github: [https://github.com/letscontrolit/ESPEasy/releases ESPEasy version 2.0  and higher]
+
[[File:ESPUploader.png]]
  
 
[[Tutorial_ESPEasy_Firmware_Upload]]
 
[[Tutorial_ESPEasy_Firmware_Upload]]
  
= Protocol selection =
+
=== Compile your own firmware (Platformio) ===
 +
 
 +
If you want to compile your own firmware (with unreleased plugins etc.) you do pretty much the same as the [[Tutorial building and uploading with platformio|development method]] except that you only need to download extra plugins on the side. Just follow the official guide found [[Tutorial building and uploading with platformio|here]].
 +
 
 +
= [[EasyProtocols|Protocol selection]] =
  
 
The ESP Easy supports several Home Automation controllers or web-services that collect sensor data.
 
The ESP Easy supports several Home Automation controllers or web-services that collect sensor data.
Line 158: Line 107:
 
[[EasyProtocols]]
 
[[EasyProtocols]]
  
= Configuration =  
+
= [[Configuration]] =  
This section tells you more about the ESPeasy setup and the ESP unit's need to know settings (GPIO boot states etc.).
+
The ESP8266 boards are generally easy to use and understand but some precautions need to be taken when it comes to the different GPIOs available. This [[Configuration|section]] tells you more about the ESPeasy setup and the ESP unit's need to know settings (GPIO boot states etc.).
 
 
== GPIO on ESP8266 ==
 
 
 
{| class="wikitable sortable"
 
|-
 
! GPIO Number
 
! GPIO Name
 
! Boot State
 
! Precautions and information
 
|-
 
| 0
 
| D3
 
| HIGH for boot<br/>LOW for serial programming
 
| Pullup resistor on most boards
 
|-
 
| 1
 
|
 
|
 
| style="background: orange; black: white;" | Used as serial (TX)<br/>May be used but observe that signal might flicker due to serial activity during boot.
 
|-
 
| 2
 
| D4
 
| HIGH for boot<br/>HIGH for serial programming
 
| Connected to onboard LED (low active)<br/>Used as serial1 (TX1)
 
|-
 
| 3
 
|
 
|
 
| style="background: orange; black: white;" | Used as serial (RX)<br/>May be used but observe that signal might flicker due to serial activity during boot.
 
|-
 
| 4
 
| D2
 
|
 
| Generally used as SDA (I2C)
 
|-
 
| 5
 
| D1
 
|
 
| Generally used as SCL (I2C)
 
|-
 
| 6
 
|
 
|
 
| style="background: red; color: white;" | Do not use!<br/>Reserved for SPI + flash
 
|-
 
| 7
 
|
 
|
 
| style="background: red; color: white;" | Do not use!<br/>Reserved for SPI + flash
 
|-
 
| 8
 
|
 
|
 
| style="background: red; color: white;" | Do not use!<br/>Reserved for SPI + flash
 
|-
 
| 9
 
| D11
 
|
 
| style="background: red; color: white;" | Do not use!<br/>Reserved for SPI + flash
 
|-
 
| 10
 
| D12
 
|
 
| style="background: orange; black: white;" | Use with caution!<br/>Reserved for SPI + flash
 
|-
 
| 11
 
|
 
|
 
| style="background: red; color: white;" | Do not use!<br/>Reserved for SPI + flash
 
|-
 
| 12
 
| D6
 
|
 
|
 
|-
 
| 13
 
| D7
 
|
 
|
 
|-
 
| 14
 
| D5
 
|
 
|
 
|-
 
| 15
 
| D8
 
| LOW for boot
 
| Pulldown resistor on most boards
 
|-
 
| 16
 
| D0
 
|
 
| No PWM. No internal pullup available. Used in sleep mode for wakeup
 
|-
 
  
|}
+
= [[ESP Easy web interface|ESP Easy web interface]] =
 
 
= ESP Easy web interface =
 
 
The ESP Easy has a user-friendly web interface for all configuration settings. They are locally stored in flash memory and retained on power-off.
 
The ESP Easy has a user-friendly web interface for all configuration settings. They are locally stored in flash memory and retained on power-off.
 
We explain all configuration pages and settings [[ESP Easy web interface|here]].
 
We explain all configuration pages and settings [[ESP Easy web interface|here]].
  
= Command Reference =
+
'''<span style="color:red">Do NOT expose the ESP Easy web interface directly to the internet, always make sure that the web interface is only reachable from "trusted/local" networks!</span>'''
 +
 
 +
= [[ESPEasy Command Reference|Command Reference]] =
  
 
[[ESPEasy Command Reference]]
 
[[ESPEasy Command Reference]]
  
= System variables Reference =
+
= [[ESPEasy System Variables|System variables Reference]] =
  
 
[[ESPEasy System Variables]]
 
[[ESPEasy System Variables]]
  
= Tutorial Rules =
+
= [[Tutorial Rules|Tutorial Rules]]=
[[Tutorial Rules]]
+
Most information on rules (=local logic on ESP without controller) can be found in the tutorials. Rules are a great way of tweaking the ESP Easy firmware to do exactly what you want without the need to tinker with any source code.
 +
 
 +
More on how is found on the [[Tutorial Rules]] page.
 +
 
 +
= Hardware Tips 'n Tricks=
 +
* [[Power | Power stability]]
 +
* [[Relays | Relays]]
 +
* [[Breadboards | Breadboards]]
 +
* [[Interference | WiFi interference]]
  
Most information on rules (=local logic on ESP without controller) can be found in the tutorial
+
= Examples =
 +
* [[Analog Pressure sensor | Analog Pressure Sensor]]
 +
* [[DC Voltage divider | DC Voltage divider]]
  
 
= Support and discussion =
 
= Support and discussion =
Line 279: Line 143:
 
* [http://www.letscontrolit.com/forum/ Forum]
 
* [http://www.letscontrolit.com/forum/ Forum]
 
* IRC: #espeasy @freenode
 
* IRC: #espeasy @freenode
 +
* Slack (for Wiki talk): [https://espeasywiki.slack.com ESP Easy Wiki]
  
 
== Source code development ==
 
== Source code development ==
Line 292: Line 157:
 
* Then you're ready for: [[Tutorial building and uploading with platformio]]
 
* Then you're ready for: [[Tutorial building and uploading with platformio]]
 
* And eventually, if you did the github stuff: [[Tutorial Contributing Back To ESPEasy]]
 
* And eventually, if you did the github stuff: [[Tutorial Contributing Back To ESPEasy]]
 +
 +
= Hardware page =
 +
<span style="color: red>For older versions, the Hardware page has now moved to:</span> [[ESP Easy web interface#Hardware page]]!

Revision as of 20:01, 17 October 2017

Welcome to ESP Easy,
the open source firmware for ESP8266.

Introduction

The ESP Easy firmware can be used to turn the ESP module into an easy multifunction sensor device for Home Automation solutions like Domoticz. Configuration of the ESP Easy is entirely web based, so once you've got the firmware loaded, you don't need any other tool besides a common web browser.

The ESP Easy firmware is currently at build R120 an looks stable enough for production purposes as long as it's being used as a sensor device.

ESP Easy also offers limited "low level" actuator functions but due to system instability, this could be less useful in real life applications.

Get started

Getting started with the ESP Easy takes a few basic steps. In most cases your ESP module comes with the AT firmware or the NodeMCU LUA firmware. We need to replace the existing firmware with the ESP Easy firmware. We provide a (Windows only) flashtool to make this process an easy job. Below you find the general flow of this but an in depth guide is found here.

1. Download firmware as binary including flash tool

2. Connect the ESP to Windows PC
Using either USB/UART of board or separate USB/TTL adapter

3. Write firmware using flash tool
Note necessity for GPIO to be LOW to enter flashmode

4. Restart ESP. WiFi AP "ESP_Easy_0" will appear
(prior to 2.0 the AP was named ESP_0)
If you're not automatically taken to the log-in page, browse to 192.168.4.1

5. Search for you routers WiFi and connect

6. Reconnect to your WiFi and enter IP adress shown on previous screen

Supported Hardware

ESP Easy can be installed/flashed on nearly every piece of Hardware that has an ESP8266 built-in, newest 2.0.0 version even does support the ESP8285 (basically an ESP8266 with built-in 1M Flash). Please see the list here for more in depth detail about the hardware.

Supported Sensors/Actuators

The in depth list of devices (sensors and actuators) is found here.

Modded Hardware Products

A list of (officially) modded hardware products is found here.

Tutorials

Loading firmware

  • Old release candidate: ESPEasy R147_RC8 (is now part of the dev build for v2.0.0)

2.0+ firmware on 1MB modules

If you are running the stock Mega edition firmware on 1MB modules, you will find that you can no longer load newer images because there's insufficient free space to upload the image (344kB as of 2.0.0.-Dev 9 edition). You can compile smaller images to solve this issue or use a small image that has been build just to upload newer images. So you would always have to use a two-step process to renew using OTA on 1MB modules. Using the uploader image as an in-between step, you can use images up to 604kB.

ESPEasyUploaderMega

The uploader uses SPIFFS so it uses the same configuration regarding SSID, WPA key and IP. It will connect to your Wifi network as usual, but it will only present this small web page:

ESPUploader.png

Tutorial_ESPEasy_Firmware_Upload

Compile your own firmware (Platformio)

If you want to compile your own firmware (with unreleased plugins etc.) you do pretty much the same as the development method except that you only need to download extra plugins on the side. Just follow the official guide found here.

Protocol selection

The ESP Easy supports several Home Automation controllers or web-services that collect sensor data.

EasyProtocols

Configuration

The ESP8266 boards are generally easy to use and understand but some precautions need to be taken when it comes to the different GPIOs available. This section tells you more about the ESPeasy setup and the ESP unit's need to know settings (GPIO boot states etc.).

ESP Easy web interface

The ESP Easy has a user-friendly web interface for all configuration settings. They are locally stored in flash memory and retained on power-off. We explain all configuration pages and settings here.

Do NOT expose the ESP Easy web interface directly to the internet, always make sure that the web interface is only reachable from "trusted/local" networks!

Command Reference

ESPEasy Command Reference

System variables Reference

ESPEasy System Variables

Tutorial Rules

Most information on rules (=local logic on ESP without controller) can be found in the tutorials. Rules are a great way of tweaking the ESP Easy firmware to do exactly what you want without the need to tinker with any source code.

More on how is found on the Tutorial Rules page.

Hardware Tips 'n Tricks

Examples

Support and discussion

Source code development

Sources are on Github

Want to contribute? Anyone is invited to do so, but please read this first: ESPEasyDevelopmentGuidelines

If you're new to this, follow these guides:

Hardware page

For older versions, the Hardware page has now moved to: ESP Easy web interface#Hardware page!