Hi,there . Earlier Blynk is good but now it gives me a problem I don’t know why and can’t fix with it. Could anyone help me???. When I use App ,it connect and disconnect all the time .Here …information from serial monitor.
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/ v0.5.3 on NodeMCU
Give Blynk a Github star! => GitHub - blynkkk/blynk-library: Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
[2581] Connecting to blynk-cloud.com:80
[2696] Ready (ping: 64ms).
Soft WDT reset
ctx: cont
sp: 3ffffd80 end: 3fffffd0 offset: 01b0
stack>>>
3fffff30: 00000acb 3ffef3a0 402066cc 3fffefb0
3fffff40: 000c7bd6 3ffef3a0 00000000 4020150f
3fffff50: 40104d40 0011f8d9 3ffef1c0 00000000
3fffff60: 3ffeea90 3ffef1c0 3ffe8618 3ffef1c0
3fffff70: 3fffdad0 3ffef3a0 402066cc 3fffefb0
3fffff80: 4020151a 00000001 0000000e 40106569
3fffff90: 00000000 00000000 3ffef398 40202c84
3fffffa0: 3fffdad0 00000000 3ffef398 40203a0b
3fffffb0: 3fffdad0 00000000 3ffef398 40206758
3fffffc0: feefeffe feefeffe 3ffe8618 40100739
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
[64] Connecting to CMD
[2568] Connected to WiFi
[2568] IP: 192.168.1.4
[2568]
Here is my bad code…:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth = “3f8f56d7211b464eba1c8ccac746de07”; //Key From Blynk
char ssid = “CMD”; //Wifi Name
char pass = “0618191246”; //Wifi Password
#define RAIN_SW D0
#define blynk_Out D8 //from blynk app. D1
#define blynk_In D7 //from blynk app. D2
#define SUN_Limit D3
#define KEEP_Limit D4
#define Motor_Out D5
#define Motor_In D6
int sensorValue=0;
//#define SUN_SW D1
//#define Buzzer
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(LED_BUILTIN,OUTPUT);
pinMode(Motor_Out,OUTPUT);
pinMode(Motor_In,OUTPUT);
// pinMode(SUN_SW,INPUT_PULLUP);
pinMode(RAIN_SW,INPUT_PULLUP);
pinMode(SUN_Limit,INPUT_PULLUP);
pinMode(KEEP_Limit,INPUT_PULLUP);
pinMode(blynk_Out,INPUT);
pinMode(blynk_In,INPUT);
digitalWrite(Motor_Out,HIGH);//off
digitalWrite(Motor_In,HIGH); //off
}
void loop() {
Blynk.run();
led ();
BLYNK_SUN();
BLYNK_KEEP();
LDR ();
}
void led (){
digitalWrite(LED_BUILTIN,LOW);
delay(50);
digitalWrite(LED_BUILTIN,HIGH);
delay(1000);
}
void BLYNK_SUN(){
while(digitalRead(SUN_Limit)!=LOW){
if(digitalRead(blynk_Out)!=LOW){//||(sensorValue<80)
digitalWrite(Motor_Out,LOW);
}else digitalWrite(Motor_Out,HIGH);
} digitalWrite(Motor_Out,HIGH);
}
void BLYNK_KEEP(){
while(digitalRead(KEEP_Limit)!=LOW){
if((digitalRead(blynk_In)!=LOW )||(sensorValue>230)||(digitalRead(RAIN_SW)==LOW )){
digitalWrite(Motor_In,LOW);
}else digitalWrite(Motor_In,HIGH);
} digitalWrite(Motor_In,HIGH);
}
void LDR (){
for(int i=0;i<10;i++){sensorValue =sensorValue+ analogRead(A0);delay(5);}
sensorValue=sensorValue/10;
Serial.println(sensorValue);
delay(500);
}