BlynkEdgent and NodeMCU v.01 - problem D8(GPIO15)

Hi, guys.
Found a problem with the NodeMCU v.0.1 board (esp-12E). In the Blynkedgent when port D8 (GPIO15) is used it does not respond to the digitalWrite(15, 1). The port is not set to HIGH. In another sketch without Blynkedgent, the same port works fine. What could be the problem, maybe someone has solved this?

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPL2K_Nz6Lo"
#define BLYNK_DEVICE_NAME "Garage"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial

#define APP_DEBUG

 #include "BlynkEdgent.h"

void setup()
{
  Serial.begin(115200);
  delay(100);
  pinMode(2, OUTPUT);    
  digitalWrite(2, LOW);  

  pinMode( 16, OUTPUT );  
  pinMode( 12, OUTPUT );
  pinMode( 15, OUTPUT );

  digitalWrite( 16, 1 ); 
  digitalWrite( 12, 1 );
  digitalWrite( 15, 1 );
  delay( 100 );

 BlynkEdgent.begin();
}

unsigned long value = 0;
int st = 0;

void loop() {
  BlynkEdgent.run();
  if ( millis() - value >= 2000 ){
    value = millis();
    st = !st;
    digitalWrite(2, st );  
    Serial.println( st );
    digitalWrite( 15, st );
  }  
}

Artem.

If you take a look at the settings.h tab in the ESP8266 edgent example, you’ll see that it defines the pins used for the onboard LED, depending on the board type you chose in the .ino file.

All NodeMCUs that I’ve come across have an LED attached to GPIO2, and some also have one attached to GPIO16.

The settings.h file seems to expect an RGB LED attached to D8, D7 and D6 ( GPIOs 15,13 & 12) and there’s no mention of the actual LED on GPIO2…

#if defined(USE_NODE_MCU_BOARD)

  #warning "NodeMCU board selected"

  // Example configuration for NodeMCU v1.0 Board
  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN_R             D8
  #define BOARD_LED_PIN_G             D7
  #define BOARD_LED_PIN_B             D6
  #define BOARD_LED_INVERSE           false
  #define BOARD_LED_BRIGHTNESS        64

I raised this as an issue during beta testing, but it’s still the same in the current version…

You might want to create a custom board definition that uses the correct GPIO2 LED and doesn’t mess about with the other GPIOs.

Pete.

1 Like

I also paid attention to this. The LED in my board is on gpo2. But the changes you suggested did not help. D8 - does not work. Although D6, D7 work great anyway.

Artem.

Everything worked fine. This is my fault, I did not pay attention to //#define USE_NODE_MCU_BOARD
Thank you, Pete.

Artem.