Help with ESP-01 relay module (Possibly Non Blynk Related)

That is an option… but they can easily be used as standalone as well

I have one running a DHT11 & DS18B20, (and I even managed an LED on GPIO2, the same pin as the DS18B20 :stuck_out_tongue_winking_eye: with a direct pin controlled button as discussed above. Since the DS18B20 is called on a timer, the LED doesn’t actually interfere)

Well, if you are able to flash sketches via the Arduino IDE, then you should have no problem getting it to work with Blynk. Although due the hassle of always hooking it up to a TTL-USB adapter for said flashing, I highly recommend you use a sketch setup for OTA each time, that way you can keep reprogramming it via OTA.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266mDNS.h>  // For OTA
#include <WiFiUdp.h>  // For OTA
#include <ArduinoOTA.h>  // For OTA
char auth[] = "xxxxxxxxxx";
char ssid[] = "xxxxxxxxxx";
char pass[] = "xxxxxxxxxx";
BlynkTimer timer;

void setup()
{
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, UpTime);
  ArduinoOTA.setHostname("ESP-01 Test");  // For OTA
  ArduinoOTA.begin();  // For OTA
}


void UpTime()
{
  Blynk.virtualWrite(V0, millis() / 1000);  // Display Widget on V0 for UpTime in Seconds (use / 60000 for minutes)
  Blynk.virtualWrite(V1, WiFi.RSSI());  // Display Widget on V1 for RSSI strength
}


void loop()
{
  Blynk.run();
  timer.run();
  ArduinoOTA.handle();  // For OTA
}

2 Likes