Open RobertHolscher opened 5 years ago
@RobertHolscher I was having problems getting this to work on the ESP32 as well.
Similarly Wifi was not working on the ESP8266, however on the ESP8266 it doesn't throw an error, the Wifi just doesn't work.
What I discovered was that the PxMatrix library was taking up too much CPU time and pretty much suffocated the CPU time for the Wifi. To solve this on the ESP8266 (I have not tried with ESP32), I increased the time interval for the ticker (or in the case of ESP32 the timer).
I am using 5ms instead of the default 2ms as shown in pixel time. Also using fast update with display draw time at 50ms.
A somewhat unrelated note:
If you are using many panels (I am using 6 panels) with long cables (as I am), I also found that I had to reduce the SPI frequency in order to reduce the loss and noise through the cables. Reducing the frequency also further suffocates CPU time for the Wifi. I finally came up with the following "perfect" parameters for my setup, but it will differ for your setup and you will need to play with it until you get something that works:
SPI Frequency: 9500000 (only need to reduce frequency if you are suffering with a noisy image, be careful though because reducing this will adversely affect CPU time for your Wifi) Ticker/Timer interval: 0.005 (increase this time to reserve more CPU time for your Wifi, getting it to work) Fast Update: true (I believe this is less CPU intensive, also giving more CPU time for your Wifi) display_draw_time: 50 (just a setting I found that helped brighten my display)
The interupts on ESP32 require the IRAM_ATTR and this is also used in your example for ESP32. However, when combined with the webserver and wifi and use of SPIFFS, the draw function to the RGB led panel (P5 64x32) is creating panics on the ESP32.
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Reading a comment on another library, it seems that also the functions behind the call should be in cache for the interupts to work on ESP32 without panic. See: https://github.com/espressif/arduino-esp32/issues/855
I am using your library and am experiencing the same panics on my ESP32 development board when combining the SPIFFS read, and WIFI setup. My program is using a lot of interupt calls since it has a webserver as well. On EPS8266 it all works well, but on the ESP32 it is not. How can this be fixed in your library ?
Kind regards
Robert