Node mcu getting disconnected again and again


0‚~?–4û!ƒƒ‚…OCAZþû¡+¦ê�Connecting to Pushpak

Exception (0):
epc1=0x4023d790 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys 
sp: 3ffffcd0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffffe70:  4021173c 3ffede80 3fff06e4 3ffea238  
3ffffe80:  3ffea20e 3ffea218 00000000 00000010  
3ffffe90:  00000811 3ffea1fa ffffffc5 0000c003  
3ffffea0:  3ffea21e 40211273 00000010 3fff06e4  
3ffffeb0:  3ffea1f0 3ffea2c4 00000007 ffffffff  
3ffffec0:  40000f58 00000000 00000020 00000000  
3ffffed0:  00000000 00000000 00000000 00000000  
3ffffee0:  00000000 00000000 00000000 00000000  
3ffffef0:  00000000 00000000 00000000 00000000  
3fffff00:  00000000 00000000 00000000 00000000  
3fffff10:  00000000 00000000 00000000 00000000  
3fffff20:  00000000 00000000 00000025 00000000  
3fffff30:  3fff0aa4 40210e1b 3ffecd60 3fff06e4  
3fffff40:  00000000 3ffede80 3ffecd60 3ffea1f0  
3fffff50:  3ffea1f0 000000d8 00000000 00000025  
3fffff60:  00000000 ffffffff 40206233 3ffecd60  
3fffff70:  3ffea1e4 3fffdcc0 3ffe93f8 3ffe93f8  
3fffff80:  00000010 3ffecd60 3fffdab0 00000000  
3fffff90:  40205b5f 3fffdab0 00000000 402040a3  
3fffffa0:  3ffe93f8 40000f49 3fffdab0 40000f49  
<<<stack<<<
ü!ÿ„¤<1¤1õþ¡+&ÓS½¹¹•�Ñ¥¹��to Pushpak
ü!L¤<1¤1õþ¡«ÓS½¹¹•�Ñ¥¹��to Pushpak
[6058] Connected to WiFi
[6058] IP: 192.168.1.6
[6058] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.1 on NodeMCU

[6126] Connecting to blynk-cloud.com:8442
ü!‡ÿL¤<1¤1öþ¡«ÓS½¹¹•�Ñ¥¹��to Pushpak
[1060] Connected to WiFi
[1060] IP: 192.168.1.6
[1060] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.1 on NodeMCU

@scientist1995 if that is all you are going to give us all I will say is debug the stack trace.


/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example runs directly on ESP8266 chip.
 *
 * You need to install this for ESP8266 development:
 *   https://github.com/esp8266/Arduino
 *
 * Please be sure to select the right ESP8266 module
 * in the Tools -> Board menu!
 *
 * Change WiFi ssid, pass, and Blynk auth token to run :)
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xx";
char pass[] = "xxx";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
}

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

Which library version.
Android or iOS?
Local or Cloud server?
If local server which version?
How are you powering the NodeMCU?
Has the NodeMCU ever connected to a Blynk server (Cloud or local)?
Which IDE, including the version number.
What settings do you have in the IDE for the NodeMCU?
What Arduino core version are you using (don’t ask me, ask Google if you don’t know)?

I see this is your 3rd thread where you have posted about your problems. Try to stick to a single thread.

You show library 0.4.1, worth moving to 0.4.3.

Ok , I had this problem too , so I may answer your questions
*I’m using Android
*I don’t really know but I use this func. Blynk.beging(auth, ssid , password);
*I’m poweing it using the USB connected to my laptop
*yes, I’ve used this nodeMCU with another projects connected to Blynk before and I didn’t face such a problem

  • I’m using the latest version of arduino IDE 1.8.4
    *I’ve made all settings correctly as many tutorials explained how
    *I’m using the latest core version , I can’t remember it’s number at the moment because my laptop has brokendown but I’ve updated it 5 days ago

Could you attach your sketch here as well?

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

//set up MUX
#define MUX_A D0
#define MUX_B D1
#define MUX_C D2
#define ANALOG_INPUT A0
int MUX[8];

const char auth[]="XXXXXX";
const char ssid[]="XXXXXX";
const char pass[]="XXXXXXX";
const char Email[]="XXXXXXX";

float latitude;
float longitude;
String lat;
String lon;

int sens_1;
int sens_2;

bool check_1;
bool check_2;

bool Email_1;
bool Email_2;


BLYNK_WRITE(V1) {
 latitude = param[0].asFloat();
 longitude =param[1].asFloat();
}
BLYNK_READ(V2)
{
  Blynk.virtualWrite(V2,sens_1);
  }
BLYNK_READ(V3)
{
  Blynk.virtualWrite(V3,sens_2);
  }

void setup() {
  Serial.begin(9600);
//setup for WiFi connection
Blynk.begin(auth, ssid, pass);
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.println("Connecting to WiFi");
    delay (500);
    }

//setup for MUX
  //Deifne output pins for Mux
  pinMode(MUX_A, OUTPUT);
  pinMode(MUX_B, OUTPUT);     
  pinMode(MUX_C, OUTPUT);
  pinMode(ANALOG_INPUT , INPUT);
    
for (int m=0;m<9;m++)
  {MUX[m]=0;} 
}

void changeMux(int c, int b, int a) {
  digitalWrite(MUX_A, a);
  digitalWrite(MUX_B, b);
  digitalWrite(MUX_C, c);
}

void UpDate() {  
  
  changeMux(LOW, LOW, LOW);
  delay(10);
  MUX[0]= analogRead(ANALOG_INPUT); //Value of the sensor connected Option 0 pin of Mux
  sens_1=MUX[0];
  
  changeMux(LOW, LOW, HIGH);
  delay(10);
  MUX[1]= analogRead(ANALOG_INPUT); //Value of the sensor connected Option 1 pin of Mux
  sens_2=MUX[1];
  
  }

void loop() {
  Blynk.run();
  UpDate();   
     while(latitude==0 || longitude==0)
   { Serial.print("couldn't get the coordinates");
    Blynk.run();
    delay(500);
    }

lat=String(latitude);
lon=String(longitude);

// printing things on screen
Serial.print(MUX[0]);
Serial.print(" , ");
Serial.println(MUX[1]);


if (sens_1>200)
{
  Email_1=true;
  check_1=false;
}
else
{
  check_1=true;}

if (sens_2>200)
{
  Email_2=true;
  check_2=false;
}
else
{
  check_2=true;}


if((Email_1 && check_1) || (Email_2 && check_2))
{Blynk.email(Email,"warning","There's somebody has into broken your house" );
if (Email_1 && check_1)
Email_1=false;
else if (Email_2 && check_2)
Email_2=false;
}
    
}

I’m using an analog multiplexer to read multiple sensors on the A0 pin

your delay is 500 ms…please try replace to be delay(10)…or use simple timer…blynk disconectted and not stable if your delay over 20 ms…

Sir ,I’ve tried the small delay and the simple timer , but the same problem occurs.
I’ve replaced Blynk.begin(auth , ssid , pass) ;
with :
Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442) ;
as the examples explained. the stack is over but the mobile app can’t connect to the board although the auth is correct !

so what’s the correct ip for blynk cloud ??

Not the IP address you are using… that assumes a Local Server.

Blynk.begin(auth, wifi, ssid, pass);

or

Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 8442);

FINALLY !!
I found the solution , I put my nodeMCU on flash mode using the firmware then I uploaded the sketch and no stacking.

1 Like

i have same problem, how did you do using flash mode, i could not understand . can you explain it?

1 Like