Blynk Provisioning always goes to reset mode by itself

Hi all Blynk user , I tried Provisioning before and never getting error like this. Now I start new project using Provisioning method as before but no matter how My code is(Even default code on Export demo), It keep going to reset mode(Like when I press and Hold Flash button). I am using nodeMCU.

Here is output i get. Please help me to solve this problem.

chksum 0x2d
csum 0x2d
v3de0c112
~ld
[21484] 
[21484] Hardware v1.0.0
[21484] Firmware v1.0.1
[23133] AP SSID: Our Product
[23134] AP IP:   192.168.4.1
[23134] AP URL:  our-product.cc
[51403] WAIT_CONFIG => CONFIGURING
[63789] WiFi SSID: xxx Pass: xxx
[63789] Blynk cloud: 3ea93b52e1ec4d2ea09c8f4f6c50dfa4 @ blynk-cloud.com:8442
[63798] CONFIGURING => SWITCH_TO_STA
[63798] Switching to STA...
[64948] SWITCH_TO_STA => CONNECTING_NET
[64948] Connecting to WiFi: Tola
[69150] CONNECTING_NET => CONNECTING_CLOUD
[69151] Disconnected
[69151] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.8 on NodeMCU

[69157] Connecting to blynk-cloud.com:8442
[69440] Ready (ping: 1ms).
[69558] CONNECTING_CLOUD => RUNNING
[69594] Configuration stored to flash
[69595] Hold the button to reset configuration...
{$

@Phyruos which version of the Arduino core are you using?

You might want to downgrade to 2.3.0 if you are not already using it.

I don’t know about it. I going to check it and will update this issues latter.

I’m using arduino AVR board 1.6.17 and ESP8266 2.3.0. Is it what you suggested me or please give more information because i’m newbies here.

Are you using Template_ESP8266 or myPlant_ESP8266? It needs to be the former.

Yes this is fine, don’t upgrade as there is a bug that stops Blynk provisioning from working.

I use Template_ESP8266

I still getting this error. First time only when i press button on Blynk app (D0, D3, …) it show up Hold the button to reset configuration... {$
and it work just fine like i press flash button without holding it. but after period of time (2 min or more or sometime as soon as Blynk connected to server) It reset itself and create wifi ssd … as it should what reset mean. So how can i solve this?

Reset means clear SSID, PWD and Blynk token from ESP.

Yes but I didn’t touch hardware button. And it’s not hardware side because i test it on several nodeMCU including my old nodeMCU and just no Idea what going on. I don’t do update to arduino IDE but i got window update earlier, Is it the the problem?

It’s neither. It’s the Board Manager that will not change from 2.3.0 in your IDE unless you make the change yourself, which you shouldn’t do until Blynk release an Android update for Arduino’s bug / Arduino fix their bug.

Have you tried a basic project with a single button, V0 in switch mode and provisioning?

Did you set the board to NcodeMCU in the Provisioning sketch?

Yes I uncomment nodeMCU.

Yes I tried it, same hardware reset to my nodeMCU.

Paste as 3 separate pieces of code the following files:

Template_ESP8266.ino
ConfigStore.h
Settings.h

Template_ESP8266.ino

    //#define USE_SPARKFUN_BLYNK_BOARD    // Uncomment the board you are using
    #define USE_NODE_MCU_BOARD        // Comment out the boards you are not using
    //#define USE_WITTY_CLOUD_BOARD
    //#define USE_CUSTOM_BOARD          // See "Custom board configuration" in Settings.h

    #define APP_DEBUG        // Comment this out to disable debug prints

    #define BLYNK_PRINT Serial
    #include <BlynkSimpleEsp8266.h>
    #include "BlynkProvisioning.h"

    void setup() {
      delay(500);
      Serial.begin(115200);

      BlynkProvisioning.begin();

    }

    void loop() {
      
      BlynkProvisioning.run();

    }

ConfigStore.h

    /**************************************************************
     * This is a DEMO. You can use it only for development and testing.
     *
     * If you would like to add these features to your product,
     * please contact Blynk for Business:
     *
     *                  http://www.blynk.io/
     *
     **************************************************************/

    struct ConfigStore {
      uint32_t  magic;
      char      version[9];
      uint8_t   flagConfig:1;
      uint8_t   flagApFail:1;
      uint8_t   flagSelfTest:1;

      char      wifiSSID[34];
      char      wifiPass[34];

      char      cloudToken[34];
      char      cloudHost[34];
      uint16_t  cloudPort;

      uint16_t  checksum;
    } __attribute__((packed));

    ConfigStore configStore;

    const ConfigStore configDefault = {
      0x626C6E6B,
      BOARD_FIRMWARE_VERSION,
      0, 0, 0,
      
      "",
      "",
      
      "invalid token",
      "blynk-cloud.com", 8442,
      0
    };

    #include <EEPROM.h>
    #define EEPROM_CONFIG_START 0

    void config_load()
    {
      EEPROM.get(EEPROM_CONFIG_START, configStore);
      if (configStore.magic != configDefault.magic) {
        DEBUG_PRINT("Using default config.");
        configStore = configDefault;
        return;
      }
    }

    bool config_save()
    {
      EEPROM.put(EEPROM_CONFIG_START, configStore);
      EEPROM.commit();
      return true;
    }

    bool config_init()
    {
      EEPROM.begin(sizeof(ConfigStore));
      config_load();
      return true;
    }

    void config_reset()
    {
      DEBUG_PRINT("Resetting configuration!");
      configStore = configDefault;
      config_save();
      BlynkState::set(MODE_WAIT_CONFIG);
    }

    template<typename T, int size>
    void CopyString(const String& s, T(&arr)[size]) {
      s.toCharArray(arr, size);
    }

setting.h


    #define BOARD_FIRMWARE_VERSION        "1.0.1"
    #define BOARD_HARDWARE_VERSION        "1.0.0"

    #define BOARD_NAME                    "Product Name"        // Name of your product. Should match App Export request info.
    #define BOARD_VENDOR                  "Company Name"        // Name of your company. Should match App Export request info.

    #define PRODUCT_WIFI_SSID             "Our Product"         // Name of the device, to be displayed during configuration. Should match export request info.
    #define BOARD_CONFIG_AP_URL           "our-product.cc"      // Config page will be available in a browser at 'http://our-product.cc/'

    /*
     * Board configuration (see examples below).
     */

    #if defined(USE_CUSTOM_BOARD)

      // Custom board configuration
      #define BOARD_BUTTON_PIN            0                     // Pin where user button is attached
      #define BOARD_BUTTON_ACTIVE_LOW     true                  // true if button is "active-low"

      #define BOARD_LED_PIN               2                     // Set LED pin - if you have a single-color LED attached
      //#define BOARD_LED_PIN_R           15                    // Set R,G,B pins - if your LED is PWM RGB 
      //#define BOARD_LED_PIN_G           12
      //#define BOARD_LED_PIN_B           13
      //#define BOARD_LED_PIN_WS2812      4                     // Set if your LED is WS2812 RGB
      #define BOARD_LED_INVERSE           false                 // true, if you need to inverse LED signal
      #define BOARD_RGB_BRIGHTNESS        32                    // 0..255 brightness control

    #elif 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_RGB_BRIGHTNESS        32

    #elif defined(USE_SPARKFUN_BLYNK_BOARD)

      #warning "Sparkfun Blynk board selected"
      
      // Example configuration for SparkFun Blynk Board
      #define BOARD_BUTTON_PIN            0
      #define BOARD_BUTTON_ACTIVE_LOW     true
      
      #define BOARD_LED_PIN_WS2812        4
      #define BOARD_RGB_BRIGHTNESS        32

    #elif defined(USE_WITTY_CLOUD_BOARD)

      #warning "Witty Cloud board selected"

      // Example configuration for Witty cloud Board
      #define BOARD_BUTTON_PIN            4
      #define BOARD_BUTTON_ACTIVE_LOW     true
      
      #define BOARD_LED_PIN_R             15
      #define BOARD_LED_PIN_G             12
      #define BOARD_LED_PIN_B             13
      #define BOARD_LED_INVERSE           false
      #define BOARD_RGB_BRIGHTNESS        32

    #else
      #error "No board selected"
    #endif


    /*
     * Advanced options
     */

    #define BUTTON_HOLD_TIME_INDICATION   3000
    #define BUTTON_HOLD_TIME_ACTION       10000

    #define BOARD_PWM_MAX                 1023

    #define WIFI_NET_CONNECT_TIMEOUT      30000
    #define WIFI_CLOUD_CONNECT_TIMEOUT    15000
    #define WIFI_AP_CONFIG_PORT           80
    #define WIFI_AP_IP                    IPAddress(192, 168, 4, 1)
    #define WIFI_AP_Subnet                IPAddress(255, 255, 255, 0)
    //#define WIFI_CAPTIVE_PORTAL_ENABLE

    #define USE_TICKER
    //#define USE_TIMER_ONE
    //#define USE_TIMER_THREE

    #if defined(APP_DEBUG)
      #define DEBUG_PRINT(...) BLYNK_LOG1(__VA_ARGS__)
    #else
      #define DEBUG_PRINT(...)
    #endif

@Gunner Hello Mr.Guuner I saw you made edit to my post but I can’t fine what different of before and after, I copy and past to existing Template_ESP8266.ino ConfigStore.h Settings.h and the problem still persist .

I just edited for a better visual of the posted code… the </> method doesn’t work as well at this:

I am not familiar enough with provisioning, so you will need to await @Costas advice.

@Phyruos is your problem:

  1. The process of provisioning your ESP is causing it to reset?

or

  1. An ESP that has already been provisioned is resetting?

I don’t know if the process cause it to reset or why, But within the same code I tried last month, No reset issues persist and holding flash btn to reset work perfect and now it isn’t work.

@Phyruos what I was trying to ask was does your ESP go through a process of resetting when you provision it or after you have provisioned it?

This case. After fill give wifi credential to ESP they try to connect to blynk and as soon as it connected to Blynk, It seem trying to reset itself and yes, it reset itself after a period of time.

Just read the code how sketch handles reset button… most probably it’a just inverted logic