Not creating a wifi hotspot

Hi all, I’ve been using a NodeMCU for a few months now. However I’ve changed the WiFi password and re-uploaded the code. However the NodeMCU doesn’t create its own hotspot. I can however see that my router accepts the connection for a brief second. See error log from serial monitor. I was thinking to change my routers MAC. Any help?


>[384] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP8266

[386] --------------------------
[389] Product:  Relay
[391] Firmware: 0.1.0 (build Jan 22 2022 19:58:05)
[395] Token:    ...1v_q
[397] Device:   ESP8266 @ 80MHz
[400] MAC:      DC:4F:22:18:06:44
[403] Flash:    4096K
[405] ESP core: 
[407] ESP SDK:  2.2.2-dev(38a443e)
[410] Boot Ver: 4
[412] Boot Mode:1
[413] FW info:  469264/1626112, MD5:749b4fba375660a0b5874e4aa019e25b
[621] Free mem: 31184
[621] --------------------------
[621] INIT => CONNECTING_NET
[623] Connecting to WiFi: Bell2.4
[40638] Restarting after error.


 *  TITLE: Blynk 2.0 + Manual Switch (Latched) control 4 Relays using NodeMCU (Real time feedback) (No Wi-Fi control)
 *  I have Modified the Blynk.Edgent.Edgent_ESP8266 example code (https://blynk.io/) for this project
 *  Click on the following links to learn more. 
 *  YouTube Video: https://youtu.be/O9VYZqWPNEQ
 *  Related Blog : https://iotcircuithub.com/home-automation-using-nodemcu-and-blynk/
 *  by Subhajit (Tech StudyCell)
 *  Preferences--> Aditional boards Manager URLs : 
 *  https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
 *  
 *  Download Board ESP8266 NodeMCU : https://github.com/esp8266/Arduino
 *  Download the libraries
 *  Blynk 1.0.1 Library:  https://github.com/blynkkk/blynk-library
 **********************************************************************************/

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLd9zeDMN3"
#define BLYNK_DEVICE_NAME "Relay"

#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 the GPIO connected with Relays and switches
#define RelayPin1 5  //D1
#define RelayPin2 4  //D2
#define RelayPin3 14 //D5
#define RelayPin4 12 //D6

#define SwitchPin1 10  //SD3
#define SwitchPin2 D3   //D3 
#define SwitchPin3 13  //D7
#define SwitchPin4 3   //RX

#define wifiLed   16   //D0

//Change the virtual pins according the rooms
#define VPIN_BUTTON_1    V1
#define VPIN_BUTTON_2    V2
#define VPIN_BUTTON_3    V3 
#define VPIN_BUTTON_4    V4

// Relay State
bool toggleState_1 = LOW; //Define integer to remember the toggle state for relay 1
bool toggleState_2 = LOW; //Define integer to remember the toggle state for relay 2
bool toggleState_3 = LOW; //Define integer to remember the toggle state for relay 3
bool toggleState_4 = LOW; //Define integer to remember the toggle state for relay 4

// Switch State
bool SwitchState_1 = LOW;
bool SwitchState_2 = LOW;
bool SwitchState_3 = LOW;
bool SwitchState_4 = LOW;

#include "BlynkEdgent.h"

BLYNK_CONNECTED() {
  // Request the latest state from the server
  Blynk.syncVirtual(VPIN_BUTTON_1);
  Blynk.syncVirtual(VPIN_BUTTON_2);
  Blynk.syncVirtual(VPIN_BUTTON_3);
  Blynk.syncVirtual(VPIN_BUTTON_4);
}

// When App button is pushed - switch the state

BLYNK_WRITE(VPIN_BUTTON_1) {
  toggleState_1 = param.asInt();
  if(toggleState_1 == 1){
    digitalWrite(RelayPin1, LOW);
  }
  else { 
    digitalWrite(RelayPin1, HIGH);
  }
}

BLYNK_WRITE(VPIN_BUTTON_2) {
  toggleState_2 = param.asInt();
  if(toggleState_2 == 1){
    digitalWrite(RelayPin2, LOW);
  }
  else { 
    digitalWrite(RelayPin2, HIGH);
  }
}

BLYNK_WRITE(VPIN_BUTTON_3) {
  toggleState_3 = param.asInt();
  if(toggleState_3 == 1){
    digitalWrite(RelayPin3, LOW);
  }
  else { 
    digitalWrite(RelayPin3, HIGH);
  }
}

BLYNK_WRITE(VPIN_BUTTON_4) {
  toggleState_4 = param.asInt();
  if(toggleState_4 == 1){
    digitalWrite(RelayPin4, LOW);
  }
  else { 
    digitalWrite(RelayPin4, HIGH);
  }
}


void setup()
{
  Serial.begin(115200);
  delay(100);
  
  pinMode(RelayPin1, OUTPUT);
  pinMode(RelayPin2, OUTPUT);
  pinMode(RelayPin3, OUTPUT);
  pinMode(RelayPin4, OUTPUT);

  pinMode(wifiLed, OUTPUT);

  pinMode(SwitchPin1, INPUT_PULLUP);
  pinMode(SwitchPin2, INPUT_PULLUP);
  pinMode(SwitchPin3, INPUT_PULLUP);
  pinMode(SwitchPin4, INPUT_PULLUP);

  //During Starting all Relays should TURN OFF
  digitalWrite(RelayPin1, HIGH);
  digitalWrite(RelayPin2, HIGH);
  digitalWrite(RelayPin3, HIGH);
  digitalWrite(RelayPin4, HIGH);

  digitalWrite(wifiLed, HIGH);

  BlynkEdgent.begin();

  Blynk.virtualWrite(VPIN_BUTTON_1, toggleState_1);
  Blynk.virtualWrite(VPIN_BUTTON_2, toggleState_2);
  Blynk.virtualWrite(VPIN_BUTTON_3, toggleState_3);
  Blynk.virtualWrite(VPIN_BUTTON_4, toggleState_4);

}

void loop() {

    BlynkEdgent.run();
    
    manual_control(); //Manual Switch Control   
}

As you guys can see, it directly attempts to connect to my router. I also flashed my NodeMCU in the hopes this would help.

What exactly does this mean?
The WiFi password should be reset by pressing the button on the board and re-provisioning.

This seems a bit odd. What ESP core version do you have installed in your IDE?

I don’t know what’s in your manual_control function, but you should be calling it directly from your void loop. Read this…

Pete.

1 Like

What I meant regarding the WiFi password change, is that I changed my routers password. However the same node was previously connected to said router. What’s strange is that the NodeMCU doesn’t even try to start its own hotspot but rather tries to connect directly.
I’m running ESP-12E (1.0)… This might be the issue. I’ll try ESP-12 (0.9 version).

You didn’t address the…

part of your statement.

It will try to use the stored credentials, unless you clear those by pressing the button for 10 seconds and re-provisioning. The re-provisioning should be done via the app, not the captive portal.

That’s not the ESP core version, it’s the board type.

Go to Tools > Board > Boards Manager and search fort “esp8288 core by ESP8266 Community”

Pete.

I understand now I should be

however should I change my routers password back to the previous to gain access for the re-provisioning?

I’m running the ESP8266 version 3.0.0

I have also changed my code as advised…

Thank you for this.

Adam

No.

Okay. You could upgrade to 3.0.2, but that should be fine.

Pete.

So I ended up changing my routers password back to the original and this somehow allowed the device to create its own hotspot. I’ll do the re-provisioning now and change the wifi password again on the router.
Thank you for the advice.

Adam

1 Like

He’llo
1)Bro before you uploading the Blynk edgent code remember to erease the 8266 then upload the code