Maximum number of simultaneous TCP connetions

69 views
Skip to first unread message

Joth

unread,
Jun 16, 2020, 9:56:04 AM6/16/20
to Loxone English
I'm experimenting with writing my own Loxone-friendly firmware for Teckin B22 light bulbs (based on ESP8266, I'm using ESPhome as a starting point simply because I'm already familiar with it).
While it would be very possible to control them from Loxone via a bridge device (e.g. MQTT broker or Home Assistant) my goal is to control them direct from the miniserver, to reduce latency and simplify long term reliability and maintenance. 
This is going very well, I have a simple proof of concept using tcp:// connections but before investing more time in this, I thought I'd mine the knowledge here on this approach vs using UDP.

Question
- is there  limit on the number of TCP connections the miniserver can handle in practice at one time?
- how does it behave  when reaching the limit? (e.g. new connections have increased latency on connect due to time to cleanup old connections)

Having read the recent thread on eth2dmx I see UDP is  the popular choice for lighting control, and wondered if this was for the standard reasons or driven by Loxone specific constraints? With just one connection (only testing 1 bulb so far) TCP it seems very robust and pleasingly low latency, but I have a dozen on these bulbs and can easily see myself getting up to the 20-30 area so worried how well the miniserver scales. In practical terms I'd guess it's only "whole house off (or on)" that I might even notice the delay as it ripples the command through all the bulbs.
 
This is miniserver gen 1, in case that matters.

Thanks!

David Wallis

unread,
Jun 16, 2020, 10:16:14 AM6/16/20
to Joth, Loxone English

Just looked and the miniserver uses a microchip KSZ8051 chip which is a physical layer transceiver – so the TCP is done via the miniserver its self and not limited to an arbitrary number as you might see with a wiznet w5100 w5500 style chip.

 

So in short don’t know! – but I suspect not many! –

 

With regard to how when you get o the limit – you need to also make sure your finishing the TCP connection – I suspect its not a great implementation of TCP but you don’t want a load of ports in a TIME_WAIT state where you experience ‘port exhaustion’ – but this would be within the mini server – poss more of an issue in a proper OS.

 

For the whole house on you could look to see if you could do unicast / multicast..

--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loxone-english/39457c0b-be9d-4038-89a1-eb9696d25707n%40googlegroups.com.

 

Jonathan Dixon

unread,
Jun 18, 2020, 3:18:34 AM6/18/20
to Loxone English
Thank you David for the research into this and comments. Sounds possible the limit is not so low, but like you my instinct is same as yours that I'll probably hit it sooner rather than later.

My comment on "all off" was more to say I don't think it will be too bad if that's the only time there is visible "command ripple" latency overhead, so it'd be low on my priority list to optimise specifically for the aesthetic of it. (I do like in principle the robustness of DALI style all on/off broadcasts though - e.g. emergency situations, but I wouldn't have any expectation of wireless lighting working in an emergency anyway so again out of scope).
 Port starvation (maybe combined or with non-responsive peers) adding multi/many second delay is much more of a concern.

For some reason I'm drawing a blank on finding any vaguely reasonable documented Espressif/platformio/esphome UDP API, I was of course expecting it to be simpler than TCP but so far not looking the case. I'll keep digging :)

Cheers

David Wallis

unread,
Jun 18, 2020, 3:37:09 AM6/18/20
to Jonathan Dixon, Loxone English

Jonathan Dixon

unread,
Jun 18, 2020, 5:54:20 PM6/18/20
to David Wallis, Loxone English
On Thu, 18 Jun 2020 at 08:37, David Wallis <da...@wallis2000.co.uk> wrote:

Thank you sir! I think your Googling certainly beats mine.

Very easy to integrate, less than 100 lines of code for RGB/WW integration, I now have one room of these bulbs working fully controlled from Loxone.
Reply all
Reply to author
Forward
0 new messages