Using ESP8266 as an access point

Code tips and tricks for beginners
ulli
Posts: 12
Joined: Tue Feb 09, 2021 9:48 am
Been thanked: 2 times

Using ESP8266 as an access point

Post by ulli »

Hi all,

for some obscure reason I can't get my ESP8266 to work as an AP with an IP address other than 192.168.4.1.

Is there a way to either use the config page or some magic wifi commands incantation to let it be an AP at i.e. 10.0.0.1?

Any hint is much appreciated. Thnk you all for your kind support.

Cheers

Ulli
AndyGadget
Posts: 63
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 24 times
Been thanked: 54 times

Re: Using ESP8266 as an access point

Post by AndyGadget »

Hmm, I can confirm that. I've just tried to set up an ESP8266 in AP mode via the config screen and it will only use its ESP.... SSID at 192.168.4.1
However it does pick up the channel I specify. Annex version is 1.43.

(BTW, I'm glad to see someone else not using the boring old 192.168.x.x range. I use 10.10.10.x as it's soooo much quicker to type :D )
cicciocb
Site Admin
Posts: 309
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 85 times
Been thanked: 197 times
Contact:

Re: Using ESP8266 as an access point

Post by cicciocb »

Hi,
I'll give a try later today too see what is the problem.
cicciocb
Site Admin
Posts: 309
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 85 times
Been thanked: 197 times
Contact:

Re: Using ESP8266 as an access point

Post by cicciocb »

I just tested and it works perfectly.
Have you entered all the parameters, including the gateway ?
AndyGadget
Posts: 63
Joined: Mon Feb 15, 2021 1:44 pm
Has thanked: 24 times
Been thanked: 54 times

Re: Using ESP8266 as an access point

Post by AndyGadget »

I'd left the gateway blank, but unfortunately I was testing this on a project which is all glued together . . and I've foolishly just locked myself out of it.
I'll need to get inside and re-flash it, then try with all parameters.

Ulli, have you fully configured yours?
ulli
Posts: 12
Joined: Tue Feb 09, 2021 9:48 am
Been thanked: 2 times

Re: Using ESP8266 as an access point

Post by ulli »

Hi Andy,

thanks for backing me up. Good feeling not to be the only one having problems here.

Hi cicciocb,

good to have the confirmation (from the author) that it works. No, I didn't specify a gateway as there is none. What should I enter there?

Cheers

Ulli
cicciocb
Site Admin
Posts: 309
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 85 times
Been thanked: 197 times
Contact:

Re: Using ESP8266 as an access point

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Thu May 13, 2021 9:46 pm Hi Andy,

thanks for backing me up. Good feeling not to be the only one having problems here.

Hi cicciocb,

good to have the confirmation (from the author) that it works. No, I didn't specify a gateway as there is none. What should I enter there?

Cheers

Ulli
put the same IP as the module local IP
To be clear, put the same IP in the first and last IP boxes of the config page
image.png
You do not have the required permissions to view the files attached to this post.
ulli
Posts: 12
Joined: Tue Feb 09, 2021 9:48 am
Been thanked: 2 times

Re: Using ESP8266 as an access point

Post by ulli »

Thank you, cicciocb,

I'll give it a try. Can only reply my findings on Monday.

Have a great weekend.

Ulli
ulli
Posts: 12
Joined: Tue Feb 09, 2021 9:48 am
Been thanked: 2 times

Re: Using ESP8266 as an access point

Post by ulli »

Hi all,

just tried it filling in the gateway field with the same IP address and it now works as an AP.

Unfortunately, this is only half of what I'm trying to accomplish:

I have a home network, say 192.168.10.0/24 with gateway address 1. I want the ESP run in station mode with IP address 22. When I'm out of reach of my home network I want my ESP switch to AP mode with 10.0.0.1

As it is now, I cannot configure this in the /config page. Maybe there is a programmatic way. Not as nice as I would wish to have, but ok.

Thanks for any hints

Ulli
ulli
Posts: 12
Joined: Tue Feb 09, 2021 9:48 am
Been thanked: 2 times

Re: Using ESP8266 as an access point

Post by ulli »

sorry, forgot to say, an immediate reconfiguration during program run is not necessary. It is perfectly ok to try to connect as STA on startup and, if it fails, open an AP with a constant IP address different from the STA network.

Example:
Switch on
try to connect to 192.168.10.0/24 with own IP 192.168.10.22
if that fails start AP mode with address 10.0.0.1/24

Cheers

Ulli
Post Reply