-->
Page 1 of 2

AP: Limited or no Connectivity.

PostPosted: Mon May 01, 2023 6:22 am
by esp8266_dude
Hello,
I made several projects using one ESP8266 as AP (access point), and another as STAs (stations). Sometimes I also use PC as another STA.
As PC are used rarely here, so I missed some strange issue.
"Slave" ESPs connects to ESP AP without problems. And, for example, exchange UDP packets successfully.
My main PC also connects to this WiFi network without problems:
But I recently discovered, that some another PCs, have issue with connection:
Conn.jpg

I have to go to network setting, an manually attach IP address:
tcpipw2k-2426760703.gif

Then connection works fine.
But this is very inconvenient in use, because when I want to back to main internet WiFi connection, I have to restore this settings to previous state (automatic IP setup).
This PCs never have issues with connects to "normal" access points (routers).
I can connect them to any network without problems.
Only connection to ESP8266 AP give my that issue.
I know that some sources of this issue may be correlated to these PCs, but also it must be something on ESP settings, due to fact that these PCs connects successfully to normal WiFi networks (from TP-Link, etc.).
ESP8266 code is very simple:
Code: Select all#include <ESP8266WiFi.h>
#include <WiFiUdp.h>

const char* ssid = "ESP8266_WiFi_0";
const char* password = "1234ABCD";
const int AP_Channel = 4;
const int AP_Max_Connection = 4;

IPAddress local_IP(192,168,1,1);
IPAddress gateway(192,168,1,200);
IPAddress subnet(255,255,255,0);


WiFiUDP UDP1;
uint8_t UDP_RX[2048];


void setup()
{
  Serial.begin(115200);

  Serial.println("Setting AP");

  Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed");

  Serial.println("Setting AP");

  Serial.println(WiFi.softAP(ssid, password, AP_Channel, false, AP_Max_Connection) ? "Ready" :

"Failed");

  Serial.print("AP address: ");
  Serial.println(WiFi.softAPIP());

  UDP1.begin(1000);
}

void loop()
{
  uint8_t i;

  UDP_RX_packet_size = UDP1.parsePacket();
  if (UDP_RX_packet_size > 0)
      {
      UDP1.read((uint8_t*)UDP_RX, UDP_RX_packet_size);

      for (i = 0; i < DP_RX_packet_size; i++)
          Serial.write(UDP_RX[i]);
      }
}

I also tried another IP settings on ESP.
For example, classic ESP8266 IP:
192.168.4.1
Unfortunately without success.
So my question is, if somebody has similar issue and have any solution?
Or any hints what I have to check to find out what exactly triggers this error?
Best regards

Re: AP: Limited or no Connectivity.

PostPosted: Fri May 05, 2023 9:06 am
by rooppoorali
It sounds like the issue you are experiencing may be related to the DHCP (Dynamic Host Configuration Protocol) settings on your ESP8266 AP. When a device connects to a network, it requests an IP address from a DHCP server, which assigns it a unique address on the network.

It's possible that the PCs that are having trouble connecting to your ESP8266 AP are not able to obtain an IP address automatically, which is why you have to manually assign an IP address to them. This could be due to a number of factors, such as conflicting IP addresses or incompatible DHCP settings.
Make sure that DHCP is enabled and that the IP address range is set correctly.

Re: AP: Limited or no Connectivity.

PostPosted: Fri May 05, 2023 11:53 pm
by esp8266_dude
How Can I check DHCP settings?
Almost none of tutorials configure DHCP at all.
https://www.aranacorp.com/en/configure- ... ess-point/
https://arduino-esp8266.readthedocs.io/ ... class.html
Also I found this:
https://github.com/esp8266/Arduino/issues/1956
WereCatf wrote:@NarinLab Take a look at http://arduino-esp8266.readthedocs.io/e ... ftapconfig -- if you specify the ESP8266's IP-address as e.g. 192.168.43.1, the function softAPConfig() sets the DHCP-range as 192.168.43.100 - 192.168.43.200.

So I thought that DHCP are configured automatically.

Re: AP: Limited or no Connectivity.

PostPosted: Tue Jun 20, 2023 1:46 am
by esp8266_dude
I would like to conquer the topic, because the number of ESP8266 to which it is impossible to connect, increase.
The same situation: another ESP connects without problems, PCs not.
Could someone tell me how to configure DHCP in ESP8266 Acces Point?