I am trying to build an iot based home automation system, where I want to control two Bulbs and control fan speed with slider(It is based on project featured on Circuit digest, which makes use of phase angle control for Triac.)
It was made for Blynk Legacy. I'm trying to .ale it for latest Blynk. The code compiles, But the Serial Monitor prints myriad of memory addresses, ISR not in ISRAM,
This is the code
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <RBDdimmer.h>
#define outputPin 14
#define zerocross 4 // for boards with CHANGEABLE input pins
#define buzz 5
//#define TRIAC 14
int pwm=0;
int map_pwm=0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "BLYNK_AUTH_TOKEN";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ESP_Control_Server";
char pass[] = "xxxxxx";
//void ICACHE_RAM_ATTR ISRoutine();
dimmerLamp dimmer(outputPin, zerocross); //initialase port for dimmer for ESP8266, ESP32, Arduino due boards
int outVal = 0;
void buzz_notify (void){
digitalWrite(buzz, HIGH);
delay(1000);
digitalWrite(buzz, LOW);
delay(1000);
}
BLYNK_WRITE(V0)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
pwm = pinValue;
buzz_notify();
Serial.println("PWM value received - ");
Serial.println(pwm);
Serial.println("\n");
}
void setup()
{
// Debug console
pinMode(buzz,OUTPUT);
Serial.begin(115200);
buzz_notify ();
Blynk.begin(auth, ssid, pass);
dimmer.begin(NORMAL_MODE, ON); //dimmer initialisation: name.begin(MODE, STATE)
// void ICACHE_RAM_ATTR ISRoutine();
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
map_pwm = map(pwm, 0, 100, 0, 87); // analogRead(analog_pin), min_analog, max_analog, 100%, 0%);
dimmer.setPower(map_pwm); // name.setPower(0%-100%)
}
This is the error code the Serial Monitor keeps on spewing:
13:37:59.304 [14252] Connected to WiFi
13:37:59.304 [14252] IP: 192.168.239.100
13:37:59.304 [14252]
13:37:59.309 ___ __ __
13:37:59.309 / _ )/ /_ _____ / /__
13:37:59.309 / _ / / // / _ \/ '_/
13:37:59.314 /____/_/\_, /_//_/_/\_\
13:37:59.314 /___/ v1.1.0 on ESP8266
13:37:59.320
13:37:59.336
13:37:59.336
13:37:59.336 [14263] Connecting to blynk.cloud:80
13:37:59.895 [14838] Ready (ping: 195ms).
13:37:59.957 ISR not in IRAM!
13:37:59.957
13:37:59.957 User exception (panic/abort/assert)
13:37:59.957 Abort called
13:37:59.962
13:37:59.962 >>>stack>>>
13:37:59.962
13:37:59.962 ctx: cont
13:37:59.962 sp: 3fff1ad0 end: 3fff1be0 offset: 0000
13:37:59.968 3fff1ad0: 00000000 4bc6a7f0 fd2f1a9f 004351e4
13:37:59.974 3fff1ae0: 000000fe 00000000 00000000 00000000
13:37:59.974 3fff1af0: 00000000 00000000 00000000 00ff0000
13:37:59.979 3fff1b00: 5ffffe00 5ffffe00 00000000 00000000
13:37:59.985 3fff1b10: 00000002 3ffe84ee 00000004 4020159a
13:37:59.990 3fff1b20: 40100ea5 3fff0aa0 3fff0aa0 402015ac
13:37:59.996 3fff1b30: 00000000 3fff0aa0 00000004 40202181
13:37:59.996 3fff1b40: 00000000 3ffea367 3fff0ae8 40205a08
13:38:00.002 3fff1b50: 00000000 00000000 3fff0a7c 3ffea36a
13:38:00.008 3fff1b60: 3ffe84e1 3ffe84ee 00000004 4020223c
13:38:00.013 3fff1b70: 000037b7 00000000 3fff0a7c 4020275a
13:38:00.019 3fff1b80: 0001c200 0001c200 3fff0a50 40202792
13:38:00.019 3fff1b90: 3ffe84e1 3ffe84ee 3ffe8501 402052b1
13:38:00.024 3fff1ba0: feefeffe feefeffe feefeffe feefeffe
13:38:00.030 3fff1bb0: feefeffe feefeffe feefeffe 3fff00b4
13:38:00.036 3fff1bc0: 3fffdad0 00000000 3fff00a0 402011ec
13:38:00.041 3fff1bd0: feefeffe feefeffe 3ffe8538 40100199
13:38:00.041 <<<stack<<<
13:38:00.057
13:38:00.057 ets Jan 8 2013,rst cause:1, boot mode:(3,6)
13:38:00.065
13:38:00.065 load 0x4010f000, len 3456, room 16
13:38:00.065 tail 0
13:38:00.065 chksum 0x84
13:38:00.080 csum 0x84
13:38:00.080 va5432625
13:38:00.080 ~ld
Tell me what I'm doing wrong?
{Edited}
(P.S. I just removed the light bulbs control part to check if this code works without them, so that is not the part of the code just yet.)