mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1189] variable or field 'configModeCallback' declared void when ADC_MODE(ADC_VCC) is present in the code #1016
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1016
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @A4EVA on GitHub (Jan 10, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1189
Basic Infos
Hardware
WiFimanager Branch/Release: 2.0.3
Esp8266/Esp32:
Hardware: ESP-12e
Core Version: 2.7.4
Description
The use of ADC_MODE(ADC_VCC); to read the vcc voltage of the esp8266 module will cause a compilation error, removing the ADC_MODE(ADC_VCC); will resolve the compiler probelm but in my application is necessary to set the adc in this way. The problem is caused by ADC_MODE() because i alredy tried to compile my code commenting on library at a time and the problem never came up until i implemented the ADC_MODE. I need to know when the wifimanager has started the AP for the configuration so i can inform the user via on oled display. If there is a workaround let me know !
Settings in IDE
Module: Generic ESP8266
Additional libraries:
#include <ESP8266WiFi.h>
ADC_MODE(ADC_VCC); //vcc read-mode
#include <WiFiClientSecure.h>
#include <ESP8266mDNS.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
#include <TimeLib.h>
#include <ArduinoJson.h>
//#include "secret.h"
//#define TWI_TIMEOUT 3000
#include <TwitterWebAPI.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//gets called when WiFiManager enters configuration mode
void configModeCallback (WiFiManager *myWiFiManager) {
Serial.println("Entered config mode");
}
void setup() {
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
Serial.begin(115200);
//WiFiManager
//Local intialization. Once its business is done, there is no need to keep it around
WiFiManager wm;
//reset settings - for testing
// wm.resetSettings();
//set callback that gets called when connecting to previous WiFi fails, and enters Access Point mode
wm.setAPCallback(configModeCallback);
//fetches ssid and pass and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
if (!wm.autoConnect()) {
Serial.println("failed to connect and hit timeout");
//reset and try again, or maybe put it to deep sleep
ESP.restart();
delay(1000);
}
Serial.println("connected...yeey :)");
}
void loop() {
// put your main code here, to run repeatedly:
}
Debug Messages