The general concept

The ESP32 Arduino software is split into two parts. One is the communication with the android app using TCP, the other part is the control of the APA102 LED array.

WLAN access point

We use the ESP32 in access point mode. Every costume has it's own SSID & password. The Android phone will connect to this access point.

TCP/IP

Since quite a lot data has to be sent for a complete refresh of the costume , the performance of the standard adrduino library was not good enough. Therefor, we switched to the Asynchronous TCP library for ESP from Hristo Gochkov.

LED controller

For testing, we were using the Arduino DotStar library to control the LEDs. Since our costume is equipped with more than 1000 LEDs, we wanted to split them into multiple parallel channels. This help to reduce the datarate per channel and furthermore, if one channel breaks (because of a defect LED or broken cable), the rest of the of the channels will still work fine.
So, we modified the library to support parallel LED channels. At the moment, 7 channels are used, but up to 32 are supported by the library.

Setup method

In the Arduino setup method, we first configure the serial port (mainly for debugging).
Then, the wlan is activated in access point mode.
At least, the async TCP server is started.

Main loop

The main loop is very compact. It just updates the LED array with an intervall of about 20ms. 
The LEDs are refreashed even if there is no new data available.