[GH-ISSUE #1462] Possible to keep over the air uploads when connected to wifi? #1252

Closed
opened 2026-02-28 01:29:15 +03:00 by kerem · 9 comments
Owner

Originally created by @jackkitley on GitHub (Jul 27, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1462

Basic Infos

Hardware

WiFimanager Latest

Esp8266: ESP 12F

Hardware: ESP-12f

Core Version: 2.4.0, staging

Description

I wanted to know when connected to WIFI that i could access the assigned IP address to still be able to upload .bin files. Is this possible?

Thanks

Additional libraries:

Sketch

#BEGIN
#include <Arduino.h>

void setup() {

}

void loop() {

}
#END

Debug Messages

messages here
Originally created by @jackkitley on GitHub (Jul 27, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1462 ### Basic Infos #### Hardware WiFimanager Latest Esp8266: ESP 12F Hardware: ESP-12f Core Version: 2.4.0, staging ### Description I wanted to know when connected to WIFI that i could access the assigned IP address to still be able to upload .bin files. Is this possible? Thanks Additional libraries: ### Sketch ```cpp #BEGIN #include <Arduino.h> void setup() { } void loop() { } #END ``` ### Debug Messages ``` messages here ```
kerem 2026-02-28 01:29:15 +03:00
  • closed this issue
  • added the
    Question
    label
Author
Owner

@tablatronix commented on GitHub (Jul 27, 2022):

Yes, just you normally would

<!-- gh-comment-id:1196872148 --> @tablatronix commented on GitHub (Jul 27, 2022): Yes, just you normally would
Author
Owner

@jackkitley commented on GitHub (Jul 27, 2022):

Hmm, when the AP is up its 192.168.4.1 but when its connected to router then if i access the IP i get nothing. So it doesnt spin up an interface to configure settings. Im wanting to upload a new .bin file.

<!-- gh-comment-id:1196977808 --> @jackkitley commented on GitHub (Jul 27, 2022): Hmm, when the AP is up its 192.168.4.1 but when its connected to router then if i access the IP i get nothing. So it doesnt spin up an interface to configure settings. Im wanting to upload a new .bin file.
Author
Owner

@tablatronix commented on GitHub (Jul 27, 2022):

oh you mean httpupload? not arduinoota?

use startwebportal() ondemand example

<!-- gh-comment-id:1196985072 --> @tablatronix commented on GitHub (Jul 27, 2022): oh you mean httpupload? not arduinoota? use startwebportal() ondemand example
Author
Owner

@jackkitley commented on GitHub (Jul 27, 2022):

Yes sir.

I did try startwebportal() from your example but didnt seem to work. ill try again with my D1 mini.

So startwebportal() serves the exact same AP page?

Thank you.

<!-- gh-comment-id:1196997315 --> @jackkitley commented on GitHub (Jul 27, 2022): Yes sir. I did try startwebportal() from your example but didnt seem to work. ill try again with my D1 mini. So startwebportal() serves the exact same AP page? Thank you.
Author
Owner

@tablatronix commented on GitHub (Jul 27, 2022):

Yes just without starting the softap configportal
configportal is softap+httpd+captiveportal
webportal is httpdserver only

https://github.com/tzapu/WiFiManager/blob/master/examples/OnDemand/OnDemandWebPortal/onDemandWebPortal.ino

<!-- gh-comment-id:1197068185 --> @tablatronix commented on GitHub (Jul 27, 2022): Yes just without starting the softap configportal configportal is softap+httpd+captiveportal webportal is httpdserver only https://github.com/tzapu/WiFiManager/blob/master/examples/OnDemand/OnDemandWebPortal/onDemandWebPortal.ino
Author
Owner

@jackkitley commented on GitHub (Jul 27, 2022):

Yes, this is what i have right now and in the loop i had the portal start.

WiFiClient espClient;

 void setup() {
  Serial.begin(9600);

  pinMode(TRIGGER_PIN, INPUT);
//  pinMode(LED_BUILTIN, OUTPUT);

  loadConfigFile();
  setupWifiManager();
}
void loop() {
//  checkButton();

  reconnect_mqtt();
  client.loop();

//  wifiManager.startWebPortal();
}
void setupWifiManager()
{
  WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 20);
  WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port, 10);
  WiFiManagerParameter custom_mqtt_user("user", "mqtt user", mqtt_user, 50);
  WiFiManagerParameter custom_mqtt_pass("pass", "mqtt pass", mqtt_pass, 50);

  // WiFiManager
  // Local intialization. Once its business is done, there is no need to keep it around
  //  WiFiManager wifiManager;

  //set config save notify callback
  wifiManager.setSaveConfigCallback(saveConfigCallback);

  //add all your parameters here
  wifiManager.addParameter(&custom_mqtt_server);
  wifiManager.addParameter(&custom_mqtt_port);
  wifiManager.addParameter(&custom_mqtt_user);
  wifiManager.addParameter(&custom_mqtt_pass);

  wifiManager.setConnectTimeout(180);
  wifiManager.setConnectRetries(100);
  if (wifiManager.getWiFiIsSaved()) wifiManager.setEnableConfigPortal(false);
  wifiManager.autoConnect("AP");


  //erases the wifi settings from chip. Going to add this to mqtt command and button press.
  //    wifiManager.resetSettings();

  strncpy(mqtt_server, custom_mqtt_server.getValue(), sizeof(mqtt_server));
  strncpy(mqtt_port, custom_mqtt_port.getValue(), sizeof(mqtt_port));
  strncpy(mqtt_user, custom_mqtt_user.getValue(), sizeof(mqtt_user));
  strncpy(mqtt_pass, custom_mqtt_pass.getValue(), sizeof(mqtt_pass));

  //save the custom parameters to FS
  if (shouldSaveConfig) {
    saveConfigFile();
  }
}
<!-- gh-comment-id:1197091725 --> @jackkitley commented on GitHub (Jul 27, 2022): Yes, this is what i have right now and in the loop i had the portal start. ``` WiFiClient espClient; ``` ``` void setup() { Serial.begin(9600); pinMode(TRIGGER_PIN, INPUT); // pinMode(LED_BUILTIN, OUTPUT); loadConfigFile(); setupWifiManager(); } ``` ``` void loop() { // checkButton(); reconnect_mqtt(); client.loop(); // wifiManager.startWebPortal(); } ``` ``` void setupWifiManager() { WiFiManagerParameter custom_mqtt_server("server", "mqtt server", mqtt_server, 20); WiFiManagerParameter custom_mqtt_port("port", "mqtt port", mqtt_port, 10); WiFiManagerParameter custom_mqtt_user("user", "mqtt user", mqtt_user, 50); WiFiManagerParameter custom_mqtt_pass("pass", "mqtt pass", mqtt_pass, 50); // WiFiManager // Local intialization. Once its business is done, there is no need to keep it around // WiFiManager wifiManager; //set config save notify callback wifiManager.setSaveConfigCallback(saveConfigCallback); //add all your parameters here wifiManager.addParameter(&custom_mqtt_server); wifiManager.addParameter(&custom_mqtt_port); wifiManager.addParameter(&custom_mqtt_user); wifiManager.addParameter(&custom_mqtt_pass); wifiManager.setConnectTimeout(180); wifiManager.setConnectRetries(100); if (wifiManager.getWiFiIsSaved()) wifiManager.setEnableConfigPortal(false); wifiManager.autoConnect("AP"); //erases the wifi settings from chip. Going to add this to mqtt command and button press. // wifiManager.resetSettings(); strncpy(mqtt_server, custom_mqtt_server.getValue(), sizeof(mqtt_server)); strncpy(mqtt_port, custom_mqtt_port.getValue(), sizeof(mqtt_port)); strncpy(mqtt_user, custom_mqtt_user.getValue(), sizeof(mqtt_user)); strncpy(mqtt_pass, custom_mqtt_pass.getValue(), sizeof(mqtt_pass)); //save the custom parameters to FS if (shouldSaveConfig) { saveConfigFile(); } } ```
Author
Owner

@jackkitley commented on GitHub (Jul 27, 2022):

Thank you.
Huge help
Screenshot 2022-07-27 at 20 05 13

<!-- gh-comment-id:1197116847 --> @jackkitley commented on GitHub (Jul 27, 2022): Thank you. Huge help <img width="806" alt="Screenshot 2022-07-27 at 20 05 13" src="https://user-images.githubusercontent.com/3243014/181341818-2d921aa5-565f-404e-a198-32844ae4ac08.png">
Author
Owner

@jackkitley commented on GitHub (Jul 28, 2022):

@tablatronix Just one more question. I had params that i setup (in code above) but when i spin up the portal and go to /p or setup then there are no params.

The params i use are for MQTT settings? How can i get them to the portal as well as initial AP setup.

Thanks

<!-- gh-comment-id:1197796731 --> @jackkitley commented on GitHub (Jul 28, 2022): @tablatronix Just one more question. I had params that i setup (in code above) but when i spin up the portal and go to /p or setup then there are no params. The params i use are for MQTT settings? How can i get them to the portal as well as initial AP setup. Thanks
Author
Owner

@tablatronix commented on GitHub (Jul 29, 2022):

Sounds like a scope issue, are you setting your params in setup ?
You will need to make them global or static somehow

<!-- gh-comment-id:1199180237 --> @tablatronix commented on GitHub (Jul 29, 2022): Sounds like a scope issue, are you setting your params in setup ? You will need to make them global or static somehow
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#1252
No description provided.