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...
{$
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?
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?
//#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 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.
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.