-
Notifications
You must be signed in to change notification settings - Fork 13.3k
How many clients can connect in Access point mode #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
anyone? |
4 clients are possible right now. |
It seems like it is possible to call wifi_softap_set_config() with a config.max_connections value greater than 4 to override the default? Do you know if this is, in fact the case, and what the ramifications might be? I understand that more clients require more RAM, but from googling around, it's not clear how much. I have a relatively simple host app which I would like to use to send UPD broadcasts to many clients. I appreciate any sight, |
you can try it, if its working we can add an API to change the value. |
Markus, Thanks for you're feedback. I'm not very C-savy and certainly the whole ESP8266 toolchain is a bit intimidating. To try it, is it necessary to modify the source code and build the firmware? Or can I simply set up my own config structure and pass it in from my own user code using something like below? I ask because your response regarding the possibility of providing an API seems to imply this will not work. struct softap_config cfgESP; Thanks again, |
you can use the SDK directly like you shown. to use the SDK you need to do the include like this: extern "C" {
#include "user_interface.h"
} if its working i will add it to the begin function of the AP, so it will be easy to use with out to deal with the SDK. |
Any luck @acoulson2000? I'd like to increase the number of connections for my project if possible. |
So far, I have only connected 3 simultaneously, but so far, so good. It will probably be a couple of weeks at least before I'm ready to try more, but I'll post back with my results. |
Hi @acoulson2000! I've also been trying to connect more than 4 devices to the AP, but I haven't succeed so far. What about you? |
@brianensor and @bertamf, sorry, I still have not tried this. I went up working with NodeMCU for my project, and even then, I only got up to exactly 4 clients (this was for the Christmas project I've begun describing here https://austinlightguy.wordpress.com/2016/01/24/lightsuit-v2/). I've started playing around with some stuff I postponed during the busy holidays, though, so I hope to investigate this again shortly and will post my findings. First, I will probably just try it with my NodeMCU AP and clients, then I'll try an Arduino version. One issue I do have is that I only get a packet throughput rate of something like 8-10Hz and I'm wondering if the Arduino code, which will be more like native, will be faster. |
I can edit user_interface.h if someone knows how to pass a higher value to max_connection : |
So, I've started playing around with this a bit again. I was using my NodeMCU code, but was finding that I got a lot of random reboots on my UDP receiver. I think possibly this is because it's also doing a lot of work pumping the WS2812 data for about 300 LEDs across GPIO2 (although this is supposed to be very effiecient with the UART-driven fix (nodemcu/nodemcu-firmware#951) for that driver.) I have switched to Arduino, but so far am only up to three clients. I'll rig a couple more up within a few days. So far, I have not added the WS2812 functionality in, so I'm not sure what the stability will look like. One thing I've definitely determined - pumping packets at high speed, even via UDP multicast, does not work very well when the sender is configured in AP mode. I guess it's too busy handling the WiFi stack and just managing WiFi clients or something, but when I configure it that way, my clients all seem to receive packets in "clumps" - so they'll get something like 4 to 6 packets, then experience a slight delay, then receive another clump. The overall throughput is decent, but for my application I really want a consistent, high-speed stream of packets, since my clients are essentially remote VU meters. When I configure both the sender and receivers to all connect to my home wifi in WIFI_STA mode, I get much more consistent streaming at about 10hz (4 byte packets). With my phone as a tethering AP, it's not as good as my home router, but still better than an ESP8266 in AP mode. @alx-1, I think the idea is that you may not have to modify existing SDK code, you just include the header file at the top of your sketch wit this: then something like this in setup() of your sketch: Now that I look at this, I wonder if fiddling witht the beacon_interval might help my in AP mode... |
@acoulson2000 : Any progress on this? I have an application that requires 4-8 ESPs that are sent commands from a single ESP configured in AP mode. EDIT: I was hoping to find a UDP broadcast solution that reliably worked with a high enough update rate, but wasn't able to find one. Any suggestions? |
@NikhilMJ , not sure if you're still interested in this issue, but in case you or anyone else who runs across this thread is, I do have something to report. While I never got around to trying this with the ESP8266, that is in part because I found that the packet rate from an ESP8266 in AP mode was really quite low. Using the ESP8266 as the AP, I was able to broadcast small (5 byte) packets at around 1 every 150-to-200ms. Connecting to a separate, dedicated AP (just a very cheap WiFi router), I got almost double. Since my project needs to be wearable, I didn't really pursue this option. HOWEVER, now that the ESP32 is available, I decided to revisit it. It even turns out that, alhtough the default for ESP32 is still 4, there was a recent commit to the ESP32 SDK that supports changing the maximum. Using Sparkfun ESP32 thing with the extended API - which is WiFi.softAP(ssid, passphrase, channel, ssid_hidden, max_connection) - I have been able to set max_connections to 16 and have so far connected 6 clients simultaneously, with a throughput of 40 packets per second (25ms/packet)! Hooray for the ESP32! |
There is a method in the WiFi class to set the max number of wifi clients that can connect to the SoftAP. I believe that default is 4, the max is 8, but I'm not certain of that. |
@acoulson2000 : Apologies for the delayed response to this. I had about 100+byte packets broadcasted every 15msec or so. I was only looking to increasing the total number of client connections. |
Hello All, I am beginner in this field, working on my final year project. Thank you Darshan. |
@imdsp it's possible, but this is not the right place to ask such questions. Please refer to a community forum like esp8266.com or stackoverflow. |
@imdsp, If you email me directly, I can point you in the right direction. |
Hello everyone,
can one explain to me briefly how i can set this to 8 stations ? I programm my ESP8266 with the Arduino |
Just use: WiFi.softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection); where max_connection defaults to 4. |
thx thounsand times. u saved my day 👍 |
@acoulson2000 's answer solved it for me. Fast and painless! |
@chrzimmer & @AlbertMN - how many client were you able to configure/verify working correctly? |
@AnalysIR My case is opposite of what most others are trying to achieve. I needed to limit the connections to 1, which is all I have tested. If one device is already connected to the AP other devices will simply be denied access. |
@AnalysIR my project came to a sudden stop, so i can not answer. Sorry. |
Where is the gethub link for the 8266 softAP code that allows the setting of max clients?? I tried the following and it wouldn't compile. |
@harleyfrazee maybe you to make sure you are on the latest version of Arduino and Arduino Core for ESP8266? The method is defined in this header file: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiAP.h |
Thanks, but I guess I messed up things on my laptop. I switched to ada_WiFi because I couldn't get the Arduino version to work. I continue to get "WiFi_AP_w_Blink:65: error: 'class WiFiClass' has no member named 'softAP' WiFi.softAP(ssid, password);" Do you know of instructions so that I could remove my current Arduino version and get the correct version from gethub and compile it? |
If you have the esp8266 installed under board manager, you're probably good- you probably just need to #include <ESP8266WIFI.h> instead of whatever WiFi library you are trying to use. |
hello everyone! |
It's better to use the zigbee module |
I used to use Zigbees, but one of the main things that got me interested in esp's was the cost of Zigbee's - ~$30/ea, plus a carrier bored with a "non-standard" pin spacing. Then, you still need an processor on reach client to do much. There are some inexpensive RF comm chips out there - in fact I got a bunch like the ones below, but I haven't tried to do anything with them yet. |
ESP-MESH can help to create 70 nodes. |
How many clients can connect to the module in Access point mode?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: