ESP8266 D1 Mini not controlling pins with Blynk

Super new and trying to get up and running with a ESP8266 D1 Mini and Blynk.

I have two sketches, one where the D3 pin works and and another, with Blynk, in which it does not.

Setup, I have a D1 Mini with an LED in D3 and ground pins.

// This sketch works fine.
// The LED connected to Pin D3 on the D1 Mini blinks as it should.
void setup() {
  pinMode(D3, OUTPUT); 

void loop() {
  digitalWrite(D3, HIGH); 
  Serial.println("LED On");

  digitalWrite(D3, LOW);
  Serial.println("LED Off");

Now, If I swap out the following code and upload it to the D1 Mini, and I use my simple Bylnk app with a single virtual pin (V0) to attempt to turn the LED on and off I get the following results.

  1. It Successfully connects and talks to the Blynk app
  2. When I press the button on the Blynk app
    a. the Built in LED (LED_BUILTIN) turns on and off correctly when my Blynk app button is pressed.
    b. The D3 pin is always HIGH and the LED does not change it stays lit.
// This sketch is based on the example Sketch:  Blynk -> Blynk.Edgent -> Edgent_ESP8266
#define BLYNK_DEVICE_NAME "Starter"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial

#define APP_DEBUG

#include "BlynkEdgent.h"

void setup()
  pinMode(D3, OUTPUT); 


void loop() {;

  int pinValue = param.asInt();
  Serial.print("Blynk Write V0: ");

  if (pinValue == 1) {
    digitalWrite(D3, HIGH); // Turn LED on.
    digitalWrite(LED_BUILTIN, LOW);
    Serial.println("-- HIGH");
  } else {
    digitalWrite(D3, LOW); // Turn LED off.
    digitalWrite(LED_BUILTIN, HIGH);
    Serial.println("-- LOW");

I get the following output in the Serial Monitor when the button is pressed 3 times:

Blynk Write V0: 1
Blynk Write V0: 0
-- LOW
Blynk Write V0: 1

D3 is io 0 and Blynk.Edgent uses it for a button:

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