[GH-ISSUE #1191] How to connect and disconnect to wifi cyclically #1019

Closed
opened 2026-02-28 01:28:09 +03:00 by kerem · 6 comments
Owner

Originally created by @jordan1982 on GitHub (Jan 17, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1191

PLEASE TRY DEVELOPMENT BRANCH before submitting bugs on release or master, in case they were already fixed.

Issues without basic info will be ignored or closed!

Please fill the info fields, it helps to get you faster support ;)

if you have a stack dump decode it:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.rst

for better debug messages:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst

----------------------------- Remove above -----------------------------

Basic Infos

Hardware

WiFimanager Branch/Release: Development

Esp8266/Esp32:

Hardware: ESP-12e, esp01, esp25

Core Version: 2.4.0, staging

Description

Problem description

Settings in IDE

Module: NodeMcu, Wemos D1

Additional libraries:

Sketch


#include <Arduino.h>

void setup() {

}

void loop() {

}

Debug Messages

messages here

Hi,
I would need to connect and disconnect cyclically. I give an example:
The user enters the data via the web interface (ssid, password, mqtt server, mqtt user, mqtt password etc), the system waits 5 minutes and then connects to mqtt sends the message and then disconnects from mqtt and wifi. After another 5 minutes it reconnects to the previous wifi and repeats the loop.
How can I connect and disconnect from wifi through your library?

Originally created by @jordan1982 on GitHub (Jan 17, 2021). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1191 ## PLEASE TRY DEVELOPMENT BRANCH before submitting bugs on release or master, in case they were already fixed. ## Issues without basic info will be ignored or closed! Please fill the info fields, it helps to get you faster support ;) if you have a stack dump decode it: https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.rst for better debug messages: https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst ----------------------------- Remove above ----------------------------- ### Basic Infos #### Hardware WiFimanager Branch/Release: Development Esp8266/Esp32: Hardware: ESP-12e, esp01, esp25 Core Version: 2.4.0, staging ### Description Problem description ### Settings in IDE Module: NodeMcu, Wemos D1 Additional libraries: ### Sketch ```cpp #include <Arduino.h> void setup() { } void loop() { } ``` ### Debug Messages ``` messages here ``` Hi, I would need to connect and disconnect cyclically. I give an example: The user enters the data via the web interface (ssid, password, mqtt server, mqtt user, mqtt password etc), the system waits 5 minutes and then connects to mqtt sends the message and then disconnects from mqtt and wifi. After another 5 minutes it reconnects to the previous wifi and repeats the loop. How can I connect and disconnect from wifi through your library?
kerem 2026-02-28 01:28:09 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@svdrummer commented on GitHub (Feb 4, 2021):

Google ESP.Sleep() that's how we do it.

<!-- gh-comment-id:773267864 --> @svdrummer commented on GitHub (Feb 4, 2021): Google ESP.Sleep() that's how we do it.
Author
Owner

@tablatronix commented on GitHub (Feb 4, 2021):

Same way you would with any esp code.. nothing special here

<!-- gh-comment-id:773336708 --> @tablatronix commented on GitHub (Feb 4, 2021): Same way you would with any esp code.. nothing special here
Author
Owner

@jordan1982 commented on GitHub (Mar 13, 2021):

With esp.sleep the data entered in the configuration page are lost?
Thanks for the help you can give me

<!-- gh-comment-id:798771802 --> @jordan1982 commented on GitHub (Mar 13, 2021): With esp.sleep the data entered in the configuration page are lost? Thanks for the help you can give me
Author
Owner

@tablatronix commented on GitHub (Mar 13, 2021):

data such as wifi ? or custom params?

<!-- gh-comment-id:798776707 --> @tablatronix commented on GitHub (Mar 13, 2021): data such as wifi ? or custom params?
Author
Owner

@jordan1982 commented on GitHub (Mar 14, 2021):

wifi and custom params

<!-- gh-comment-id:798930275 --> @jordan1982 commented on GitHub (Mar 14, 2021): wifi and custom params
Author
Owner

@tablatronix commented on GitHub (Mar 14, 2021):

well custom params have to be saved somewhere, esp wont remember them sleep is really a reboot

<!-- gh-comment-id:798934969 --> @tablatronix commented on GitHub (Mar 14, 2021): well custom params have to be saved somewhere, esp wont remember them `sleep` is really a reboot
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1019
No description provided.