Skip to content

ESP32 AP Mode Local IP #6270

@Fideus

Description

@Fideus

Board

ESP32

Device Description

Custom Board

Hardware Configuration

not relevant

Version

v1.0.6

IDE Name

Arduino

Operating System

Windows 10

Flash frequency

80

PSRAM enabled

no

Upload speed

921600

Description

Hello all,

I got a Problem Setting up an Access Point. there seems to be an DHCP server starting at Address x.x.x.241. This will cause an Problem if setting up the local IP in this range, like the example below.
Is there a option that this would be possible?
For my actual project the local IP Address could be changed by an user, and so this could cause problems.
Actual it works if I limit the local IP to x.x.x.240 But it would me more flexible if this isn't necessarry

Sketch

#include <WiFi.h>

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

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

  Serial.print("Setting soft-AP configuration ... ");
  Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");

  Serial.print("Setting soft-AP ... ");
  Serial.println(WiFi.softAP("ESPsoftAP_01") ? "Ready" : "Failed!");

  Serial.print("Soft-AP IP address = ");
  Serial.println(WiFi.softAPIP());
}

void loop() {}

Debug Message

Setting soft-AP configuration ... Failed!
Setting soft-AP ... Ready
Soft-AP IP address = 192.168.1.254

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Activity

self-assigned this
on Feb 15, 2022
SuGlider

SuGlider commented on Feb 16, 2022

@SuGlider
Collaborator

@Fideus

Regarding your specific question about using an IP address within DHCP Server range, you may want to set DHCP server parameters to add x.x.x.254 as a Reserved IP Address. It may be possible depending on your router options or on your Linux DHCP Server (I don't have any information about your network or DHCP server).

Or you may want to set ESP Static IP out of DHCP range, but still in the range within the same netmask.

Anyway, this is not related to ESP32 setup or ESP Arduino.

Observation:

The return (false) from softAPConfig(), although still sets the Static IP, is being fixed for the release of Arduino Core 2.0.3.
I see that you reported this issue for the Core 1.0.6.

If you want, you can try to apply the PR #6294 to your local machine with 1.0.6.

11 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @SuGlider@Fideus@VojtechBartoska

    Issue actions

      ESP32 AP Mode Local IP · Issue #6270 · espressif/arduino-esp32