This for anyone who would like to setup ESP Easy for a LCTech Relay X2 board. Thanks for the guys here for making this happen and helping me getting it working with my relay board.
I got mine from ICStation.com:
http://www.icstation.com/esp8266-wifi-c ... 12593.html
My model came with a ESP-01 NOT with a PUYA flash chip. But the firmware is PUYA compatible, so it should work with an ESP-01 with PUYA
This is how my board looks like:
- IMG_20180508_085722.jpg (383.79 KiB) Viewed 124186 times
And the back of the board:
- IMG_20180508_085740.jpg (411.79 KiB) Viewed 124186 times
Flash ESPEasy_1M_128kSPIFFS_PUYA.bin firmware to the ESP-01. You can find the link to the firmware on Page 12 post #120 of this thread.
Perform the basic settings of the ESP Easy (wifi, etc.)
I set LCTech as my unit name (it will be important for MQTT later):
- Esp_main.png (19.79 KiB) Viewed 124186 times
Add the following in the Device section:
- ESP_device.png (53.75 KiB) Viewed 124186 times
Of course your can rename the Relay0, Relay1 names at the bottom. Ignore Relay2.
I set up MQTT with the following settings:
- esp_controller.png (50.08 KiB) Viewed 124186 times
Save the settings and power cycle the relay board. When I power up the board, the red LED (D7) is lit and after a few seconds the green LED (D6) starts flashing. And it will stay that way. The board is ready to receive commands. So far I am controlling it via HTTP and MQTT the following way:
HTTP commands:
Relay 0 Off: http://ESP_IP/control?cmd=relay,0,0
Relay 0 On: http://ESP_IP/control?cmd=relay,0,1
Relay 1 Off: http://ESP_IP/control?cmd=relay,1,0
Relay 1 On: http://ESP_IP/control?cmd=relay,1,1
MQTT commands:
Topic: /LCTech/cmd (of course this may change depending on the Unit name)
Payload:
Relay 0 Off: relay,0,0
Relay 0 On: relay,0,1
Relay 1 Off: relay,1,0
Relay 1 On: relay,1,1
With the above setup, you will be getting MQTT messages on /LCTech/Relay/Relay0 or /LCTech/Relay/Relay1 topic with payload of 0 or 1 when the relay status is changed either via HTTP or MQTT. There is no status message back via HTTP. Keep in mind that this is not based on the actual status of the relay, as the MCU is not sending status information / confirmation back to ESP.