Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue] ets Jan 8 2013,rst cause:4, boot mode:(1,6) #1

Open
yadneshgandre opened this issue Nov 29, 2018 · 0 comments
Open

[issue] ets Jan 8 2013,rst cause:4, boot mode:(1,6) #1

yadneshgandre opened this issue Nov 29, 2018 · 0 comments

Comments

@yadneshgandre
Copy link

yadneshgandre commented Nov 29, 2018

Hey everyone..
I'm getting this in serial monitor of arduino... please suggest some solutions, I'm unable to check my desired output.

Hardware
Hardware: ESP-12E

Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Frequency: 80Mhz
Upload Using: SERIAL

#include <ESP8266WiFi.h>
#include<Ticker.h>
#include<FirebaseArduino.h>

#define FIREBASE_HOST "mysmarthome-6d2a4.firebaseio.com" //Your Firebase Project URL goes here without "http:" , "" and "/"
#define FIREBASE_AUTH "LDDMjYXNFeDYThaDNku89iT8dNmM5tD7lGeZSDfO" //Your Firebase Database Secret goes here
#define WIFI_SSID "TDC" //your WiFi SSID for which yout NodeMCU connects
#define WIFI_PASSWORD "1357924680acebdf1111200000" //Password of your wifi network

Ticker secondTick;

volatile int watchdogcount=0;

int val1,val2,val3,val4;

void ISRwatchdog()
{
watchdogcount++;
if(watchdogcount ==5)
{
Serial.println();
Serial.println("watchdog bits...");
ESP.reset();

}
}
void setup()
{
Serial.begin(115200); // Select the same baud rate if you want to see the datas on Serial Monitor
secondTick.attach(1,ISRwatchdog);

WiFi.begin(WIFI_SSID,WIFI_PASSWORD);
Serial.print("connecting");
while (WiFi.status()!=WL_CONNECTED){
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("connected:");
Serial.println(WiFi.localIP());

Firebase.begin(FIREBASE_HOST,FIREBASE_AUTH);
Firebase.setInt("S1",0); //Here the varialbe"S1","S2","S3" and "S4" needs to be the one which is used in our Firebase and MIT App Inventor
Firebase.setInt("S2",0);
Firebase.setInt("S3",0);
Firebase.setInt("S4",0);

}
void firebasereconnect()
{
Serial.println("Trying to reconnect");
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}

void loop()
{
while(WiFi.status()!= WL_CONNECTED)
{
watchdogcount=0;
delay(1000);
}
if (Firebase.failed())
{
Serial.print("setting number failed:");
Serial.println(Firebase.error());
firebasereconnect();
return;
}

val1=Firebase.getString("S1").toInt(); //Reading the value of the varialble Status from the firebase

if(val1==1) // If, the Status is 1, turn on the Relay1
{
Serial.println("light 1 ON");
}
else if(val1==0) // If, the Status is 0, turn Off the Relay1
{
Serial.println("light 1 OFF");
}

val2=Firebase.getString("S2").toInt(); //Reading the value of the varialble Status from the firebase

if(val2==1) // If, the Status is 1, turn on the Relay2
{
Serial.println("light 2 ON");
}
else if(val2==0) // If, the Status is 0, turn Off the Relay2
{
Serial.println("light 2 OFF");
}

val3=Firebase.getString("S3").toInt(); //Reading the value of the varialble Status from the firebase

if(val3==1) // If, the Status is 1, turn on the Relay3
{
Serial.println("light 3 ON");
}
else if(val3==0) // If, the Status is 0, turn Off the Relay3
{
Serial.println("light 3 OFF");
}

val4=Firebase.getString("S4").toInt(); //Reading the value of the varialble Status from the firebase

if(val4==1) // If, the Status is 1, turn on the Relay4
{
Serial.println("light 4 ON");
}
else if(val4==0) // If, the Status is 0, turn Off the Relay4
{
Serial.println("light 4 OFF");
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant