0

I recently purchased an ESP8266 WI-FI which looks similar to this but is actually this one with the extra row of pins by the serial lines. I'm following along with the instructions on the first page but wondering if the relay can be actuated over the serial console instead of installing the EasyTCP_20 app?

I've tried sending the "Relay ON" command (in Linux) over the serial line in a couple different ways:

printf 'AT %s\r\n' \x0A\x01\x01\xA2 > /dev/ttyUSB0

and right from within the Arduino Serial Monitor application from my desktop but I just get ERROR back from the ESP. Do I need power on the IN+ and IN- pins on the board or will the relay get power from the 5v pin next to the serial pins?

2
  • Are you sure the command is correct? As typed, in bash, this results in AT x0Ax01x01xA2 being sent. And if the \x were interpreted (if you used $''syntax: $'\x0A\x01\x01\xA2'), then \x0a is a line-feed (the same as \n) so it would seem pretty weird inside an AT command. Do you have a link to the documentation of the protocol/commands?
    – jcaron
    May 2, 2022 at 8:50
  • Ah, I see the commands you are referring to on the page you linked to. Note it's A0 not 0A, but that seems to be data to be sent over TCP rather than within an AT command. From what I understand, the ESP8266 is just acting as a WiFi-to-serial bridge, so the easiest way of doing this is probably to bypass the 8266 completely and connect to the STC15F104W directly. It seems to me the RXD/TXD pins you connect to are actually on the interface between the ESP8266 and the other MCU, you probably need to switch RX/TX (since you want to talk to the other MCU, not the 8266) and just send the raw bytes.
    – jcaron
    May 2, 2022 at 9:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.