I developed a simple board that connects via WiFi and upload some data to a remote server. The network management is up to the customer but now he asks me some hints about how to avoid the limited number of connections allowed.

The issue

There are thousands of those boards around, but only few hundreds of them are within the range of the router (I only know is a Huawei router that allows 60 WiFi connections at time).

Currently the firmware will try to connect every 20 minutes and, if the connection is granted, the time required to do all the stuff is about 1-2 minutes. After that the boards would upload another set of records after other 20 minutes but this time the connection will last for a fraction of second (because it has no data, just a "keep alive" signal to the server).

Each board will remain in this area for few hours. That means during the whole day the mean quantities of boards in the "upload area" is quite constant.

With this setup, often happens that a lot of units cannot upload data in their parking slot time, so the next time they have the double of data to be uploaded, and eventually the situation becomes worse.


Of course the first thing is try to find another router that allows more connections, obviously.

My question is related about any software pattern/strategy to improve the overall efficiency.

My thoughts: all boards try to connects randomly. They are not tied to a specified hour. Hence we assume the probability at a given time is quite uniform. If the router can accept 60 connections at time, it means that the next one will be refused. If I can catch this error, I would retry more frequently than 20 minutes.

In this way I should increase the probability to find a free 'slot' in the same amount of time spent there. Of course I wouldn't do that if I cannot know if the connection is refused for other reasons because it will drain the battery too fast.

Any other ideas? Are there any router specifically designed for such an IoT application? And, as per your knowledge, the limitation is due to the radio bandwidth or the capability of the router to handle more connections internally?


A more structured allocation might be better, because you are very tight for available time slots. I think you need to run some monte-carlo simulations of your proposed system too (and check that you can first replicate your current failure timescale).

I'd suggest to incrementally slow-down any endpoint which is polling, but failing. Your steady-state should be within the available bandwidth, so the slowdown ought not to impact any/many active endpoints. If you do not back off, it only takes a couple of hundred endpoints to completely DOS your network.

You might also need to better characterise the connections, and the start-up state (assuming endpoints are static, but the router got rebooted). When all 60 connections are in use, does the next transmission kick off one of these, block several established connections, or need to wait longer for a slot to be freed up? What is the minimum number of pathologically timed connections to block the system (with worst case overlap of the 2 minute slots)? These ought to be reasonable easy to model in software.

  • Does "slow-down any endpoint [...]" mean to increase the polling period? I cannot increase it so much otherwise there are few chances the units can actually try to connect during the period they are within the AP range.
    – Mark
    Apr 10 '18 at 12:42
  • Yes. If units are moving through the space too quickly, your design is flawed because the equilibrium condition is unstable. Apr 10 '18 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.