LC tech ESP8266 relay board "all in one"

367 views
Skip to first unread message

sergey

unread,
Oct 31, 2019, 3:36:14 PM10/31/19
to MppDevices
Hi,
I have bought one of esp8266 relay board 'all in one'. It  attracted my by its sizes that exactly matches to one of my cases. At the beginning it seemed very nice ,the shape and sizes exactly fitted to my case, but when device arrived turns out that everything is not so simple. Turns out that the relay management doesn't serviced over standard ESP GPIO but over additional Nuvoton N76E003AT20 microcontroller, that interact with ESP over UART.As it typically for chinese relay board there is optocoupler for relay managing. For the simplicity sace i could be spit on the Nuvoton and connect ESP GPIO directly to the optocoupler diode ,but the current seems me too high for GPIO (it's about 29ma) and second .. maybe there is more subtle approach ? I have soldered UART connector and uploaded MppRelay. Now i able to see the AT commands that Nuvoton sends to ESP ( i don't know for what), chinese reference says that  
"Control command for relay(hex format):
Open relay:A0 01 01 A2
Close relay:A0 01 00 A1"
but i have very shaky idea how to send them to Nuvoton. Sending something like '0xA0' '0x01' '0x00' '0xA1' doesn't leads to anything.
Have anybody familiar with such additional microcontroller? Any ideas ?



Lone Surviver

unread,
Oct 31, 2019, 3:59:43 PM10/31/19
to MppDevices
The onboard esp chip is probably programmed AT commands typical of Espressif
I have similar relays and use them only AT command programming.
To send the A0 01 01 A2 commands I use an Android app called EasyTCP
the ip address is probably 192.168.4.1
Is that what you are looking for?

Lone Surviver

unread,
Oct 31, 2019, 4:04:53 PM10/31/19
to MppDevices
Also Sergey where did you get this and what cost $$$  ???
I think it's way cool.

sergey

unread,
Oct 31, 2019, 4:06:13 PM10/31/19
to MppDevices
not really... i'm trying to merge MppRelay and N76E003AT20 microcontroller  for managing relay not over GPIO but over  N76E003AT20's commands.

Mike P 4 MPP

unread,
Oct 31, 2019, 4:12:32 PM10/31/19
to MppDevices
Yeah, I was thinking that too - those characters would need to be set over TCP as AT commands.  But once you re-flash the ESP it won't work anymore...
Seems like overkill to use an additional CPU (N76E003AT20 is an 8051 chip) with an ESP8266...  but it's similar what sonoff did with the Sonoff-Dual though so it may be the same here.
My guess would be the N76E003AT20 is connected to the ESP8266 using one of the serial ports so you'll need to know the messages that it's expecting.  If they're using the default serial port it's hard to debug because you have to decouple the USB connection :( to send/receive.  You might get lucky and it's using those characters by passing them through, but you'll still need to know the BUAD rate, character size (probably 8) and start/stop bits.

sergey

unread,
Oct 31, 2019, 4:15:55 PM10/31/19
to MppDevices

sergey

unread,
Oct 31, 2019, 4:29:24 PM10/31/19
to MppDevices
I wandered for what reason they have done it ?   As i suppose the baud rate is 9600 and communication has to be like :
uint8_t msg[4];
    msg[0] = 0xA0; // starting byte
    msg[1] = relayId;
    msg[2] = state; // on - off
    msg[3] = msg[0] + msg[1] + msg[2]; //control summ
It's from Espurna's forum.

Mike P 4 MPP

unread,
Nov 1, 2019, 9:40:52 AM11/1/19
to MppDevices
That's the data, but you'd also need to setup a serial port to send it.  If they've got it working for Espurna you may be able to get it sorted with a mashup of that code with the serial setup and relay on/off, and maybe MppSonoffDual or MppCSE7788 as the base (both of which do serial setup).  Or just use the Espurna code if it's all outgoing requests - if there's no button or need for AM to detect changes the slower Espurna polling is fine.
I didn't see anything about an 8051 on the product page, where is it mentioned?

sergey

unread,
Nov 1, 2019, 10:17:28 AM11/1/19
to mppde...@googlegroups.com
You know, i decided not reinvent the wheel . Anyway the circuit seems absolutely stupid at the point of energy consumption. There are 3 step down converters from 220 to 12 , 12 to 5 and 5 to 3V.  It seems to me that they has inherited this circuit from the past. Definitely they doesn't have such a wonderful system like Mpp may be it was the reason why the have to use the 8051.
What i eventually did: unsolder R22 resistor (cut connection to managing out N76E003AT20) added resistor 1.1K connecting GPIO and optocouple (that manage relay). Current through GPIO turns to be 1.2ma, MppRelay perfectly works in classic mode as well.
Reply all
Reply to author
Forward
0 new messages