Description
Well, I'm trying to make a HAP device with the Espressif hap, Espressif arduino and Espressif idf.
The problem I experienced is:
- Default CONFIG_LWIP_MAX_SOCKETS is set to 10
- No lwip sources provided with arduino core
- Homekit opens a persistent connection to each client. So, in average family, there are 10-15 devices connected simultaneously. I tested with my own 6 and ran into this problem.
- I also use WebServer (which built on WiFiServer), and by default it consumes, as far as I remember, 5 sockets. But no matter, even without the WiFiServer it is a problem, because 7 connected HAP clients surely ain't enough for real purposes. So, in my case, with the default configuration and 6 connected hap clients, any access to the WiFiServer leads to
lwip_accept
fails with errno 23.
It's a bit strange, that Espressif products don't work together. Even more, the main esp32's advantage is the networking, but 10 sockets is just a joke in this sense.
Proposed fixes:
-
Include lwip sources, so any user could configure the required sockets amount and range (not default 1-16, but more reasonable 1-20 or maybe 1-30 as lwip has no such limit)
It would probably lead to the need to add the whole IDF sources, but I'm not sure -
Include different precompiled liblwip.a versions, like with 10 (current value), 16 (current menuconfig max value) and 20 or even 30 CONFIG_LWIP_MAX_SOCKETS
Maybe you could propose better, I don't know, sorry.