Esp8266 WIFI Relay Modules

I bought this model from the internet and programmed ESP-01 to toggle GPIO pin 0 and GPIO pin 2. However, none of these worked. I tried searching on the internet how to control these modules using local webserver and had no luck. Would you please help?

Seller didn't give you the code?
And yes, there's another MCU on that board, just to control the relay. No idea why.

void switchRelayOn() {
  Serial.write(0xa0);
  Serial.write(0x01);
  Serial.write(0x01);
  Serial.write(0xa2);
}

void switchRelayOff() {
  Serial.write(0xa0);
  Serial.write(0x01);
  Serial.write(0x00);
  Serial.write(0xa1);
}

wvmarle:
And yes, there's another MCU on that board, just to control the relay. No idea why.

I wondered the same thing when I saw them. Unnecessarily complex and expensive.

As your code shows, easy enough to use, but the cheaper (and more compact) modules are perfectly fine.

Aliexpress item

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.