Esp32 AP mode modify static IP?

If doesn't fit into any other category ....
Post Reply
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Esp32 AP mode modify static IP?

Post by Tony_A »

I am not able or don't know how to assign different static IP in AP mode from default 192.168.4.1.

Have tried in the config settings to put in new/different IP address in the IP address field.
For example 192.168.4.251.
Have tried Subnet mask 255.255.255.0
Have tried with Gateway 192.168.4.1, Not sure what this should be?
Have also given new Name in AP mode settings.

After save and reset.
AP name is changed.
But IP is still old default 192.168.4.1

Have not tried making changes through program wifi commands.

Would appreciate help.

Edit

Have tried using program WIFI.APMODE and it works until device is reset.
Looks like device uses default 192.168.4.1 after reset.
Any way of making the IP change so that it does not return to default after hard reset?

Edit

This is using latest 1.52.7 firmware with standard ESp32
User avatar
PeterN
Posts: 392
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 184 times
Been thanked: 220 times
Contact:

Re: Esp32 AP mode modify static IP?

Post by PeterN »

Hello Toni_A,

I don't know of any way to change the IP address for the WIFI AP in Annex32. This is perhaps because it would have little relevance in real environments.
Since the AP mode creates an isolated network that only allows a limited number of devices to connect to the AP and then specifically does not allow connection to the internet or any other private network, this should not be a relevant restriction. Or am I missing a use case where a different IP address for the AP could actually be helpful?
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: Esp32 AP mode modify static IP?

Post by Tony_A »

Thank you for a response Peter,

This is one user case that I am experimenting with.

Connecting to 2 ESP32 devices that are both in AP mode, from one development PC that has multiple WiFi adapters so PC can connect to 2 separate WiFis or 2 seperate ESp32 AP mode devices.

However, PC web browsers then have a conflict in connecting to separate ESp32 devices because of same IP address.

By the way using Win10 PC and MS Edge browser. I am in no way an expert on WiFi or networking at all. I guess there may be a way to get browsers to distinguish between the 2 separate AP networks using same IP, that I don't know how to do. But at the moment browsers are not distinguishing between the 2 ESp32 Ap networks or their same IP address.

Why am I using 2 ESp32 in AP mode in the same environment?
Because, this is the development environment and these Esp32 Ap devices will be deployed elsewhere to operate in AP mode.
So to me it seems easier not having to juggle WiFi settings.
User avatar
Electroguard
Posts: 860
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 276 times
Been thanked: 323 times

Re: Esp32 AP mode modify static IP?

Post by Electroguard »

Why am I using 2 ESp32 in AP mode in the same environment?
Because, this is the development environment and these Esp32 Ap devices will be deployed elsewhere to operate in AP mode.
So to me it seems easier not having to juggle WiFi settings.
It may help your use case to assign static IP addresses to your devices and Enable Fastboot in Config.

This would allow the devices to quickly connect to the router for browser access by their assigned IP addresses when within range.
But when out of router range they would quickly autorun while failing to reconnect to the router then could be accessed using the 192.168.4.1 default AP.

fastboot.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2058
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Esp32 AP mode modify static IP?

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Apr 27, 2024 12:13 am Thank you for a response Peter,

This is one user case that I am experimenting with.

Connecting to 2 ESP32 devices that are both in AP mode, from one development PC that has multiple WiFi adapters so PC can connect to 2 separate WiFis or 2 seperate ESp32 AP mode devices.

However, PC web browsers then have a conflict in connecting to separate ESp32 devices because of same IP address.

By the way using Win10 PC and MS Edge browser. I am in no way an expert on WiFi or networking at all. I guess there may be a way to get browsers to distinguish between the 2 separate AP networks using same IP, that I don't know how to do. But at the moment browsers are not distinguishing between the 2 ESp32 Ap networks or their same IP address.

Why am I using 2 ESp32 in AP mode in the same environment?
Because, this is the development environment and these Esp32 Ap devices will be deployed elsewhere to operate in AP mode.
So to me it seems easier not having to juggle WiFi settings.
Just a little clarification :
  • Tony_A is right, there is a bug in Annex32 as the IP set in the config page is not taken into account when in AP mode.
    It will be fixed in the next release
  • You can have several modules in AP mode (with different IP addresses) but you'll not be able to connect simultaneously to them because each module will require an individual WIFI connection
    For example, your PC should have 3 WIFI cards (or 3 WIFI USB wifi dongles) if you require a connection with 3 modules (and maybe 4 if your PC is connected with internet using the WiFi)
So, even changing the individual IP for each module you'll not be able to connect - at the same time - to them but you'll be obliged to choose the one you want use selecting the wifi connection (except if you have multiple wifi cards in your PC).
Tony_A
Posts: 16
Joined: Sun Dec 31, 2023 8:08 am
Has thanked: 7 times
Been thanked: 5 times

Re: Esp32 AP mode modify static IP?

Post by Tony_A »

Thank you Francesco.

I understand about requirement for multiple WiFi cards on PC to connect to multiple devices in AP Mode. I have multiple WiFi interfaces on my development PC.

Please see my post in Troubleshooting about problem I am having with ESPNOW in mixed AP+STA mode.
Post Reply