WThermostatBeca
WThermostatBeca copied to clipboard
Unable to compile
Hi,
I managed to compile a fork from fabcia and upload it to the BAC-002 wifi. However when I put it in Station mode (by holding the Temp down button) I see the wifi network online, but can only connect to it for a few seconds and then it disappears again.. So not able to run the Wifi Setup.
Tried to download your version, but it fails to compile straight away, and seems to miss these library's "WNetwork.h" "WBecaDevice.h"
Did I download something wrong?
Edit: So I found the WAdapter Libraries.. have included them in the ./lib directory but stil lots of error's while compiling. Any help with the platformio.ini setup?
Currently I have this:
[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
board_build.flash_mode = dout
board_build.ldscript = eagle.flash.1m.ld
upload_resetmethod = nodemcu
upload_speed = 921600
build_flags =
-I ./lib/WAdapter
lib_deps =
ESP8266WiFi
https://github.com/me-no-dev/ESPAsyncWebServer
AsyncTCP
ESP8266mDNS
PubSubClient
DNSServer
EEPROM
NTPClient
Time
Hash
And this is the Build Output:
> Executing task: platformio run <
Processing esp01_1m (platform: espressif8266; board: esp01_1m; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp01_1m.html
PLATFORM: Espressif 8266 (3.2.0) > Espressif Generic ESP8266 ESP-01 1M
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES:
- framework-arduinoespressif8266 3.30002.0 (3.0.2)
- tool-esptool 1.413.0 (4.13)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP Async WebServer> 1.2.3+sha.1d46269
| |-- <ESPAsyncTCP> 1.2.2
| |-- <Hash> 1.0
| |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
| |-- <ESP8266WiFi> 1.0
|-- <PubSubClient> 2.8.0
|-- <DNSServer> 1.1.1
| |-- <ESP8266WiFi> 1.0
|-- <EEPROM> 1.0
|-- <NTPClient> 3.1.0
|-- <Time> 1.6.1
|-- <Hash> 1.0
|-- <WAdapter> 1.02
| |-- <ESP Async WebServer> 1.2.3+sha.1d46269
| | |-- <ESPAsyncTCP> 1.2.2
| | |-- <Hash> 1.0
| | |-- <ESP8266WiFi> 1.0
| |-- <EEPROM> 1.0
| |-- <PubSubClient> 2.8.0
| |-- <ESP8266WiFi> 1.0
| |-- <DNSServer> 1.1.1
| | |-- <ESP8266WiFi> 1.0
| |-- <ESP8266mDNS> 1.2
| | |-- <ESP8266WiFi> 1.0
|-- <ESP8266HTTPClient> 1.2
| |-- <ESP8266WiFi> 1.0
Building in release mode
Compiling .pio/build/esp01_1m/src/WThermostat.cpp.o
Generating LD script .pio/build/esp01_1m/ld/local.eagle.app.v6.common.ld
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/BearSSLHelpers.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/CertStoreBearSSL.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFi.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
In file included from lib/WAdapter/WNetwork.h:20,
from src/WThermostat.cpp:2:
lib/WAdapter/WStringStream.h: In member function 'virtual int WStringStream::read()':
lib/WAdapter/WStringStream.h:28:23: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
28 | for (int i = 1; i <= position; i++) {
| ~~^~~~~~~~~~~
lib/WAdapter/WStringStream.h: In member function 'size_t WStringStream::printFormat(char, va_list*)':
lib/WAdapter/WStringStream.h:111:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
111 | register char *wc = (char *)va_arg(*args, int);
| ^~
lib/WAdapter/WStringStream.h:112:25: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
112 | for (int b = 0; b < strlen(wc); b++) {
| ~~^~~~~~~~~~~~
In file included from lib/WAdapter/WProperty.h:5,
from lib/WAdapter/WDevice.h:5,
from lib/WAdapter/WNetwork.h:21,
from src/WThermostat.cpp:2:
lib/WAdapter/WJson.h: In member function 'WJson& WJson::beginObject(const char*)':
lib/WAdapter/WJson.h:29:12: warning: comparison with string literal results in unspecified behavior [-Waddress]
29 | if (name != "") {
| ~~~~~^~~~~
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
In file included from lib/WAdapter/WDevice.h:5,
from lib/WAdapter/WNetwork.h:21,
from src/WThermostat.cpp:2:
lib/WAdapter/WProperty.h: In member function 'virtual void WProperty::toJsonStructure(WJson*, const char*, const char*)':
lib/WAdapter/WProperty.h:547:24: warning: comparison with string literal results in unspecified behavior [-Waddress]
547 | if (this->getTitle() != "") {
| ~~~~~~~~~~~~~~~~~^~~~~
lib/WAdapter/WProperty.h:574:23: warning: comparison with string literal results in unspecified behavior [-Waddress]
574 | if (this->getUnit() != "") {
| ~~~~~~~~~~~~~~~~^~~~~
lib/WAdapter/WProperty.h:586:12: warning: enumeration value 'BYTE_ARRAY' not handled in switch [-Wswitch]
586 | switch (this->getType()) {
| ^
lib/WAdapter/WProperty.h:614:25: warning: comparison with string literal results in unspecified behavior [-Waddress]
614 | if (this->getAtType() != "") {
| ~~~~~~~~~~~~~~~~~~^~~~~
lib/WAdapter/WProperty.h: In member function 'void WProperty::clearEnums()':
lib/WAdapter/WProperty.h:733:4: warning: deleting object of polymorphic class type 'WProperty' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
733 | delete firstEnum;
| ^~~~~~~~~~~~~~~~
lib/WAdapter/WProperty.h:730:14: warning: unused variable 'nextEnum' [-Wunused-variable]
730 | WProperty* nextEnum = nullptr;
| ^~~~~~~~
In file included from lib/WAdapter/WDevice.h:9,
from lib/WAdapter/WNetwork.h:21,
from src/WThermostat.cpp:2:
lib/WAdapter/WLed.h: In member function 'void WLed::setOn(bool, int)':
lib/WAdapter/WLed.h:41:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'int' [-Wsign-compare]
41 | if ((this->isOn()) && (this->blinkMillis != blinkMillis)) {
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
In file included from lib/WAdapter/WSettings.h:5,
from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WLog.h: In member function 'void WLog::printFormat(char, va_list*)':
lib/WAdapter/WLog.h:134:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
134 | register char *s = (char *)va_arg(*args, int);
| ^
lib/WAdapter/WLog.h:137:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
137 | register __FlashStringHelper *s = (__FlashStringHelper *)va_arg(*args, int);
| ^
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/ESP8266WiFiScan.cpp.o
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h: In static member function 'static void WSettings::getLongBytes(long int, byte*)':
lib/WAdapter/WSettings.h:349:8: warning: unused variable 'l1' [-Wunused-variable]
349 | byte l1, l2, l3, l4;
| ^~
lib/WAdapter/WSettings.h:349:12: warning: unused variable 'l2' [-Wunused-variable]
349 | byte l1, l2, l3, l4;
| ^~
lib/WAdapter/WSettings.h:349:16: warning: unused variable 'l3' [-Wunused-variable]
349 | byte l1, l2, l3, l4;
| ^~
lib/WAdapter/WSettings.h:349:20: warning: unused variable 'l4' [-Wunused-variable]
349 | byte l1, l2, l3, l4;
| ^~
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h: In member function 'byte WSettings::getLengthInEEPROM(WProperty*)':
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'BOOLEAN' not handled in switch [-Wswitch]
440 | switch (setting->getType()){
| ^
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'DOUBLE' not handled in switch [-Wswitch]
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'SHORT' not handled in switch [-Wswitch]
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'INTEGER' not handled in switch [-Wswitch]
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'UNSIGNED_LONG' not handled in switch [-Wswitch]
lib/WAdapter/WSettings.h:440:10: warning: enumeration value 'BYTE' not handled in switch [-Wswitch]
In file included from lib/WAdapter/WNetwork.h:24,
from src/WThermostat.cpp:2:
lib/WAdapter/WJsonParser.h: In member function 'void WJsonParser::parse(const char*, WJsonParser::TProcessKeyValueFunction)':
lib/WAdapter/WJsonParser.h:56:21: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
56 | for (int i = 0; i < strlen(payload); i++) {
| ~~^~~~~~~~~~~~~~~~~
lib/WAdapter/WJsonParser.h: In member function 'WProperty* WJsonParser::parse(const char*, WDevice*)':
lib/WAdapter/WJsonParser.h:64:21: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
64 | for (int i = 0; i < strlen(payload); i++) {
| ~~^~~~~~~~~~~~~~~~~
In file included from src/WThermostat.cpp:2:
lib/WAdapter/WNetwork.h: In member function 'void WNetwork::setStatusLed(WLed*, bool)':
lib/WAdapter/WNetwork.h:110:4: warning: deleting object of polymorphic class type 'WLed' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
110 | delete this->statusLed;
| ^~~~~~~~~~~~~~~~~~~~~~
lib/WAdapter/WNetwork.h: In member function 'bool WNetwork::loop(long unsigned int)':
lib/WAdapter/WNetwork.h:156:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
156 | (getSsid() == "") ||
| ~~~~~~~~~~^~~~~
lib/WAdapter/WNetwork.h:217:8: warning: unused variable 'allStatesComplete' [-Wunused-variable]
217 | bool allStatesComplete = true;
| ^~~~~~~~~~~~~~~~~
lib/WAdapter/WNetwork.h:218:8: warning: unused variable 'stateUpd' [-Wunused-variable]
218 | bool stateUpd = false;
| ^~~~~~~~
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/WiFiClient.cpp.o
lib/WAdapter/WNetwork.h: In member function 'void WNetwork::handleHttpSubmittedCustomPage(AsyncWebServerRequest*, WPage*)':
lib/WAdapter/WNetwork.h:1003:4: warning: deleting object of polymorphic class type 'WStringStream' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
1003 | delete page;
| ^~~~~~~~~~~
lib/WAdapter/WNetwork.h: In member function 'void WNetwork::loadSettings()':
lib/WAdapter/WNetwork.h:1271:21: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Wsign-compare]
1271 | for (int i = 0; i < strlen(this->hostname); i++) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~~
lib/WAdapter/WNetwork.h:1288:27: warning: comparison with string literal results in unspecified behavior [-Waddress]
1288 | if (getMqttBaseTopic() == "") {
| ~~~~~~~~~~~~~~~~~~~^~~~~
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h: In constructor 'WClock::WClock(WNetwork*, bool)':
src/WClock.h:41:90: error: no matching function for call to 'WSettings::setString(const char [10], int, const char*&)'
41 | this->ntpServer = network->getSettings()->setString("ntpServer", 32, DEFAULT_NTP_SERVER);
| ^
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h:306:13: note: candidate: 'WProperty* WSettings::setString(const char*, const char*)'
306 | WProperty* setString(const char* id, const char* value) {
| ^~~~~~~~~
lib/WAdapter/WSettings.h:306:13: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h:49:106: error: no matching function for call to 'WSettings::setString(const char [15], int, const char*&)'
49 | this->timeZoneServer = network->getSettings()->setString("timeZoneServer", 45, DEFAULT_TIME_ZONE_SERVER);
| ^
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h:306:13: note: candidate: 'WProperty* WSettings::setString(const char*, const char*)'
306 | WProperty* setString(const char* id, const char* value) {
| ^~~~~~~~~
lib/WAdapter/WSettings.h:306:13: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h:60:108: error: no matching function for call to 'WProperty::createStringProperty(const char [19], const char [19], int)'
60 | this->epochTimeFormatted = WProperty::createStringProperty("epochTimeFormatted", "epochTimeFormatted", 19);
| ^
In file included from lib/WAdapter/WDevice.h:5,
from lib/WAdapter/WNetwork.h:21,
from src/WThermostat.cpp:2:
lib/WAdapter/WProperty.h:46:20: note: candidate: 'static WProperty* WProperty::createStringProperty(const char*, const char*)'
46 | static WProperty* createStringProperty(const char* id, const char* title) {
| ^~~~~~~~~~~~~~~~~~~~
lib/WAdapter/WProperty.h:46:20: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h:69:79: error: no matching function for call to 'WProperty::createStringProperty(const char [9], const char [9], int)'
69 | this->timeZone = WProperty::createStringProperty("timezone", "timeZone", 32);
| ^
In file included from lib/WAdapter/WDevice.h:5,
from lib/WAdapter/WNetwork.h:21,
from src/WThermostat.cpp:2:
lib/WAdapter/WProperty.h:46:20: note: candidate: 'static WProperty* WProperty::createStringProperty(const char*, const char*)'
46 | static WProperty* createStringProperty(const char* id, const char* title) {
| ^~~~~~~~~~~~~~~~~~~~
lib/WAdapter/WProperty.h:46:20: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h:89:86: error: no matching function for call to 'WSettings::setByteArray(const char [8], int, const byte*&)'
89 | this->dstRule = network->getSettings()->setByteArray("dstRule", 8, DEFAULT_DST_RULE);
| ^
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h:318:13: note: candidate: 'WProperty* WSettings::setByteArray(const char*, const byte*)'
318 | WProperty* setByteArray(const char* id, const byte* value) {
| ^~~~~~~~~~~~
lib/WAdapter/WSettings.h:318:13: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h:106:105: error: no matching function for call to 'WSettings::setByteArray(const char [14], int, const byte*&)'
106 | this->nightSwitches = network->getSettings()->setByteArray("nightSwitches", 4, DEFAULT_NIGHT_SWITCHES);
| ^
In file included from lib/WAdapter/WNetwork.h:23,
from src/WThermostat.cpp:2:
lib/WAdapter/WSettings.h:318:13: note: candidate: 'WProperty* WSettings::setByteArray(const char*, const byte*)'
318 | WProperty* setByteArray(const char* id, const byte* value) {
| ^~~~~~~~~~~~
lib/WAdapter/WSettings.h:318:13: note: candidate expects 2 arguments, 3 provided
In file included from src/WBecaDevice.h:8,
from src/WThermostat.cpp:3:
src/WClock.h: In member function 'void WClock::updateFormattedTime()':
src/WClock.h:277:3: warning: deleting object of polymorphic class type 'WStringStream' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
277 | delete stream;
| ^~~~~~~~~~~~~
src/WClock.h: In member function 'void WClock::calculateDstStartAndEnd()':
src/WClock.h:524:4: warning: deleting object of polymorphic class type 'WStringStream' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
524 | delete stream;
| ^~~~~~~~~~~~~
src/WClock.h:528:4: warning: deleting object of polymorphic class type 'WStringStream' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
528 | delete stream;
| ^~~~~~~~~~~~~
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
In file included from src/WThermostat.cpp:3:
src/WBecaDevice.h: In member function 'void WBecaDevice::commandHexStrToSerial(String)':
src/WBecaDevice.h:342:25: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
342 | for (int i = 0; i < (command.length() / 2); i++) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~~
src/WBecaDevice.h: In member function 'void WBecaDevice::commandCharsToSerial(unsigned int, unsigned char*)':
src/WBecaDevice.h:356:25: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
356 | for (int i = 0; i < length; i++) {
| ~~^~~~~~~~
src/WBecaDevice.h: In member function 'void WBecaDevice::processSerialCommand()':
src/WBecaDevice.h:880:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
880 | if (i > 2)
| ^~
src/WBecaDevice.h:882:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
882 | if (res != 0) {
| ^~
src/WThermostat.cpp: In function 'void setup()':
src/WThermostat.cpp:8:23: error: invalid conversion from 'int' to 'Print*' [-fpermissive]
8 | #define FLAG_SETTINGS 0x18
| ^~~~
| |
| int
src/WThermostat.cpp:18:68: note: in expansion of macro 'FLAG_SETTINGS'
18 | network = new WNetwork(DEBUG, APPLICATION, VERSION, true, NO_LED, FLAG_SETTINGS);
| ^~~~~~~~~~~~~
In file included from src/WThermostat.cpp:2:
lib/WAdapter/WNetwork.h:50:122: note: initializing argument 6 of 'WNetwork::WNetwork(bool, String, String, int, byte, Print*)'
50 | WNetwork(bool debugging, String applicationName, String firmwareVersion, int statusLedPin, byte appSettingsFlag, Print* debuggingOutput = &Serial) {
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/WiFiServer.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling .pio/build/esp01_1m/lib37d/ESP8266WiFi/WiFiUdp.cpp.o
*** [.pio/build/esp01_1m/src/WThermostat.cpp.o] Error 1
=================================================== [FAILED] Took 4.60 seconds ===================================================
The terminal process "platformio 'run'" terminated with exit code: 1.
Same problem for me
Please try latest version of WThermostatBeca (v1.35) and WAdapter (v1.35). Reopen, if issues still exist.