-
Notifications
You must be signed in to change notification settings - Fork 833
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
IRremoteESP8266 2.7.4 crashes with WiFi :Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. #1073
Comments
You haven't stated it, but your using an ESP32. Correct? Can you simplify your code down to the smallest you can that still causes the crash, so I can replicate it and test it at my end? |
I use ESP32-CAM https://randomnerdtutorials.com/esp32-cam-video-streaming-face-recognition-arduino-ide/ The easiest way to reproduce is this:
reboots:
|
The patch --- CameraWebServer.ino.orig 2020-03-07 22:41:53.633571406 +0300 +++ CameraWebServer.ino 2020-04-04 01:20:07.291554345 +0300 @@ -1,5 +1,9 @@ #include "esp_camera.h" #include <WiFi.h> +#include <IRremoteESP8266.h> +#include <IRrecv.h> +static IRrecv myReceiver(2/*IR_reciverPin*/); +static decode_results myDecode; // // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality @@ -8,11 +12,11 @@ // // Select camera model -#define CAMERA_MODEL_WROVER_KIT // Has PSRAM +//#define CAMERA_MODEL_WROVER_KIT // Has PSRAM //#define CAMERA_MODEL_ESP_EYE // Has PSRAM //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM -//#define CAMERA_MODEL_AI_THINKER // Has PSRAM +#define CAMERA_MODEL_AI_THINKER // Has PSRAM //#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM #include "camera_pins.h" @@ -88,6 +92,10 @@ s->set_hmirror(s, 1); #endif + + pinMode(2/*IR_reciverPin*/,INPUT); + myReceiver.enableIRIn(); + WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { @@ -106,5 +114,13 @@ void loop() { // put your main code here, to run repeatedly: - delay(10000); + //delay(10000); + unsigned long pult=0; + if (myReceiver.decode(&myDecode)) { + pult=myDecode.value; + Serial.print(pult, HEX); + Serial.print(F(" protocol=")); + Serial.println(myDecode.decode_type); + myReceiver.resume(); // готовы принимать следующий сигнал + } } |
Again, please try our examples to see if it is broken there too. |
FYI, I don't have an ESP32Cam module to test with, so I can't use that code (I think). I'll try it on bare ESP32, but it's likely not to work and it won't be the same. |
@mal19992 I read through the bug/issue you referenced in your original message. i.e. the one logged by @marcmerlin (Hi Marc. Long time etc. :-) It appears there is some funkiness with SPIFFS and hardware timers on the ESP32. I'm far from an expert on SPIFFS on the ESP32, but my guess is something is the matter there. @marcmerlin worked around it by kind-of luck with My suggestions for work-arounds to try would be to disable the IR capture via
IF you find that I'm not loading the interrupt code correctly into IRAM via using the Here is all the code that is used in the interrupt handlers (i.e. IRAM): https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/IRrecv.cpp#L65-L126 The only non-interrupt/non-timer related function call is All the timer interrupt related code is just: https://github.com/crankyoldgit/IRremoteESP8266/blob/master/src/IRrecv.cpp#L68-L79
If you get crashes with nothing connected to the IRrecv GPIO pin (@mal19992 do you? Have you tried that), then it can only be that code. If the cam/SPIFFS software can't deal with that tiny bit of interrupt code, then I'm totally flummoxed. |
If I comment out either section
it works without a crash. (In both cases nothing is connected to GPIO2). If both sections are enables --- it crashes with the message Before esp_camera_init updated patch: |
I looked at /usr/local/arduino/hardware/espressif/esp32/tools/sdk/include/esp32-camera/* there seems to be no references to interrupts and SPIFFS. The pre-compiled library seems to have no refs to SPIFFS as well source: https://github.com/espressif/esp32-camera |
@mal19992 Can you please try loading https://github.com/crankyoldgit/IRremoteESP8266/blob/master/examples/IRrecvDumpV2/IRrecvDumpV2.ino in your IDE and upload it to your ESP32? If it does, please move on to trying https://github.com/crankyoldgit/IRremoteESP8266/tree/master/examples/IRMQTTServer That one has wifi, and will also provide useful info to me to work out what versions of libraries you are using, so I can try to investigate. If it is crashing at the call to
There is not much to it. Once you've tested/tried this libraries example code on your system and confirmed they work okay. (i.e. don't cause the ESP to crap itself.) we can try to comment out parts of that routine to see what might be causing it in the Cam software. i.e. Try to narrow down if it is the GPIO interrupt or the Timer interrupt that is causing an issue. |
Also, not that it should make a difference, can you try removinf |
and .. just on the off chance, have you completely removed the |
|
Excellent. Then we know it's not an issue with what every core ESP library you are using. Maybe there is not enough IRAM available with the camera stuff loaded?!? Just a theory/guess?! The [Q] What ESP32-Core library version are you using? When did you last update etc? |
I used I did not run IRMQTTServer (it requires too many libraries to install), I added WiFi to IRrecvDumpV2.ino, it works OK (without camera) |
I added more code to IRrecvDumpV2.ino (the .h files are from https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer ) basically: commenting out the line config.pin_sscb_sda = SIOD_GPIO_NUM; make the camera stop crashing. |
is |
The FLAG_CAMERAT_TO_FAIL was my (misspelled) variable added to IRrecvDumpV2.ino dependong on which some camera config settings were set/unset, see config.pin_sscb_sda = SIOD_GPIO_NUM; if one comment this line -- it stops crashing |
Hi @crankyoldgit , so yeah, in espressif/arduino-esp32#1781 I basically found that removing some code made some code cache not overflow and made the problem go away.
either of those two should fix your problem. Unfortunately FFAT, while clearly superior, cannot be generated or uploaded from the arduino IDE, but the page I gave should allow you to generate your own image from linux and upload it |
I tried https://github.com/lbernstone/IR32 it does not work. It cannot receive a signal from TV remote. The remote2.available() in https://github.com/lbernstone/IR32/blob/master/examples/Loopback/Loopback.ino always returns 0, no any reaction on TV remote key pressed. A VS1838 is attached to pin 2, RX_PIN is set to 2, and all TX code removed. |
Please ask him for help, I use it and it works for me. You can find him in gitter.io in the esp32 channel |
I did exactly like this remote2.active() always return 1 and remote2.available() always 0, no reaction on TV remote. The |
marcmerlin, thank you very much. It started to work after adding to setup() pinMode(RX_PIN,INPUT); LB.ino.txt lbernstone/IR32@8c33dc3 |
Closing due to lack of activity. |
FYI This may have been fixed with #1351 |
It somehow interacts with WiFi. Original IRremote 2.2.3 https://github.com/z3t0/Arduino-IRremote works when myReceiver.enableIRIn(); is called after WiFi init, otherwise it crashes with "Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)", see IRAM_ATTR isn't working at espressif/arduino-esp32#1781
The IRremoteESP826 library "version": "2.7.4", with a standard receive code:
does not work at all. It produces a different Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
I also tried to switch the order of WiFi and myReceiver.enableIRIn(); initialization. This does help for original IRremote Arduino-IRremote/Arduino-IRremote#518 but does not help for IRremoteESP826.
WiFi code that create a problem for IR interrupts
To reproduce: take https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer with ESP-CAM with #define CAMERA_MODEL_AI_THINKER and add the standard setup/loop IR read code to this sketch.
And this WiFi code (try to connect, if failure -- do AP) is even more prone to system panic when used with IRremoteESP8266 or IRRemote. It works perfectly OK with commented out timer init myReceiver.enableIRIn();
The text was updated successfully, but these errors were encountered: