• Hardware model NodeMCU + communication type.Wifi
• Smartphone OS (Android) + 8
• Blynk server or local server Blynk server
• Blynk Library version Latest
02:02:37.789 → [660] INIT => CONNECTING_NET
02:02:37.789 → [662] Connecting to WiFi: Red4mi
02:02:45.529 → [8398] Using Dynamic IP: 192.168.43.76
02:02:45.529 → [8398] CONNECTING_NET => CONNECTING_CLOUD
02:02:53.270 → [16159] Hold the button for 10 seconds to reset configuration…
02:03:04.811 → [27669] CONNECTING_CLOUD => RESET_CONFIG
[658] --------------------------
02:03:14.201 → [658] INIT => CONNECTING_NET
02:03:14.201 → [660] Connecting to WiFi: Red4mi
02:03:21.981 → [8415] Using Dynamic IP: 192.168.43.76
02:03:21.981 → [8415] CONNECTING_NET => CONNECTING_CLOUD
Yes, But in this condition device is not connected with internet. So it won’t react.
You can also create this situation, when internet is turned off but wifi is connected.
In this situation either we press flash button for 10 sec, or reboot. But after this it will again try to connect previous wifi address.
void enterConnectCloud() {
BlynkState::set(MODE_CONNECTING_CLOUD);
Blynk.disconnect();
Blynk.config(configStore.cloudToken, configStore.cloudHost, configStore.cloudPort);
Blynk.connect(0);
unsigned long timeoutMs = millis() + WIFI_CLOUD_CONNECT_TIMEOUT;
while ((timeoutMs > millis()) &&
(Blynk.connected() == false))
{
Blynk.run();
if (!BlynkState::is(MODE_CONNECTING_CLOUD)) {
Blynk.disconnect();
return;
}
}
if (Blynk.connected()) {
BlynkState::set(MODE_RUNNING);
if (!configStore.flagConfig) {
configStore.flagConfig = true;
config_save();
DEBUG_PRINT("Configuration stored to flash");
}
} else {
BlynkState::set(MODE_ERROR);
}
}
void enterSwitchToSTA() {
BlynkState::set(MODE_SWITCH_TO_STA);
DEBUG_PRINT("Switching to STA...");
WiFi.mode(WIFI_OFF);
delay(1000);
WiFi.mode(WIFI_STA);
BlynkState::set(MODE_CONNECTING_NET);
}
void enterError() {
BlynkState::set(MODE_ERROR);
unsigned long timeoutMs = millis() + 10000;
while (timeoutMs > millis() || g_buttonPressed)
{
delay(10);
if (!BlynkState::is(MODE_ERROR)) {
return;
}
}
DEBUG_PRINT("Restarting after error.");
delay(10);
restartMCU();
} ```
With me there's no timeout & nor (g_buttonPressed) is working. Either you flash wifi settings or setup a new AP/Wifihotspot with same name & password which device wants & turn off the previous one. Then only you can do anything with it.
@Seth_MSR please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
It won’t resolve problem permanently, If it’s in remote client location then the problem will be more worse. Need help in ConfigMode.h, Can we put some condition there ? If you have any idea then please suggest.
Using inbuilt flash button, but even after pressing it for 10secs or more Nothing gets changed.
21:39:38.066 → [623] INIT => CONNECTING_NET
21:39:38.066 → [625] Connecting to WiFi: Red4mi
21:39:46.796 → [9383] Using Dynamic IP: 192.168.43.76
21:39:46.796 → [9383] CONNECTING_NET => CONNECTING_CLOUD
21:40:42.216 → [64804] Hold the button for 10 seconds to reset configuration…
21:40:57.945 → [80527] CONNECTING_CLOUD => RESET_CONFIG
21:40:57.945 → [80527] Hold the button for 10 seconds to reset configuration…
In my case nothing is happened after [CONNECTING_CLOUD => RESET_CONFIG]. Its just showing RESET_CONFIG but not doing anything further. If I press reset button then it will again show
[INIT => CONNECTING_NET
Connecting to WiFi: Red4mi
Using Dynamic IP: 192.168.43.76
CONNECTING_NET => CONNECTING_CLOUD]
What if you reboot the device after the Reconfig is carried out ? – Actually situation doesn’t change after pressing flash button for 10 sec, Then I reboot it to reconfirm.
Are you using the example sketch of edgent ? No edits ? – 100% example
Have you selected the 3M 4M flash size while uploading the sketch ? Tried Both of top two, without sucess.
(Ideal situation)
CONNECTING_NET => RESET_CONFIG
22:01:23.835 → [29221] Hold the button for 10 seconds to reset configuration…
22:01:23.835 → [29221] Hold the button for 10 seconds to reset configuration…
22:01:23.835 → [29226] Resetting configuration!
22:01:23.883 → [29259] Configuration stored to flash
22:01:23.883 → [29259] RESET_CONFIG => WAIT_CONFIG
22:01:23.977 → [29377] Hold the button for 10 seconds to reset configuration…
22:01:23.977 → [29377] Hold the button for 10 seconds to reset configuration…
22:01:24.446 → [29867] AP SSID: Blynk NodeMCUIR-12B07
22:01:24.493 → [29867] AP IP: 192.168.4.1
22:01:24.493 → [29868] AP URL: blynk.setup
What board type do you have un-commented in Edgent_ESP8266.ino ? - → #define USE_NODE_MCU_BOARD.
What does the portion of the Settings.h file that relates to that board type look like? →
#define BOARD_BUTTON_PIN 0
#define BOARD_BUTTON_ACTIVE_LOW true
#define BOARD_LED_PIN 2
#define BOARD_LED_INVERSE true
#define BOARD_LED_BRIGHTNESS 255 ```
What version of the Blynk library are you using? --> 1.0.1
and is your Edgent example taken from that version? ---> Yes
I installed blynk from Arduino Library manager.
Not getting any time out for [ CONNECTING_NET => CONNECTING_CLOUD ].
How I get out of this situation: Just turn off internet not connected wifi & press reset button. After that press flash button for 10 sec. Then you will get something like this.
00:00:28.469 → [623] INIT => CONNECTING_NET
00:00:28.469 → [625] Connecting to WiFi: Redmti1
00:00:33.987 → [6169] Hold the button for 10 seconds to reset configuration…
00:00:46.143 → [18301] CONNECTING_NET => RESET_CONFIG
00:00:46.143 → [18302] Resetting configuration!
00:00:46.190 → [18335] Configuration stored to flash
00:00:46.190 → [18336] RESET_CONFIG => WAIT_CONFIG
00:00:46.798 → [18943] AP SSID: Blynk NodeMCUIR-12B07
00:00:46.798 → [18944] AP IP: 192.168.4.1
00:00:46.798 → [18944] AP URL: blynk.setup.
Conclusion: If wifi not connected we can reach reconfiguration.
But if wifi is connected but internet is not there, then after some time you will reach at [ CONNECTING_NET => CONNECTING_CLOUD], from there you cant reach configuration untill you try the condition mentioned in start of this reply.