Difference between revisions of "ESPEasy"

From Let's Control It
Jump to navigation Jump to search
Line 119: Line 119:
  
 
'''Timezone Offset''' Offset in hours to GMT. In the Netherlands this should be '1'
 
'''Timezone Offset''' Offset in hours to GMT. In the Netherlands this should be '1'
 +
 +
'''DST''' Daylight Saving Time. Must be set manually when DST is active to adjust the time.
  
 
'''Syslog IP''' Enter your syslog server IP if you have one running and want to debug something.
 
'''Syslog IP''' Enter your syslog server IP if you have one running and want to debug something.
  
'''Syslog level''' Level of log messaging to the web gui. Can be set between 0 - 4 (0=no logging, 1=error, 2=error+info, 3=error+info+debug, 4=error+info+more debug)
+
'''Syslog level''' Level of log messaging to the syslog server. Can be set between 0 - 4 (0=no logging, 1=error, 2=error+info, 3=error+info+debug, 4=error+info+more debug)
  
 
'''UDP port''' This is used for communication between ESP unit's. 65500 is just a sample. Use a number that does not conflict with other systems on your network as the ESP uses broadcast messages.
 
'''UDP port''' This is used for communication between ESP unit's. 65500 is just a sample. Use a number that does not conflict with other systems on your network as the ESP uses broadcast messages.
Line 137: Line 139:
 
'''Custom CSS''' Tick this box to use a custom CSS (style sheet). You must first upload a "esp.css" file one to use this.
 
'''Custom CSS''' Tick this box to use a custom CSS (style sheet). You must first upload a "esp.css" file one to use this.
 
<span style="color:red">The CSS filesize can not exceed 4 kbyte!</span>.
 
<span style="color:red">The CSS filesize can not exceed 4 kbyte!</span>.
 
  
 
= Serial Commands =
 
= Serial Commands =

Revision as of 16:14, 20 February 2016

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 R78 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.

Loading firmware

Tutorial_ESPEasy_Firmware_Upload

Protocol selection

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

EasyProtocols

Configuration

To get you on track with the ESP Easy, we provide a tutorial to demonstrate the basics Tutorial_Domoticz_Switch For all further applications, please check their respective wiki page Applications


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 will explain all configuration pages and settings:

Main page

ESPEasy Main.png

This is an informational page that provides some technical and operational parameters. The bottom half shows a node list of all known ESP units that are running in your network (this is optional and needs to be configured in tools/advanced) The list only shows live systems.


Config page

Main settings can be found under "Config" page.

ESPEasy Config.png

Name Can be set to an easy to remember name for this system. Can also be used in MQTT communication templates.

Admin Password Can be set if you want to protect your system config with a password.

SSID Wifi network SSID

WPA Key The key used on your Wifi Access Point

WPA AP Mode Key The key that ESP Easy will use if it starts as a Wifi Access Point to set the first time configuration

Unit nr Each ESP Easy unit needs a unique number in the range 1-31. This is important for MQTT connections and the Node list! Do not forget to set this field to a non-zero value, not conflicting with other units.

Protocol Select the protocol for your Home Automation controller or webservice like ThingSpeak.

Locate Controller You can set the controller based on it's DNS hostname or it's IP address.

Controller IP/Hostname Set IP or hostname for the controller

Controller Port Set the TCP port used on your controller or webservice.

Sensor Delay Set the delay between sensor reporting in seconds.

Sleep Mode Tick this field to use the ESP in deepsleep mode for low power operation.

Optional

ESP IP You can set a static IP for this ESP unit. Set to 0.0.0.0 to use DHCP

ESP GW If using a static IP, enter the gateway (not needed if no connection to internet is needed!)

ESP Subnet Enter the local used subnet, usually 255.255.255.0

ESP DNS Enter you local DNS server IP address. Usually the IP of your local internet router.

Hardware page

ESPEasy Hardware.png

SDA Select the data pin used for I2C communications.

SCL Select the clock pin used for I2C communications.

Pin mode x Select an optional boot state for this pin, either output low or high

I2C is a well known standard to let multiple devices communicate over just two wires (and ground). We use it to connect sensors to ESP Easy. You can connect multiple sensors to the same two wires. Don't forget to use pull-up resistors on both SDA and SCL, unless one of your sensors already has them mounted on board.

Devices page

ESPEasy Devices.png

This is a list of tasks that the ESP Easy will perform. A sensor needs to be defined here to get the values send to your controller.

After selecting a new device, press the ? button to get specific help on this device!

Most common mistake if your values remain 0: The ESP Easy mainly targets Domoticz and the internal framework is entirely build upon the IDX field. This needs to match Domoticz. If you run a different protocol, it can be any value but must be non-zero. Just choose '1' in those cases...

Tools page

ESPEasy Tools.png

Some maintenance tools.


Tools Advanced page

ESPEasy Tools Advanced.png

Subscribe Template Used for MQTT subscription. Selecting a MQTT protocol will automatically fill this field

Publish Template Used for MQTT publishing. Selecting a MQTT protocol will automatically fill this field It is also used for the Generic HTTP protocol. Create your custom template here.

Message Delay To prevent overloading your controller or webservice, a delay between reports can be set. Defaults to 1000 milliseconds. For ThingSpeak, you need to set this to 15000! to have multiple sensor readings working

Fixed IP Octet Special network config where the ESP starts with DHCP to get the basic network config and then sets the last octet to a fixed IP.

Use NTP To enable internal software clock, synchronized using internet time.

NTP Hostname Can be left empty as it defaults to pool.ntp.org. Can be changed here if needed.

Timezone Offset Offset in hours to GMT. In the Netherlands this should be '1'

DST Daylight Saving Time. Must be set manually when DST is active to adjust the time.

Syslog IP Enter your syslog server IP if you have one running and want to debug something.

Syslog level Level of log messaging to the syslog server. Can be set between 0 - 4 (0=no logging, 1=error, 2=error+info, 3=error+info+debug, 4=error+info+more debug)

UDP port This is used for communication between ESP unit's. 65500 is just a sample. Use a number that does not conflict with other systems on your network as the ESP uses broadcast messages. If you have a syslog server running, do not enter 514 here!. This fields needs to be non-zero to have the node list running.

Serial log level Level of log messaging to the serial port. Can be set between 0 - 4 (0=no logging, 1=error, 2=error+info, 3=error+info+debug, 4=error+info+more debug)

Web log level Level of log messaging to the web gui. Can be set between 0 - 4 (0=no logging, 1=error, 2=error+info, 3=error+info+debug, 4=error+info+more debug)

Baud Rate Serial port baud rate

WD I2C Address I2C address to send watchdog messages to. Experimental feature to feed a ATTiny based external watchdog.

Custom CSS Tick this box to use a custom CSS (style sheet). You must first upload a "esp.css" file one to use this. The CSS filesize can not exceed 4 kbyte!.

Serial Commands

It is possible to configure your esp Easy by the web graphical interface, you can also use some commands to configure it using the serial console. These commands are provided to assist in emergency situatons where you cannot get access to the web gui.

The following commands can be used by the esp easy.

Debug Set the debug level. 1: Error 2: Info 3: Debug 4: Debug more. "Debug 4" sets the debug level to debug_more.

IP Set a static ip adres.

WifiSSID Set the SSID of your homenetwork. "WifiSSID yournetworkname"

WifiKey Set the WPA key of your homenetwork "WifiKey yoursecretkey"

WifiAPKey Set the spa key of this esp unit. This key needs to be used by clients when they want to connect in AP modus.

WifiScan Scan for active wifi networks. This can be used to test if your wifi is recognized and to verify whether the wifi part is working or not.

WifiConnect Connect to wifi.

WifiDisConnect Disconnect from your wifi network.

Reboot Reboot esp module

Reset Reset the esp module to it's defaults. It uses the values from the sketch when it's uploaded.

Save Save changes to the esp's EEPROM

Settings Show the current settings stored in the esp's EEPROM