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 (16.7k 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 (16.7k 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)
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.
Now I am even further away. The error report stops at line 27

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:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/ebwijkstra/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/ebwijkstra/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/ebwijkstra/Documents/Arduino/libraries -fqbn=esp8266:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -ide-version=10816 -build-path /var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_build_927949 -warnings=none -build-cache /var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_cache_992250 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mkspiffs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mkspiffs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mklittlefs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mklittlefs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.python3.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -verbose /Volumes/Internal HD/Projects/NZ-Weatherstation/Thingsplus/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/ebwijkstra/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/ebwijkstra/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/ebwijkstra/Documents/Arduino/libraries -fqbn=esp8266:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600 -ide-version=10816 -build-path /var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_build_927949 -warnings=none -build-cache /var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_cache_992250 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mkspiffs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mkspiffs-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mkspiffs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mklittlefs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.mklittlefs-3.0.4-gcc10.3-1757bed.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/mklittlefs/3.0.4-gcc10.3-1757bed -prefs=runtime.tools.python3.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -verbose /Volumes/Internal HD/Projects/NZ-Weatherstation/Thingsplus/ThingPulse/esp8266-weather-station-color/esp8266-weather-station-color/esp8266-weather-station-color.ino
Using board 'd1_mini' from platform in folder: /Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2
Using core 'esp8266' from platform in folder: /Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2
Detecting libraries used...
/Users/ebwijkstra/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_SOURCE -I/Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/include -I/Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/lwip2/include -I/Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_build_927949/core -c -w -Werror=return-type -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10816 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\"" -DFLASHMODE_DIO -DESP8266 -I/Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266 -I/Users/ebwijkstra/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/variants/d1_mini /var/folders/5y/r4sggwnj00qfn93ly5t2q6580000gn/T/arduino_build_927949/sketch/esp8266-weather-station-color.ino.cpp -o /dev/null
Alternatives for settings.h: []
ResolveLibrary(settings.h)
  -> candidates: []
esp8266-weather-station-color:27:10: fatal error: settings.h: No such file or directory
   27 | #include "settings.h"
      |          ^~~~~~~~~~~~
compilation terminated.
exit status 1
settings.h: No such file or directory

Because I received this message before, I placed the whole sep8266 file as taken of your web site manually in the Arduino/Library/ folder.

I, most likely do something wrong, but what, I do not know.
I appreciate your help.

Kind regards,

Eb W.
When compiling
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 (16.7k points)
We're glad it works for you - well done.

1 Answer

0 votes
by (16.7k points)
 
Best answer
Resolved through the comments.

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

https://thingpulse.com

...