Open kvvoff opened 5 years ago
On the other nodemcu board the same
Hi, same problem with all my board. Have you find solution ?
@lebif No friend, I never found a solution
Hi, @kvvoff, Solution is downgrade the esp822 board library to 2.4.2. (Arduino IDE go to board manager, esp8266 and install the 2.4.2 version.) Works fine !!
The developer says about 5.25 in his youtube video part 2 that you need version 2.3.0
@petanque thank you for info)
There are two functions in the .ino file that you can put this in front of them and it works on later version. It tells the compiler to keep the ISR function in memory and is required for ESP core 2.5.1 and later.
ICACHE_RAM_ATTR
example:
ICACHE_RAM_ATTR void dimTimerISR() {
@reynolds087 Thanks! I'll try
Downgrade to ESP8266 2.5.0 library using Arduino board manager
@nassir-malik have you tried testing with the ICACHE_RAM_ATTR attribute on the two ISR functions? I believe this corrects the issues in newer library because I'm running your project on the latest version.
Please downgrade ESP8266 support 2.5.0 in Arduino ide.
Send via mobile device
On Wed, Feb 26, 2020, 12:34 PM reynolds087 notifications@github.com wrote:
@nassir-malik https://github.com/nassir-malik have you tried testing with the ICACHE_RAM_ATTR attribute on the two ISR functions? I believe this corrects the issues in newer library because I'm running your project on the latest version.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nassir-malik/IOT-AC-Light-Dimmer-With-Alexa/issues/3?email_source=notifications&email_token=AC6UKGNJOKC7SYKUYC3F2DLRE2Y4DA5CNFSM4HNAL6D2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENBLU6A#issuecomment-591575672, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UKGOT2IXU7BWBA2OODHTRE2Y4DANCNFSM4HNAL6DQ .
I did downgrade to 2.5.0 as suggested, but I can still see intermittent flickering.
What else could I be doing wrong?
@nassir-malik great tutorial. nodemcu getting connected to wifi but not connecting to MQTT error: INFO: Attempting MQTT connection... ERROR: failed, rc=-2DEBUG: try again in 5 seconds kindly help
@nassir-malik have you tried testing with the ICACHE_RAM_ATTR attribute on the two ISR functions? I believe this corrects the issues in newer library because I'm running your project on the latest version.
Confirmed solution for me.
Board: Wemos NodeMCU LoLin (Esp8266),
I edited the file "robotdyn_dimmer.h" and changed the following:
void zcDetectISR()
to
void ICACHE_RAM_ATTR zcDetectISR()
After that, it worked fine with the latest ESP8266 library. Oddly i didnt need to add "ICACHE_RAM_ATTR" to the other ISR function.
@nassir-malik have you tried testing with the ICACHE_RAM_ATTR attribute on the two ISR functions? I believe this corrects the issues in newer library because I'm running your project on the latest version.
Confirmed solution for me. Board: Wemos NodeMCU LoLin (Esp8266), I edited the file "robotdyn_dimmer.h" and changed the following:
void zcDetectISR()
tovoid ICACHE_RAM_ATTR zcDetectISR()
After that, it worked fine with the latest ESP8266 library. Oddly i didnt need to add "ICACHE_RAM_ATTR" to the other ISR function.
I will try it soon. Thank you
I have same problem but my scenario is defferent,,, please sir if you have solutions for me,,,,
Hello Everyone,,, "So lets talk about my Project"
Wifi Module: ESP8266 E-09 Server using Sinric Pro;
In my project, I am controlling, 2 Relays: ON/OFF And RobotDyn 1 Channel dimmer module for Fan Regulation.
Here is Codes:
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <SinricPro.h>
#include <SinricProSwitch.h>
#include <SinricProDimSwitch.h>
#include <RBDdimmer.h>
#define SSID "" // WiFi SSID
#define PASS "" // WiFi Password
#define APPKEY "" // SinricPro AppKey
#define APPSECRET "" // SinricPro AppSecret
#define RELAY1_ID "" // SinricPro deviceId for relay1
#define RELAY2_ID "" // SinricPro deviceId for relay2
#define DIMSWITCH_ID "" // SinricPro deviceId for dimmer
#define RELAY1_PIN D0 // PIN relay1 is connected to
#define RELAY2_PIN D1 // PIN relay2 is connected to
#define DIMMER_PIN D5 // PIN dimmer is connected to
#define ZEROCROSS D6 // for boards with CHANGEBLE input pins
dimmerLamp dimmer(DIMMER_PIN, ZEROCROSS); //initialase port for dimmer for ESP8266, ESP32, Arduino due boards
SinricProSwitch &relay1 = SinricPro[RELAY1_ID]; // declare SinricPro device for relay1 and add the device to SinricProSDK
SinricProSwitch &relay2 = SinricPro[RELAY2_ID]; // declare SinricPro device for relay2 and add the device to SinricProSDK
SinricProDimSwitch &dimSwitch = SinricPro[DIMSWITCH_ID]; // declare SinricPro device for dimmer and add the device to SinricProSDK
int dimLevel = 100; // keeps the current dimming value (0..100) | initialized to 100 at start
bool pwrState = false; // keeps the dimmer on/off state | initialized to false (which means off) at start
// callback for onPowerState (relay1)
bool onPowerStateRelay1(const String& deviceId, bool &state) {
digitalWrite(RELAY1_PIN, state); // turn RELAY1_PIN on/off (depending on state parameter)
Serial.printf("[Relay1]: turn %s\r\n", state ? "on" : "off"); // just some output on serial monitor
return true;
}
// callback for onPowerState (relay2)
bool onPowerStateRelay2(const String& deviceId, bool &state) {
digitalWrite(RELAY2_PIN, state); // turn RELAY1_PIN on/off (depending on state parameter)
Serial.printf("[Relay2]: turn %s\r\n", state ? "on" : "off"); // just some output on serial monitor
return true;
}
// callback for onPowerState (dimmer)
bool onPowerStateDimSwitch(const String& deviceId, bool &state) {
pwrState = state; // store the requested state in global variable (this state will be used in onPowerLevelDimSwitch )
dimmer.setPower(pwrState? dimLevel : 0);
Serial.printf("[DimSwitch]: turn %s (level: %d)\r\n", // just some output on serial monitor
state ? "on" : "off", dimLevel);
return true;
}
// callback for onPowerLevel (dimmer)
bool onPowerLevelDimSwitch(const String &deviceId, int &level) {
dimLevel = level; // store requested level in global variable (this state will be used in onPowerStateDim )
dimmer.setPower(level);
Serial.printf("[DimSwitch]: set level %d (state: %s)\r\n", // just some output on serial monitor
level, pwrState ? "on" : "off");
return true;
}
// setup part for pin initialization (just to keep setup() nice and clean)
void setupPins() {
pinMode(RELAY1_PIN, OUTPUT); // initialize RELAY1_PIN as OUTPUT
pinMode(RELAY2_PIN, OUTPUT); // initialize RELAY2_PIN as OUTPUT
dimmer.begin(NORMAL_MODE, ON); //dimmer initialisation: name.begin(MODE, STATE)
}
// setup part for connecting to WiFi (just to keep setup() nice and clean)
void setupWiFi() {
Serial.printf("[WiFi]: Connecting to %s", SSID); // print to which WiFi we are trying to connect to
WiFi.begin(SSID, PASS); // start connecting to WiFi
while (WiFi.status() != WL_CONNECTED) { // wait until WiFi has been connected
Serial.printf("."); // meanwhile print a dot
delay(250); // every 250ms
}
Serial.printf("connected\r\n"); // print to serial that we are connected to wifi now
}
// setup part for SinricProSDK (just to keep setup() nice and clean)
void setupSinricPro() {
relay1.onPowerState(onPowerStateRelay1); // assign onPowerStateRelay1 callback function to relay1 device
relay2.onPowerState(onPowerStateRelay2); // assign onPowerStateRelay2 callback function to relay2 device
dimSwitch.onPowerState(onPowerStateDimSwitch); // assign onPowerStateDimSwitch callback function to dimSwitch device
dimSwitch.onPowerLevel(onPowerLevelDimSwitch); // assign onPowerLevelDimSwitch callback function to dimSwitch device
SinricPro.onConnected([]() { // instead of writing a full callback function we use a lambda function which get called when ESP is connected to SinricPro
Serial.printf("[SinricPro]: Connected\r\n"); // and this function does: output to serial "[SinricPro]: Connected"
});
SinricPro.onDisconnected([]() { // instead of writing a full callback function we use a lambda function which get called when ESP is disconnected from SinricPro
Serial.printf("[SinricPro]: Disconnected\r\n"); // and this function does: output to serial "[SinricPro]: Disconnected"
});
SinricPro.begin(APPKEY, APPSECRET, "testws.sinric.pro"); // initialize SinricProSDK with APPKEY and APPSECRET
}
void setup() {
Serial.begin(115200); // initialize Serial to baudrate 115200
Serial.println(); // print a single line (to get rid of the junk)
setupPins(); // call setupPin function
setupWiFi(); // call setupWiFi function
setupSinricPro(); // call setupSinricPro function
}
void loop() {
SinricPro.handle(); // do the magic...
}
Code compiling with zero error no any issues in compelling: the only problem is the codes,the not running in my ESP8266
My serial monitor details are given below here:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3584, room 16 tail 0 chksum 0xb0 csum 0xb0 v2843a5ac ~ld
ISR not in IRAM!
User exception (panic/abort/assert) --------------- CUT HERE FOR EXCEPTION DECODER ---------------
Abort called
stack>>>
ctx: cont sp: 3ffffec0 end: 3fffffc0 offset: 0000 3ffffec0: feefeffe feefeffe feefeffe feefeffe 3ffffed0: 000000fe 00000000 00000000 00000000 3ffffee0: 00000000 00000000 00000000 00ff0000 3ffffef0: 5ffffe00 5ffffe00 feefeffe 00000000 3fffff00: 00000002 00000005 00000005 4020e36e 3fffff10: 40100816 feefeffe feefeffe 4020e380 3fffff20: 4020f31d 3fff0e54 00000005 4020e889 3fffff30: 00000000 00000000 535b000a 4020ef99 3fffff40: 3ffe89b1 4020f501 ffffffff 3ffef4e4 3fffff50: 3fffdad0 00000000 00000005 4020e938 3fffff60: 4020c5f8 3ffef38c 3ffe89af 4020c471 3fffff70: 4020c5f8 3ffef38c 3ffeeeb0 4020c4aa 3fffff80: 3fffdad0 00000000 3ffef38c 402020b8 3fffff90: 3fffdad0 00000000 3ffef38c 40202c71 3fffffa0: feefeffe feefeffe 3ffef4a4 4020df20 3fffffb0: feefeffe feefeffe 3ffe8500 40101111 <<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3584, room 16 tail 0 chksum 0xb0 csum 0xb0 v2843a5ac ~ld
ISR not in IRAM!
User exception (panic/abort/assert) --------------- CUT HERE FOR EXCEPTION DECODER ---------------
Abort called
stack>>>
I have flashed the firmware, but when it starts up the LED is constantly flashing. I opened the port monitor and that's what it gives out. Google did not help me, I do not know what it is
And so in a circle constantly