mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1183] wifi_country_t does not name a type error #1010
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#1010
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 @caster1 on GitHub (Jan 3, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1183
hi im using code template as below and I'm getting this error
`#include <ESP8266WiFi.h>
#include <WiFiManager.h>
#include <PubSubClient.h>
WiFiClient espClient;
PubSubClient client(espClient);
void mqttCallback(char* topic, byte* payload, unsigned int length) {
// message received
}
void mqttReconnect() {
// reconnect code from PubSubClient example
}
void WiFiManager::setCountry(String IN){
_wificountry = IN;
}
void setup() {
WiFiManager wifiManager;
wifiManager.setTimeout(180);
}
void loop() {
if (!client.connected()) {
mqttReconnect();
}
client.loop();
yield();
}`
my error is
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"
In file included from C:\Users\sai\Documents\Arduino\libraries\WiFiManager/WiFiManager.h:96:0,
C:\Users\sai\Documents\Arduino\libraries\WiFiManager/strings_en.h:358:7: error: 'wifi_country_t' does not name a type
const wifi_country_t WM_COUNTRY_US{"US",1,11,WIFI_COUNTRY_POLICY_AUTO};
C:\Users\sai\Documents\Arduino\libraries\WiFiManager/strings_en.h:359:7: error: 'wifi_country_t' does not name a type
const wifi_country_t WM_COUNTRY_CN{"CN",1,13,WIFI_COUNTRY_POLICY_AUTO};
C:\Users\sai\Documents\Arduino\libraries\WiFiManager/strings_en.h:360:7: error: 'wifi_country_t' does not name a type
const wifi_country_t WM_COUNTRY_JP{"JP",1,14,WIFI_COUNTRY_POLICY_AUTO};
exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).
@tablatronix commented on GitHub (Jan 3, 2021):
What version are you using ?
Either your esp lib or wm is outdated
@caster1 commented on GitHub (Jan 6, 2021):
tried everything from 2.0.3 alphato 2.0.1 alpha
@luisesn commented on GitHub (Feb 2, 2021):
I have just had this problem and after losing about 1 hour it seems the problem is that you have to add
#include <ESP8266WiFi.h>before the wifimanager include, the examples provided with the library doesn't work for me without this.
@tablatronix commented on GitHub (Feb 2, 2021):
What is your board definition ?
@tablatronix commented on GitHub (Feb 2, 2021):
I mean it makes no sense, the library only works with esp8266 or esp32 and
shrug
@luisesn commented on GitHub (Feb 2, 2021):
I am using nodemcu 1.0 and tried the generic esp8266, both gave the same problem.
Esp version is 2.7.4
WifiManager is master .zip file just downloaded today
@luisesn commented on GitHub (Feb 2, 2021):
The board.txt definition for the nodemcu (and several others) lack this "-DESP8266" in their options.
I don't know how arduino works at that level but maybe its related
@tablatronix commented on GitHub (Feb 2, 2021):
I use nodemcu on platformio never had an issue
Do you have verbose logging on arduino, can you copy the compile logs?
@luisesn commented on GitHub (Feb 2, 2021):
Yep, here it goes:
@tablatronix commented on GitHub (Feb 2, 2021):
hmm
What is this? Seems odd, let em check mine
@luisesn commented on GitHub (Feb 2, 2021):
If I use the #define t uses the same libs (just the relevant part) and it compiles ok
@tablatronix commented on GitHub (Feb 2, 2021):
Works for me
@tablatronix commented on GitHub (Feb 2, 2021):
What does your sketch look like? Are you using setCountry() ?
@tablatronix commented on GitHub (Feb 2, 2021):
I am not using cutting edge, I am using the lib manager one, maybe that has something to do with it. Ill have to install my extra boards and all that, compiling the dev/* example on the alpha
@luisesn commented on GitHub (Feb 2, 2021):
Just some copy-paste boilerplate:
@tablatronix commented on GitHub (Feb 5, 2021):
Very strange, I will try to install the github on arduino and see if I can get the same with that
@caster1 commented on GitHub (Feb 8, 2021):
everyone sorry for the late reply the issue was with not including adrduino json library include that and you'll be good
@tablatronix commented on GitHub (Feb 8, 2021):
So strange how compilers do that sometime, throw unrelated errors
You should only have to include it if you are actually using it though
@caster1 commented on GitHub (Feb 15, 2021):
so every one its back again
my code
@tablatronix commented on GitHub (Feb 15, 2021):
I would almost suspect you have duplicate libraries or something
@caster1 commented on GitHub (Feb 16, 2021):
will check that once I'm at my desktop, can you please compile my code?