ESP Board Setup
Quick Start Quide - AP Point
- Serial port will output verbose debug information, step by step
- If you want to reset back to factory mode, press BTN2 but be caurful of the high voltage. Board will reset, restart and show up AP mode again.
|Power up your board||
|Connect to "ESP-Relay-Board" (or similar) it with no password||your phone will then ask you to sign in by pop-up message||-|
|Configure wifi with scan, click show up wifi list and click your Wifi SSID||-||-|
|Config following information 1. connect to local wifi setup||
|Config following information 2. MQTT part setup (keep default)||
|Config following information 3. Setup your module topic ID||
|Finish configuration||Board led blink means MQTT server connected and ready to be used successfully|
APP Control and Commands
- Use any MQTT app (for exampe MyMqtt) to control, configure MQTT app server
- Only need to provide server address iot.electrodragon.com (IP address 184.108.40.206, old one is but not working anymore 220.127.116.11), in APP configuration, default port 1883
- Subscribe to your own command topic, for example, if you make your board name "1234", then the full topic name will be "ESP_1234" for example
- Please make sure the ID name is unique and complex, better use numbers instead of words
- The following is for ESP Relay control board.
|ESP Relay Board||1_ON||Turn on onboard relay 1|
|ESP Relay Board||1_OFF||Turn off onboard relay 1|
|ESP Relay Board||2_ON||Turn on onboard relay 2|
|ESP Relay Board||2_OFF||Turn off onboard relay 2|
- The following is for ESP LED strip board.
- To use local WLAN command control, you must first know the led board IP address
|ESP LED strip board||#00ff00||turn light to green.|
|ESP LED strip board||192.168.0.111\rgb\00ff00||turn light to green. 192.168.0.111 is board IP address|
Optional Setup by ESPeasy + Domoticz
domoticz setup by HTTP
- Install https://domoticz.com/downloads/ normally in windows
- after installtion, open webpage to setup
- add "hardware" - > "dummy" - virtual switch
Create "device" switch
- after created hardware, creat "devices" -> you can click "Create Virtual Sensors"
- Setup -> type switch, name any
- back to menu switches, edit this switch, ON action set to http command -> http://192.168.1.109/control?cmd=gpio,13,1
- OFF action same to http://192.168.1.109/control?cmd=gpio,13,0
- Both relay can be setup, in switches manu, click the bulb to checkout if can work or not, or use domoticz app
Create "device" DHT22 sensor
- click "Create Virtual Sensors" again -> create temp+hum type sensor device
- very important to remember to IDX number, this should be later set in espeasy - device - your DHT22 sensor setup
- Data should appear soon on server page too.
- Espeasy can easily read the sensor value, support mutiple protocols like domoticz, openhab
- File:ESPEasy R120.zip , upload
- Restart board and connect to AP point esp_0, config to your wifi router, notice the new IP address of board will popup after config, read more about setup espeasy here.
Setup DHT22 sensor
- Place DHT22 sensor into board, "as how it looks like", just fit the place
- In device config page, device -> see attached image
- In device config page, hardware -> set GPIO14 to input
- Domoticz hardware setup of IDX/VAR for DHT22 normally is 237, switch relay is 100, this must be input, otherwise won't work
Device control via HTTP
- Simple command http://192.168.1.109/control?cmd=gpio,13,1
- Complex setup
Quick Start Quide (Smart-Config, old)
- Config Steps
|0. Power up||
|2. finish smartconfig||
|3. Config your mqtt server||
Server: m13.cloudmqtt.com User: jtpfneeq Password : 4Og5kJ5WYQYT Port: 14967
|4. General commands test||
|5. Check mac address for unique control||
There are three ways:
|6. Switch to Mac IC control mode||
|7. use station mode control||
|0.2 seconds very fast blink||board is getting IP address from router, no IP address yet|
|5.0 seconds very slow blink||connected to wifi, connect to mqtt server, wait for commands|
|0.5 seconds blink||wait for smartconfig|
In board config files for mqtt:
- mqtt_server_1.lua, mqtt_server_2.lua - including server configuration details
- wifi_config.txt - your wifi name and password
- check_mode.txt - check if your board use mac control or not
Demo code and update Log
- Download R3 firmware here File:Relay board 20161118.zip
- mqtt sever info saved in mqtt_config.txt file
- After smartconfig, ssid and password saved in config.txt, when power up will always use this setup for wifi
- support to switch to unique ID (chipID) mode control by sending commands "chipID+ON" (162243ON) to ID topics
- File:Esp relay board firmware r3.1.zip, new firmware implemented on board from 4th Feburary 2017.
- Including two servers config, in ID control mode, send commands "server1" or "server2" to swtich, or edit file "check_server.txt" change 1 for server1, or 2 for server2
- server 1 "mc" is mqttcloud free server, server 2 "sg" is Singarpore server, optimized for Asia area too.
- Websocket debugging, login to cloudmqtt, please use your own server config (lua file mqtt-config.lua), see the screenshot on right
- Commands can also send directly via websocket interface
- Debugging info can be read when you use it.
NodeMCU custom build by frightanic.com branch: master commit: c8037568571edb5c568c2f8231e4f8ce0683b883 SSL: false modules: dht,enduser_setup,file,gpio,mqtt,net,node,tmr,uart,wifi build built on: 2016-03-29 10:06 powered by Lua 5.1.4 on SDK 1.4.0 set up wifi mode > Waiting for smartconfig, IP unavailable.. Waiting for smartconfig, IP unavailable.. Waiting for smartconfig, IP unavailable.. Waiting for smartconfig, IP unavailable.. Success. SSID: hcwork ; PASSWORD: electrodragon Waiting for smartconfig, IP unavailable.. Waiting for smartconfig, IP unavailable.. Config done, IP is 192.168.43.134 Running file mqtt connected Light2: receive OFF liked data on light2 Light1: receive OFF liked data on light1 Light1: received message: ON@light1 Light1: receive OFF liked data on light1 Light2: received message: ON@light2 Light2: offline
Flash Firmware or Debugging
- No need to connect AC mains power, only use power from USB-TTL
- You will need USB-TTL tool e.g. CP2102, FT232RL, CH340 to upload firmware
- If you want to customize it, please contact via email@example.com
- Firmware can be found on this page, including arduino or nodemcu firmware.
- Notice to always use baudrate 115200 for debugging or uploading firmware
Enter into flashing mode
- No need to connect AC main power, only power from usb-ttl cable.
- Hold down BTN2 button
- Connect TX RX VCC 5V and GND wires of USB-TTL to board pins
- board powered up by USB-TTL(esp8266 module blue led blink, on board red led constantly on), now can release BTN2
- Get esp download tool from, flash .bin firmware file to board 0x00000, more instruction please see the page.
For nodemcu to upload sketch (old)
- Use script interpreter LUA as embedded system programming
- open Nodemcu flasher/esp download tool/esptool.py to upload this firmware, more details see here, see some guidelines here
- Restart module and upload lua scripts: LEDBlink.lua, init.lua, mqtt2.lua