2

I am uploading a simple Blynk cloud example code to control a led on GPIO2 of my esp01 board.

#define BLYNK_TEMPLATE_ID ""
#define BLYNK_DEVICE_NAME ""

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
//#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"

BLYNK_WRITE(V0)
{
 int pinValue = param.asInt();
  Serial.println("Value Change");
  digitalWrite(2,pinValue); 
}
void setup()
{
  pinMode(2,OUTPUT);
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();
}

when I run it for the first time it works flawlessly, it gets configured easily with Blynk app and i am able to control the led. but, when I reboot my esp01 it does not store the credentials and again starts the code from beginning!! I think I am not able to get out of programming mode. Please help me out !! Thanks

2
  • 1
    try to add WiFi.persistent(); and WiFi.setAutoConnect();. it was the default until esp8266 Arduino version 3, but now both are off by default
    – Juraj
    Commented May 1, 2023 at 7:58
  • @Juraj but it works fine for my nodemcu? So do you think it is the real prob? Commented May 2, 2023 at 15:00

0

Your Answer

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

Browse other questions tagged or ask your own question.