0 votes
in Touch Interface by (150 points)

HI,

Can somebody help me please.

Recently I bought the esp8266-weather-station-color kit. I am trying to compile the code after changing the setting.h file for my network.

After compiling I get the following errors:

exit status 1

'WiFi' was not declared in this scope

Thanks.

Regards,

Eb Wijkstra

by (19.9k points)
There's quite likely more output than this, isn't there? Did you follow the instructions at https://docs.thingpulse.com/guides/wifi-color-display-kit in particular the "Prepare Arduino IDE for ESP8266" part? I cannot reproduce this with the latest code and ESP8266 Arduino Core  2.9.x and 3.0.x.
by (150 points)
Hi Marcel,

Yes I did follow the docs exactly as described. I am pretty new to all of this and have no idea what to do. It should not be that difficult, when the code is copied and compiled.

I might delete everything again and start all over. Will keep you posted.

Thanks for your suggestion.

Kind regards,

Eb W.
by (150 points)
Uploaded the esp8266 weather station folder again, checked if the libraries where correct and checked the correct board. All seem to be OK.

Still get this exit error, where 'WiFi and associated declarations' were not declared in this scope.

Any ideas what is wrong???

Thanks.

Kind regards,

Eb W.
by (150 points)
This is part of the error report.
"Compile" is stuck at Line 621 drawLabelValue(9, etc)

Arduino: 1.8.16 (Mac OS X), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:3MB OTA:~512KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

/Users/ebwijkstra/Documents/Arduino/Libraries/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino: In function 'void connectWifi()':
esp8266-weather-station-color:130:7: error: 'WiFi' was not declared in this scope
  130 |   if (WiFi.status() == WL_CONNECTED) return;
      |       ^~~~
esp8266-weather-station-color:130:24: error: 'WL_CONNECTED' was not declared in this scope
  130 |   if (WiFi.status() == WL_CONNECTED) return;
      |                        ^~~~~~~~~~~~
esp8266-weather-station-color:133:3: error: 'WiFi' was not declared in this scope
  133 |   WiFi.disconnect();
      |   ^~~~
esp8266-weather-station-color:134:13: error: 'WIFI_STA' was not declared in this scope; did you mean 'WIFI_SSID'?
  134 |   WiFi.mode(WIFI_STA);
      |             ^~~~~~~~
      |             WIFI_SSID
esp8266-weather-station-color:138:27: error: 'WL_CONNECTED' was not declared in this scope
  138 |   while (WiFi.status() != WL_CONNECTED) {
      |                           ^~~~~~~~~~~~
/Users/ebwijkstra/Documents/Arduino/Libraries/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino: In function 'int8_t getWifiQuality()':
esp8266-weather-station-color:521:17: error: 'WiFi' was not declared in this scope
  521 |   int32_t dbm = WiFi.RSSI();
      |                 ^~~~
/Users/ebwijkstra/Documents/Arduino/Libraries/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino: In function 'void drawAbout()':
esp8266-weather-station-color:621:46: error: 'WiFi' was not declared in this scope
  621 |   drawLabelValue(9, "WiFi Strength:", String(WiFi.RSSI()) + "dB");
      |                                              ^~~~
Multiple libraries were found for "WiFiClient.h"
 Used: /Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi
 Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
Using library esp8266-weather-station-color in folder: /Users/ebwijkstra/Documents/Arduino/libraries/esp8266-weather-station-color (legacy)
Using library SPI at version 1.0 in folder: /Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/SPI
Using library ThingPulse_XPT2046_Touch at version 1.4 in folder: /Users/ebwijkstra/Documents/Arduino/libraries/ThingPulse_XPT2046_Touch
Using library Json_Streaming_Parser at version 1.0.5 in folder: /Users/ebwijkstra/Documents/Arduino/libraries/Json_Streaming_Parser
Using library ESP8266_Weather_Station at version 2.0.1 in folder: /Users/ebwijkstra/Documents/Arduino/libraries/ESP8266_Weather_Station
Using library Mini_Grafx at version 1.2.5 in folder: /Users/ebwijkstra/Documents/Arduino/libraries/Mini_Grafx
Using library ESP8266WiFi at version 1.0 in folder: /Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WiFi

exit status 1
'WiFi' was not declared in this scope

Any idea??

Kind regards,

Eb W.
by (19.9k points)
To me the smoking gun is right here: `/Users/ebwijkstra/Documents/Arduino/Libraries/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino`.

1. It is very unusual for the project to end up in the Arduino/libraries folder (mine - also on Mac - is empty). True, at https://docs.thingpulse.com/guides/wifi-color-display-kit/#weather-station-color-project we only say "...somewhere to your local file system" but I feel something went wrong here. Why this folder?
2. It is doubly nested: /esp8266-weather-station-color/esp8266-weather-station-color/...
by (150 points)
edited by
Hallo Marcel,

Thank you for your patience.
I am sure there is nothing wrong with the program, but somewhere on my PC.

I have removed the esp8266 weather-station-color file and placed this folder on a separate drive under 'ThingpPulse. Accessed this drive, double clicked esp8266....ino and it appears on the screen in the Arduino IDE.

Kind regards,

Eb W.
by (150 points)
Hi Marcel,

Good news. I finally managed to get the weather station going.
First I tried ou the examples in ESP8266 Weather Station, which worked on de serial monitor ok.
Then I deleted all previous files and folders relating to this weather station.
Downloaded the required libraries and weather-station-color again. Unzipped the esp8266-weather-station-color-master and put it in Documents under 'ThingPulse.
Changed the setting.h file to the correct parameters and bingo after calibration I got the weather station on the TFT screen. So I am very pleased with the result.Thank you again for your help.
Next thing is a small enclosure and as we say: "Bob's your uncle".

Please ignore previous email comment. It is now irrelevant.

Good luck and thanks again for your help and patience.

Kind regards,

Eb W.
by (19.9k points)
We're glad it works for you - well done.
by (150 points)
edited by
Good morning Marcel,

Sorry to bother you again, but I cannot compile the ESP8266 Weather Station. Neither the ESP32.
Whatever I try it does not compile.


/Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:135:8: error: 'class WiFiClass' has no member named 'mode'
  135 |   WiFi.mode(WIFI_STA);
      |        ^~~~
/Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:135:13: error: 'WIFI_STA' was not declared in this scope; did you mean 'WIFI_SSID'?
  135 |   WiFi.mode(WIFI_STA);
      |             ^~~~~~~~
      |             WIFI_SSID
/Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:136:8: error: 'class WiFiClass' has no member named 'hostname'; did you mean 'hostByName'?
  136 |   WiFi.hostname(WIFI_HOSTNAME);
      |        ^~~~~~~~
      |        hostByName
/Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:137:29: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
  137 |   WiFi.begin(WIFI_SSID.c_str(), WIFI_PASS.c_str());
      |              ~~~~~~~~~~~~~~~^~
      |                             |
      |                             const char*
In file included from /Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:31:
/Applications/Arduino.app/Contents/Java/libraries/WiFi/src/WiFi.h:79:21: note:   initializing argument 1 of 'int WiFiClass::begin(char*, const char*)'
   79 |     int begin(char* ssid, const char *passphrase);
      |               ~~~~~~^~~~
/Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:149:65: error: no matching function for call to 'WiFiClass::macAddress()'
  149 |   Serial.printf("Connected, MAC address: %s\n", WiFi.macAddress().c_str());  //Get the local mac address
      |                                                                 ^
In file included from /Users/ebwijkstra/Documents/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color.ino:31:
/Applications/Arduino.app/Contents/Java/libraries/WiFi/src/WiFi.h:137:14: note: candidate: 'uint8_t* WiFiClass::macAddress(uint8_t*)'
  137 |     uint8_t* macAddress(uint8_t* mac);
      |              ^~~~~~~~~~
/Applications/Arduino.app/Contents/Java/libraries/WiFi/src/WiFi.h:137:14: note:   candidate expects 1 argument, 0 provided


Please help.

Thank you.

Kind regards,

Eb W.
by (19.9k points)
I don't understand "I cannot compile the ESP8266 Weather Station. Neither the ESP32." How are the two related? Our kit contains an ESP8266, not an ESP32. Besides, you did have a working setup that compiled back in October. Maybe a general Arduino support forum (e.g. at https://forum.arduino.cc/) would be better suited if you're having trouble with the IDE setup.

1 Answer

0 votes
by (19.9k points)
 
Best answer
Resolved through the comments.
by (150 points)
Hallo Marcel,

Neither do I why I cannot compile the ESP8266 Weather Station anymore. I had it going as you said in your answer. It is still going without a hick-up, but I cannot reprogram it again or program another Wemos unit.

What I meant with SP8266 and ESP32 is that I have the same errors with the Zihatec sketch, which is based on the ThingPulse sketch.

It has something to do with the WiFi, but what or how I do not know and I do not have the knowledge either.

Only Arduino v2.0 works on my Mac, but it still is an experimental version. The previous versions v1.8.19 and back to v1.8.15 do not open when clicking on the Arduino icon. It is installed, but only a second or two with the splash window, that is all.

Now I usethe winows 10 version on an other computer. Same results.

I do not know anymore what to do. I know it is very difficult to sort out problems in other computers than your own.

My question is really: Why do I get those compiling errors and all to do with WiFi.

Your advice please.

Please accept my apologies.

Best regards,

Eb W.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...