[GH-ISSUE #1560] Hostname, Darkmode not working on Arduino IDE #1331

Closed
opened 2026-02-28 01:29:37 +03:00 by kerem · 1 comment
Owner

Originally created by @Juanc179 on GitHub (Feb 6, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1560

WiFimanager Branch/Release: 2.0.15-rc.1

Esp8266/Esp32: ESP32

Core Version: ARDUINO IDE 2.0.3 | ESP-IDF 4.4

Problem description

Hi,
i was trying to set a custom hostname for my project and using WiFi.hostname() or WiFi.setHostname didn't work. code compiled succesfully and library worked well; it created the AP and then switched to my wifi network properly. I also tried setting darkmode and the app looked the same way :c. I tried puting the lines with the configuration at different parts of the setup and had no result.

i read a problem from august related to this claiming that it was solved. maybe is a problem with arduino ide, should i only use vs code and arduino as a component? can i use the latest ESP-IDF version (5.0) if i work with arduino as a component (in vs code) or i am anyways limited by arduino?i really want to use this library, can i use it directly from IDF?

i'am really a newby with wifi protocols and i switched to arduino just by beeing uncapable of dealing with wifi directly on the idf without any library to help me.

Module: ESP32 DEV MODULE

Sketch

#BEGIN

#include <String.h>
#include "time.h"
#include <ESP32Time.h>
#include <esp_log.h>
#include "Adafruit_AHTX0.h"
#include "freertos/task.h"
#include "WiFi.h"
#include "esp_sntp.h"

#include "WiFiManager.h"

void setup() {
Serial.begin (115200);
  for(int i=0; i<17; i=i+8) {
	  chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
	}ESP_LOGI(*TagSETUP,"Chip ID: %i",chipId); ESP_LOGI(*TagSETUP,"ESP Restart counter: %i.",resetCounter);
  resetCounter++;
  ESP_LOGI(*TagSETUP,"Starting protocols...");
  initGPIO();
  initISR();
// configs start here...
  WiFi.setHostname("My ESP"); //define hostname
  wm.setClass("invert"); // dark theme
  wm.setMinimumSignalQuality(10);
// i tried moving this part above before and after all the functions of the library.
  WiFi.mode(WIFI_STA);
  wm.resetSettings();
  bool res;
  res = wm.autoConnect("1234-Setup","1234setup");
  if(!res){
    ESP_LOGI(*TagSETUP,"Failed to connect to AP.");
  }
  else {
    ESP_LOGI(*TagSETUP,"WiFi Connection established succesfully.");
  }

  ESP_LOGI(*TagSETUP,"Setup ended succesfully.");
}

void loop() {
//i am not looping anything yet...
}
#END

Debug Messages

no debbug messages, code is compiling and working(except those functions)
Originally created by @Juanc179 on GitHub (Feb 6, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1560 WiFimanager Branch/Release: 2.0.15-rc.1 Esp8266/Esp32: ESP32 Core Version: ARDUINO IDE 2.0.3 | ESP-IDF 4.4 Problem description Hi, i was trying to set a custom hostname for my project and using WiFi.hostname() or WiFi.setHostname didn't work. code compiled succesfully and library worked well; it created the AP and then switched to my wifi network properly. I also tried setting darkmode and the app looked the same way :c. I tried puting the lines with the configuration at different parts of the setup and had no result. i read a problem from august related to this claiming that it was solved. maybe is a problem with arduino ide, should i only use vs code and arduino as a component? can i use the latest ESP-IDF version (5.0) if i work with arduino as a component (in vs code) or i am anyways limited by arduino?i really want to use this library, can i use it directly from IDF? i'am really a newby with wifi protocols and i switched to arduino just by beeing uncapable of dealing with wifi directly on the idf without any library to help me. Module: ESP32 DEV MODULE ### Sketch ```cpp #BEGIN #include <String.h> #include "time.h" #include <ESP32Time.h> #include <esp_log.h> #include "Adafruit_AHTX0.h" #include "freertos/task.h" #include "WiFi.h" #include "esp_sntp.h" #include "WiFiManager.h" void setup() { Serial.begin (115200); for(int i=0; i<17; i=i+8) { chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i; }ESP_LOGI(*TagSETUP,"Chip ID: %i",chipId); ESP_LOGI(*TagSETUP,"ESP Restart counter: %i.",resetCounter); resetCounter++; ESP_LOGI(*TagSETUP,"Starting protocols..."); initGPIO(); initISR(); // configs start here... WiFi.setHostname("My ESP"); //define hostname wm.setClass("invert"); // dark theme wm.setMinimumSignalQuality(10); // i tried moving this part above before and after all the functions of the library. WiFi.mode(WIFI_STA); wm.resetSettings(); bool res; res = wm.autoConnect("1234-Setup","1234setup"); if(!res){ ESP_LOGI(*TagSETUP,"Failed to connect to AP."); } else { ESP_LOGI(*TagSETUP,"WiFi Connection established succesfully."); } ESP_LOGI(*TagSETUP,"Setup ended succesfully."); } void loop() { //i am not looping anything yet... } #END ``` ### Debug Messages ``` no debbug messages, code is compiling and working(except those functions) ```
kerem closed this issue 2026-02-28 01:29:37 +03:00
Author
Owner

@tablatronix commented on GitHub (Feb 6, 2023):

    // set dark mode via invert class
    void          setDarkMode(bool enable);

    // set a custom hostname, sets sta and ap dhcp client id for esp32, and sta for esp8266
    bool          setHostname(const char * hostname);
    bool          setHostname(String hostname);
<!-- gh-comment-id:1419507095 --> @tablatronix commented on GitHub (Feb 6, 2023): ```C++ // set dark mode via invert class void setDarkMode(bool enable); // set a custom hostname, sets sta and ap dhcp client id for esp32, and sta for esp8266 bool setHostname(const char * hostname); bool setHostname(String hostname); ```
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#1331
No description provided.