m1cr0lab-esp32 / remote-control-with-websocket

ESP32 Remote Control with WebSocket
MIT License
37 stars 20 forks source link

Adding interrupts and DMA #14

Open FlashPackets opened 3 years ago

FlashPackets commented 3 years ago

First, this is an outstanding tutorial. Over the years I've read perhaps thousands, but this one in particular is easily at the very top. Really, very remarkable.

I found the introduction to PlatformIO and git especially helpful. I've used these tools for awhile but for whatever reason I always had difficulty with PlatformIO as the compiler was constantly generating compile errors for things that I knew were correct. ( I think something about my system PATHs was broken). Anyway, this tutorial gave me a kick in the pants to try PlatformIO again, and what do you know. It worked:)

My principal complaint about using the Arduino is that the libraries don't seem to offer a clear path to detailed and complex configuration of the ESP32 at the basic device level. The primary example being the use of interrupts used with SPI/DMA interfaces. While I find that interrupts and DMA are easy to implement individually using the Arduino environment, making both work together seems more problematic.

Given that the code is already configured within PlatformIO with classic file extensions as .c, .cpp, how much effort is involved in the complete abandonment of Arduino in favor of the Expressif code base so that fine grained control of the device can be implemented? Or to put it another way. Starting with the code base you have graciously provided is it possible to push the ESP32 more aggressively providing say 1MB/sec?

Perhaps adding another chapter or few to cover advanced configurations of streaming I/O?

Regards,

Flash Packets

m1cr0lab commented 3 years ago

Hello @FlashPackets,

Thank you for the very flattering feedback! I'm very happy to read that you enjoyed my tutorial.

PlatformIO is not limited to the arduino-esp32 platform (which is an overlay of the ESP-IDF framework from Espressif). You can code directly with the ESP-IDF platform to use a finer granularity of the parameterization you want to implement. But it takes a lot more time to get the hang of it... and I'm not there yet.

Concerning the SPI bus and the use of the DMA controller, many projects have implemented them with the arduino-esp32 platform. Look for example at the excellent LovyanGFX library which provides a remarkable display driver for the ESP32 and in particular the M5Stack devices (with a 320x240 color screen). The performance obtained is very good.

However, I don't really see the connection with WebSockets.

If you are interested in the performance of the ESP32's WiFi interface, Espressif shows some amazing results... but obtained under very specific laboratory conditions. I doubt very much that such speeds can be obtained at home. If you're interested in the details, you can take a look at the code they used to perform their tests.

In the case of WebSockets, I have not done any performance tests on my side with the arduino-esp32 platform. It would be worth testing. But I haven't tackled ESP-IDF directly yet.

Thanks again for your kind feedback.

Regards, Steph