We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wish option that we can change port in setup().
Hardware: Wemos D1 Mini Core Version: 2.1.0-rc2
I try to create ESP8266WebServer and use config structure. In my config structure has web_port for config ESP8266WebServer's port.
How I can change port of ESP8266WebServer in setup() ?
Module: Wemos D1 Mini Flash Size: 4MB CPU Frequency: 80Mhz Flash Mode: qio Flash Frequency: 40Mhz Upload Using: SERIAL Reset Method: nodemcu
#include <ESP8266WiFi.h> #include <ESP8266WebServer.h> ESP8266WebServer webserver(80); struct __config { uint8_t ssid[32]; uint8_t passwod[64]; uint16_t web_port; } config; void setup() { sprintf( (char*) config.ssid , "%s", "-----SSID-----"); sprintf( (char*) config.password, "%s", "-----PASSWORD-----"); config.web_port = (uint16_t) 8080; Serial.begin(115200); WiFi.begin((char*) config.ssid, (char*) config.password); while(!WiFi.isConnected()) delay(400); Serial.printf("WiFi connected , IP : %s\r\n", WiFi.localIP().toString().c_str()); // At here I wish to change webserver 's port // by config after declare ESP8266WebServer's object. //webserver( config.web_port); webserver.on("/", [](){ webserver.send(200, "text/html", "Hello Webserver"); }); webserver.begin(); } void loop() { webserver.handleClient(); }
The text was updated successfully, but these errors were encountered:
Man, does this line gives you any clue? ;-) ESP8266WebServer webserver(80);
Sorry, something went wrong.
@caverna
here I wish to change webserver 's port by config after declare ESP8266WebServer's object.
(emphasis mine)
I think this is a valid request, perhaps we can fix the issue with assignment between ESP8266WebServer objects to support it.
Closing as same basic issue as #4085. @TridentTD please follow to the linked issue and click "Subscribe" to receive notifications.
Thank you @igrr
No branches or pull requests
Basic Infos
Wish option that we can change port in setup().
Hardware
Hardware: Wemos D1 Mini
Core Version: 2.1.0-rc2
Description
I try to create ESP8266WebServer and use config structure.
In my config structure has web_port for config ESP8266WebServer's port.
How I can change port of ESP8266WebServer in setup() ?
Settings in IDE
Module: Wemos D1 Mini
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: nodemcu
Sketch
The text was updated successfully, but these errors were encountered: