Updating wifi conf while running

lchazall
Posts: 7
Joined: Tue Nov 22, 2016 7:26 pm

Updating wifi conf while running

Postby lchazall » Thu Feb 16, 2017 5:52 pm

Hello,

I am trying to configure the esp32 as a station remotely.
So I first set the ESP32 as an access point, in order to get the SSID and the key (of a router) from a user interface.

Then, I want to connect to this router but without restarting wifi (just starting station), in order to give a feedback (via ESP AP) to user who entered logins (like "ESP32 is now connected and its IP is XXX.XXX.XXX.XXX").

What I tried is :
- Recieving SSID + KEY from user interface
- Adding it to sta configuration from wifi_config
- esp_start_wifi
- In event handler : If "start STA" event => connect
But I only get the "start STA" event when starting AP.

(the mode I have set at the beginning is APSTA)
How do you think I can handle that ?

(hoping you understood my issue) ;)
Best regards,
lchazall

lchazall
Posts: 7
Joined: Tue Nov 22, 2016 7:26 pm

Re: Updating wifi conf while running

Postby lchazall » Fri Feb 17, 2017 10:50 am

I solved this by myself.

I Just have to set config and then connect ... As simple as that.
Best regards,
lchazall

Plachol1992
Posts: 1
Joined: Mon Nov 20, 2017 9:48 am

Re: Updating wifi conf while running

Postby Plachol1992 » Mon Nov 20, 2017 9:55 am

Hi @lchazall I am also facing similar problem that i want to set wifi ssid and password while running system then connect to it. I am searching everywere but i can't find any helpfull code to se how it works to implement it in my system. Do You have any codes that will show how you resolved this problem and how it works from software site ? Best Regards Adam

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Updating wifi conf while running

Postby kolban » Mon Nov 20, 2017 1:45 pm

I had a similar need and came up with this a while back:

https://github.com/nkolban/esp32-snippe ... g/bootwifi

there is also a new project from github user tonyp7:

https://github.com/tonyp7/esp32-wifi-manager

which looks pretty good too.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: No registered users and 229 guests