Open richms opened 4 years ago
I dont know why its not taking code tags when I click it Sorry for the bad formatting.
The display routine blocks the CPU for a long time, making huge network transfers unreliable. I'd recommend to disable the display during update via the onStart() callback of the OTA library or at least drastically reduce the timer interval.
I thought it was stopping that already since the led panel blanks out when it tries to start the flash. I will have to have another play with it at a later stage because it is up and working now with a long USB cable to let me reflash with alternate messages. I need to sort out something to change it over the air and just reflashing was the easiest option I thought of at the time.
The display routine blocks the CPU for a long time, making huge network transfers unreliable. I'd recommend to disable the display during update via the onStart() callback of the OTA library or at least drastically reduce the timer interval.
About this, presumably one could run the OTA process on a different core?
Sure... But I don't see why one would put much effort into that. OTA is usually part of a maintenance and it shouldn't be a problem to turn the display off to do that. It's an easy solution.
On the other hand, if you have huge network transfer as part of the regular operation, you should consider optimizing the code this way.
One might be using the the same way one would a screen, possibly to show a progress bar or an icon to indicate that the device is updating.
The deal is that it's not related to OTA only see #113, I've got a web server also and each time I go on it thru http://blabla to do setup config, ESP32 just crash and reset. And it works fine on ESP8266 with
But I need other GPIO so that's why I use now ESP32 not using any func using SPIFFS (WebServer, OTA).
Not sure how we can handle that but for sure using only 2nd core on ESP32 to manage display would be awesome
It seems updating the display from within the ISR will end up in a world of hurt on the ESP32. From i2c infinite loops (caused by https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.c#L1010) to xQueueGenericReceive
errors from SPI it is a debug hell.
What I did on the esp32 is delegating the display work to a task (pinned to core 1) and task-notify it from the ISR. The Task hast to be priority > 3 as the AsyncWebServer has 3 as a hardcoded magic priority and values equal or below will flicker the matrix every time there is a request. While OTA+Matrix technically works, it flickers the whole duration. (Strangely, trying to pin OTA to core 0 resulted in even more flickering)
It seems updating the display from within the ISR will end up in a world of hurt on the ESP32. From i2c infinite loops (caused by https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.c#L1010) to
xQueueGenericReceive
errors from SPI it is a debug hell.Yes, I encountered this too. My solution was exactly the same, I documented my solution here #225.
Regarding the flickering, I wonder if it has anything to do with reading and writing to flash while attempting to use the matrix. IIRC this is also a reported issue, though that was regarding SPIFFS.
I thought I would have a shot with arduino OTA uploading on my wemos 32 board in Brian Lough's adapter board.
Its all working fine with the basic PxMatrix pixel time sketch configured for my 3 panels that are connected.
If I put a while loop on the start of setup, delaying the startup of the sketch it all works fine to upload to it.
All works fine there, but I have a delay on startup. At least I can change the text by starting an upload and going an hitting reset on the wemos module.
But if I put the ArduinoOTA.handle(); any point after starting the display up - even in a while loop in setup() I get
while it tries to upload to it.
Has anyone got the OTA uploading and PxMatrix working together on an ESP32 board?