Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWHomie error when building #4

Open
larsenglund opened this issue Oct 7, 2019 · 19 comments
Open

GWHomie error when building #4

larsenglund opened this issue Oct 7, 2019 · 19 comments

Comments

@larsenglund
Copy link

larsenglund commented Oct 7, 2019

Hi, I get this error:

In file included from src\main.cpp:4:0: lib\com/com.hpp: At global scope: lib\com/com.hpp:31:5: error: 'GWHomie' does not name a type GWHomie * homie; ^

when I run:

platformio run -e web -t upload --upload-port COM6

What am I doing wrong?
The other build command works just fine:

platformio run -e now -t upload --upload-port COM6

@petslane
Copy link
Owner

petslane commented Oct 8, 2019

What pio version are you using? pio --version?

@larsenglund
Copy link
Author

I'm using version 4.0.3. I "solved" the problem by changing #include <homie.hpp> in com.hpp to #include "../homie/homie.hpp"

@petslane
Copy link
Owner

petslane commented Oct 8, 2019

I still using version 3.6.7, had some problems with version 4, will have to make sure that it would work on latest PIO.

@petslane
Copy link
Owner

petslane commented Oct 9, 2019

I had this problem: platformio/platformio-core#2824 Looks like it's fixed but not released.

Updated to beta version 4.1.0b3, but building web env fails because of Homie lobrary uses ArduinoJSON version 6, but my code uses version 5, so have to do ArduinoJSON migration.

@larsenglund you didn't have ArduinoJSON versions conflict?

@larsenglund
Copy link
Author

@petslane Nope, no ArduinoJSON versions conflict.

@petslane
Copy link
Owner

@larsenglund can you please test #6 ? (branch pio-upgrade)

does it resolve your "homie" error? you don't have to upload, just build with pio run

@larsenglund
Copy link
Author

@petslane Nope, I get the same errors, plus some new json-errors for now.

In file included from src\main.cpp:4:0:
lib\com/com.hpp:30:5: error: 'GWHomie' does not name a type
     GWHomie * homie;
     ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp:108:24: error: 'GWHomie' has not been declared
     Com(Stats * stats, GWHomie * h, WebSocket * ws) {
                        ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::receivedSerialData(const char*, uint8)':
lib\com/com.hpp:63:23: error: 'class Com' has no member named 'homie'
                 this->homie->send(mac, msg.c_str(), msg.length());
                       ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In constructor 'Com::Com(Stats*, int*, WebSocket*)':
lib\com/com.hpp:110:15: error: 'class Com' has no member named 'homie'
         this->homie = h;
               ^
src\main.cpp: At global scope:
src\main.cpp:19:1: error: 'GWHomie' does not name a type
 GWHomie * homie = new GWHomie();
 ^
src\main.cpp:20:29: error: 'homie' was not declared in this scope
 Com * comm = new Com(stats, homie, ws);
                             ^
src\main.cpp: In function 'void setup()':
src\main.cpp:37:5: error: 'homie' was not declared in this scope
     homie->setup();
     ^
src\main.cpp: In function 'void loop()':
src\main.cpp:54:5: error: 'homie' was not declared in this scope
     homie->loop();
     ^

New json errors:

Compiling .pio\build\now\libae4\ESP8266mDNS\ESP8266mDNS_Legacy.cpp.o
In file included from lib\buffer/buffer.hpp:4:0,
                 from src\main.cpp:3:
lib\utils/utils.hpp: In function 'void utils::mergeJson(ArduinoJson::JsonObject, ArduinoJson::JsonObject)':
lib\utils/utils.hpp:38:26: error: expression cannot be used as a function
             dest[kvp.key()].set(kvp.value());
                          ^
lib\utils/utils.hpp:38:43: error: no match for call to '(ArduinoJson::JsonVariant) ()'
             dest[kvp.key()].set(kvp.value());
                                           ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: At global scope:
lib\com/com.hpp:94:19: error: 'JsonDocument' has not been declared
     void sendJson(JsonDocument& doc) {
                   ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::receivedSerialData(const char*, uint8)':
lib\com/com.hpp:40:9: error: 'StaticJsonDocument' was not declared in this scope
         StaticJsonDocument<200> doc;
         ^
lib\com/com.hpp:40:33: error: 'doc' was not declared in this scope
         StaticJsonDocument<200> doc;
                                 ^
lib\com/com.hpp:41:9: error: 'DeserializationError' was not declared in this scope
         DeserializationError err = deserializeJson(doc, data, len);
         ^
lib\com/com.hpp:41:30: error: expected ';' before 'err'
         DeserializationError err = deserializeJson(doc, data, len);
                              ^
lib\com/com.hpp:43:13: error: 'err' was not declared in this scope
         if (err != DeserializationError::Ok) {
             ^
lib\com/com.hpp:43:20: error: 'DeserializationError' is not a class, namespace, or enumeration
         if (err != DeserializationError::Ok) {
                    ^
lib\com/com.hpp:48:46: error: expected primary-expression before '>' token
         JsonObject object = doc.as<JsonObject>();
                                              ^
lib\com/com.hpp:48:48: error: expected primary-expression before ')' token
         JsonObject object = doc.as<JsonObject>();
                                                ^
lib\com/com.hpp:55:42: error: expected primary-expression before '>' token
         uint8 type = doc["type"].as<uint8>();
                                          ^
lib\com/com.hpp:55:44: error: expected primary-expression before ')' token
         uint8 type = doc["type"].as<uint8>();
                                            ^
lib\com/com.hpp:83:46: error: expected primary-expression before '>' token
             String msg = doc["msg"].as<String>();
                                              ^
lib\com/com.hpp:83:48: error: expected primary-expression before ')' token
             String msg = doc["msg"].as<String>();
                                                ^
lib\com/com.hpp:84:44: error: expected primary-expression before '>' token
             String to = doc["to"].as<String>();
                                            ^
lib\com/com.hpp:84:46: error: expected primary-expression before ')' token
             String to = doc["to"].as<String>();
                                              ^
lib\com/com.hpp:85:45: error: expected primary-expression before 'unsigned'
             unsigned long id = doc["id"].as<unsigned long>();
                                             ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::sendJson(int&)':
lib\com/com.hpp:97:31: error: 'serializeJson' was not declared in this scope
         serializeJson(doc, buf);
                               ^
lib\com/com.hpp: In member function 'void Com::send(utils::msgType, long unsigned int, String, T1, String, T2, String, T3)':
lib\com/com.hpp:151:9: error: 'StaticJsonDocument' was not declared in this scope
         StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
         ^
lib\com/com.hpp:151:49: error: 'doc' was not declared in this scope
         StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
Archiving .pio\build\now\lib1d5\libBase64_ID582.a
                                                 ^
lib\com/com.hpp:152:44: error: expected primary-expression before '>' token
         JsonObject json = doc.to<JsonObject>();
                                            ^
lib\com/com.hpp:152:46: error: expected primary-expression before ')' token
         JsonObject json = doc.to<JsonObject>();
                                              ^
lib\com/com.hpp: In member function 'void Com::loop()':
lib\com/com.hpp:198:17: error: 'StaticJsonDocument' was not declared in this scope
                 StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
                 ^
lib\com/com.hpp:198:57: error: 'doc' was not declared in this scope
                 StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
                                                         ^
lib\com/com.hpp:199:52: error: expected primary-expression before '>' token
                 JsonObject root = doc.to<JsonObject>();
                                                    ^
lib\com/com.hpp:199:54: error: expected primary-expression before ')' token
                 JsonObject root = doc.to<JsonObject>();
                                                      ^```

@petslane
Copy link
Owner

Can you provide Dependency Graph of failing build?

@petslane
Copy link
Owner

for web build, in file com.hpp line 11, if you change #include <homie.hpp> to #include "homie.hpp", doe this fix "error: 'GWHomie' has not been declared" error in con.hpp?

@petslane
Copy link
Owner

strange, I did fresh git clone, checkout branch pio-upgrade, started python:2.7 docker image with code mounted, installer PIO 4.0.3, did pio run and everything build correctly without any errors.

Is it possible you have some custom PIO settings or something? I have no idea why it doesn't work for you. I have tested it only on Linux, so maybe it doesn't build on Windows?

@larsenglund
Copy link
Author

larsenglund commented Oct 10, 2019

I tried building it on linux now but got an error saying that it can't find Base64.h

@larsenglund
Copy link
Author

larsenglund commented Oct 10, 2019

Here is the complete output from windows

> Executing task: C:\Users\englund\AppData\Roaming\SPB_Data\.platformio\penv\Scripts\platformio.exe run <

Processing web (platform: espressif8266; board: d1_mini; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 2.2.3 > WeMos D1 R2 and mini
HARDWARE: ESP8266 160MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 51 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 6.12.0
|-- <Base64> 0.0.1
|-- <Homie> 3.0.0 #3a52ecc
|   |-- <ArduinoJson> 6.12.0
|   |-- <AsyncMqttClient> 0.8.2
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |-- <Bounce2> 2.52
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Hash> 1.0
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Ticker> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <DNSServer> 1.1.1
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266HTTPClient> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Base64> 0.0.1
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <Adafruit GFX Library> 1.5.7
|   |-- <SPI> 1.0
|-- <Adafruit SSD1306> 1.1.0 #7a748d2
|   |-- <Adafruit GFX Library> 1.5.7
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0
|-- <buffer>
|   |-- <utils>
|   |   |-- <ArduinoJson> 6.12.0
|-- <com>
|   |-- <buffer>
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|   |-- <utils>
|   |   |-- <ArduinoJson> 6.12.0
|   |-- <websocket>
|   |   |-- <buffer>
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <webserver>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |-- <Hash> 1.0
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Hash> 1.0
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson> 6.12.0
|   |-- <Homie> 3.0.0 #3a52ecc
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <AsyncMqttClient> 0.8.2
|   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Bounce2> 2.52
|   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Hash> 1.0
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Ticker> 1.0
|   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <DNSServer> 1.1.1
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <ESP8266HTTPClient> 1.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Base64> 0.0.1
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <ESP8266mDNS> 1.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |-- <EspSoftwareSerial> 5.0.4
|-- <now>
|   |-- <com>
|   |   |-- <buffer>
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <stats>
|   |   |   |-- <Base64> 0.0.1
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <websocket>
|   |   |   |-- <buffer>
|   |   |   |   |-- <utils>
|   |   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <webserver>
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |   |-- <Hash> 1.0
|   |   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |-- <utils>
|   |   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |-- <Hash> 1.0
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <Homie> 3.0.0 #3a52ecc
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <AsyncMqttClient> 0.8.2
|   |   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Bounce2> 2.52
|   |   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |-- <Hash> 1.0
|   |   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Ticker> 1.0
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <DNSServer> 1.1.1
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <ESP8266HTTPClient> 1.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |   |-- <Base64> 0.0.1
|   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <ESP8266mDNS> 1.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <EspSoftwareSerial> 5.0.4
|   |-- <now_message>
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|   |-- <utils>
|   |   |-- <ArduinoJson> 6.12.0
|   |-- <ESP8266WiFi> 1.0
|-- <screen>
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|   |-- <Adafruit GFX Library> 1.5.7
|   |   |-- <SPI> 1.0
|   |-- <Adafruit SSD1306> 1.1.0 #7a748d2
|   |   |-- <Adafruit GFX Library> 1.5.7
|   |   |   |-- <SPI> 1.0
|   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0
|-- <stats>
|   |-- <Base64> 0.0.1
|-- <webserver>
|   |-- <ArduinoJson> 6.12.0
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Hash> 1.0
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <utils>
|   |   |-- <ArduinoJson> 6.12.0
|-- <websocket>
|   |-- <buffer>
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |-- <utils>
|   |   |-- <ArduinoJson> 6.12.0
|   |-- <webserver>
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <ESP Async WebServer> 1.2.3
|   |   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |   |-- <Hash> 1.0
|   |   |   |-- <ArduinoJson> 6.12.0
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 6.12.0
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Hash> 1.0
|   |   |-- <ArduinoJson> 6.12.0
|   |   |-- <ESP8266WiFi> 1.0
Compiling .pio\build\web\src\main.cpp.o
Compiling .pio\build\web\lib403\ESP Async WebServer_ID306\WebServer.cpp.o
Compiling .pio\build\web\libd9b\Ticker\Ticker.cpp.o
Compiling .pio\build\web\libfa6\DNSServer\DNSServer.cpp.o
Compiling .pio\build\web\libed4\ESP8266HTTPClient\ESP8266HTTPClient.cpp.o
Compiling .pio\build\web\libae4\ESP8266mDNS\ESP8266mDNS.cpp.o
Compiling .pio\build\web\libae4\ESP8266mDNS\ESP8266mDNS_Legacy.cpp.o
Compiling .pio\build\web\libae4\ESP8266mDNS\LEAmDNS.cpp.o
Archiving .pio\build\web\libd9b\libTicker.a
Compiling .pio\build\web\libae4\ESP8266mDNS\LEAmDNS_Control.cpp.o
Archiving .pio\build\web\libfa6\libDNSServer.a
C:\Users\englund\AppData\Roaming\SPB_Data\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp: In member function 'bool HTTPClient::beginInternal(String, const char*)':
C:\Users\englund\AppData\Roaming\SPB_Data\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp:310:32: error: 'base64' has not been declared
         _base64Authorization = base64::encode(auth);
                                ^
C:\Users\englund\AppData\Roaming\SPB_Data\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp: In member function 'void HTTPClient::setAuthorization(const char*, const char*)':
C:\Users\englund\AppData\Roaming\SPB_Data\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp:495:32: error: 'base64' has not been declared
         _base64Authorization = base64::encode(auth);
                                ^
Compiling .pio\build\web\libae4\ESP8266mDNS\LEAmDNS_Helpers.cpp.o
*** [.pio\build\web\libed4\ESP8266HTTPClient\ESP8266HTTPClient.cpp.o] Error 1
In file included from src\main.cpp:4:0:
lib\com/com.hpp:30:5: error: 'GWHomie' does not name a type
     GWHomie * homie;
     ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp:108:24: error: 'GWHomie' has not been declared
     Com(Stats * stats, GWHomie * h, WebSocket * ws) {
                        ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::receivedSerialData(const char*, uint8)':
lib\com/com.hpp:63:23: error: 'class Com' has no member named 'homie'
                 this->homie->send(mac, msg.c_str(), msg.length());
                       ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In constructor 'Com::Com(Stats*, int*, WebSocket*)':
lib\com/com.hpp:110:15: error: 'class Com' has no member named 'homie'
         this->homie = h;
               ^
src\main.cpp: At global scope:
src\main.cpp:19:1: error: 'GWHomie' does not name a type
 GWHomie * homie = new GWHomie();
 ^
src\main.cpp:20:29: error: 'homie' was not declared in this scope
 Com * comm = new Com(stats, homie, ws);
                             ^
src\main.cpp: In function 'void setup()':
src\main.cpp:37:5: error: 'homie' was not declared in this scope
     homie->setup();
     ^
src\main.cpp: In function 'void loop()':
src\main.cpp:54:5: error: 'homie' was not declared in this scope
     homie->loop();
     ^
*** [.pio\build\web\src\main.cpp.o] Error 1
================================================================================================================================================ [FAILED] Took 7.88 seconds ================================================================================================================================================

Processing now (platform: espressif8266; board: d1_mini; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 2.2.3 > WeMos D1 R2 and mini
HARDWARE: ESP8266 160MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 43 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 5.13.4
|-- <Base64> 0.0.1
|-- <buffer>
|   |-- <utils>
|   |   |-- <ArduinoJson> 5.13.4
|-- <com>
|   |-- <buffer>
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 5.13.4
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|   |-- <utils>
|   |   |-- <ArduinoJson> 5.13.4
|   |-- <websocket>
|   |   |-- <buffer>
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <webserver>
|   |   |   |-- <ArduinoJson> 5.13.4
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 5.13.4
|   |-- <ArduinoJson> 5.13.4
|   |-- <homie>
|   |   |-- <ESP8266mDNS> 1.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |-- <EspSoftwareSerial> 5.0.4
|-- <homie>
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <now>
|   |-- <com>
|   |   |-- <buffer>
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <stats>
|   |   |   |-- <Base64> 0.0.1
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <websocket>
|   |   |   |-- <buffer>
|   |   |   |   |-- <utils>
|   |   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |   |-- <utils>
|   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |   |-- <webserver>
|   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |   |   |-- <utils>
|   |   |   |   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <homie>
|   |   |   |-- <ESP8266mDNS> 1.2
|   |   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <EspSoftwareSerial> 5.0.4
|   |-- <now_message>
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|   |-- <utils>
|   |   |-- <ArduinoJson> 5.13.4
|   |-- <ESP8266WiFi> 1.0
|-- <screen>
|   |-- <stats>
|   |   |-- <Base64> 0.0.1
|-- <stats>
|   |-- <Base64> 0.0.1
|-- <webserver>
|   |-- <ArduinoJson> 5.13.4
|   |-- <utils>
|   |   |-- <ArduinoJson> 5.13.4
|-- <websocket>
|   |-- <buffer>
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 5.13.4
|   |-- <utils>
|   |   |-- <ArduinoJson> 5.13.4
|   |-- <webserver>
|   |   |-- <ArduinoJson> 5.13.4
|   |   |-- <utils>
|   |   |   |-- <ArduinoJson> 5.13.4
Compiling .pio\build\now\src\main.cpp.o
Archiving .pio\build\now\libae4\libESP8266mDNS.a
Archiving .pio\build\now\lib383\libSoftwareSerial.a
Compiling .pio\build\now\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\now\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\now\FrameworkArduino\Print.cpp.o
Compiling .pio\build\now\FrameworkArduino\Schedule.cpp.o
Compiling .pio\build\now\FrameworkArduino\ScheduledFunctions.cpp.o
Compiling .pio\build\now\FrameworkArduino\StackThunk.cpp.o
Compiling .pio\build\now\FrameworkArduino\Stream.cpp.o
In file included from lib\buffer/buffer.hpp:4:0,
                 from src\main.cpp:3:
lib\utils/utils.hpp: In function 'void utils::mergeJson(ArduinoJson::JsonObject, ArduinoJson::JsonObject)':
lib\utils/utils.hpp:38:26: error: expression cannot be used as a function
             dest[kvp.key()].set(kvp.value());
                          ^
lib\utils/utils.hpp:38:43: error: no match for call to '(ArduinoJson::JsonVariant) ()'
             dest[kvp.key()].set(kvp.value());
                                           ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: At global scope:
lib\com/com.hpp:94:19: error: 'JsonDocument' has not been declared
     void sendJson(JsonDocument& doc) {
                   ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::receivedSerialData(const char*, uint8)':
lib\com/com.hpp:40:9: error: 'StaticJsonDocument' was not declared in this scope
         StaticJsonDocument<200> doc;
         ^
lib\com/com.hpp:40:33: error: 'doc' was not declared in this scope
         StaticJsonDocument<200> doc;
                                 ^
lib\com/com.hpp:41:9: error: 'DeserializationError' was not declared in this scope
         DeserializationError err = deserializeJson(doc, data, len);
         ^
lib\com/com.hpp:41:30: error: expected ';' before 'err'
         DeserializationError err = deserializeJson(doc, data, len);
                              ^
lib\com/com.hpp:43:13: error: 'err' was not declared in this scope
         if (err != DeserializationError::Ok) {
             ^
lib\com/com.hpp:43:20: error: 'DeserializationError' is not a class, namespace, or enumeration
         if (err != DeserializationError::Ok) {
                    ^
lib\com/com.hpp:48:46: error: expected primary-expression before '>' token
         JsonObject object = doc.as<JsonObject>();
                                              ^
lib\com/com.hpp:48:48: error: expected primary-expression before ')' token
         JsonObject object = doc.as<JsonObject>();
                                                ^
lib\com/com.hpp:55:42: error: expected primary-expression before '>' token
         uint8 type = doc["type"].as<uint8>();
                                          ^
lib\com/com.hpp:55:44: error: expected primary-expression before ')' token
         uint8 type = doc["type"].as<uint8>();
                                            ^
lib\com/com.hpp:83:46: error: expected primary-expression before '>' token
             String msg = doc["msg"].as<String>();
                                              ^
lib\com/com.hpp:83:48: error: expected primary-expression before ')' token
             String msg = doc["msg"].as<String>();
                                                ^
lib\com/com.hpp:84:44: error: expected primary-expression before '>' token
             String to = doc["to"].as<String>();
                                            ^
lib\com/com.hpp:84:46: error: expected primary-expression before ')' token
             String to = doc["to"].as<String>();
                                              ^
lib\com/com.hpp:85:45: error: expected primary-expression before 'unsigned'
             unsigned long id = doc["id"].as<unsigned long>();
                                             ^
In file included from src\main.cpp:4:0:
lib\com/com.hpp: In member function 'void Com::sendJson(int&)':
lib\com/com.hpp:97:31: error: 'serializeJson' was not declared in this scope
         serializeJson(doc, buf);
                               ^
lib\com/com.hpp: In member function 'void Com::send(utils::msgType, long unsigned int, String, T1, String, T2, String, T3)':
lib\com/com.hpp:151:9: error: 'StaticJsonDocument' was not declared in this scope
         StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
         ^
lib\com/com.hpp:151:49: error: 'doc' was not declared in this scope
         StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
                                                 ^
lib\com/com.hpp:152:44: error: expected primary-expression before '>' token
         JsonObject json = doc.to<JsonObject>();
                                            ^
lib\com/com.hpp:152:46: error: expected primary-expression before ')' token
         JsonObject json = doc.to<JsonObject>();
                                              ^
lib\com/com.hpp: In member function 'void Com::loop()':
lib\com/com.hpp:198:17: error: 'StaticJsonDocument' was not declared in this scope
                 StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
                 ^
lib\com/com.hpp:198:57: error: 'doc' was not declared in this scope
                 StaticJsonDocument<JSON_OBJECT_SIZE(6)> doc;
                                                         ^
lib\com/com.hpp:199:52: error: expected primary-expression before '>' token
                 JsonObject root = doc.to<JsonObject>();
                                                    ^
lib\com/com.hpp:199:54: error: expected primary-expression before ')' token
                 JsonObject root = doc.to<JsonObject>();
                                                      ^
Compiling .pio\build\now\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\now\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\now\FrameworkArduino\Updater.cpp.o
Compiling .pio\build\now\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\now\FrameworkArduino\WString.cpp.o
*** [.pio\build\now\src\main.cpp.o] Error 1
================================================================================================================================================ [FAILED] Took 5.54 seconds ================================================================================================================================================

Environment    Status    Duration
-------------  --------  ------------
web            FAILED    00:00:07.883
now            FAILED    00:00:05.545
========================================================================================================================================== 2 failed, 0 succeeded in 00:00:13.427 ==========================================================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

@larsenglund
Copy link
Author

Changing to #include "homie.hpp" does not fix the error

@petslane
Copy link
Owner

ok, I was reading about PIO LDF and lib_ldf_mode property definitely has to be something +, default options should not work, not sure why it has worked for me. Set lib_ldf_mode to deep+ in #6. For me it still builds successfully, please test if it's works for you too.

@larsenglund
Copy link
Author

Adding lib_ldf_mode = deep+ to [env] did not fix the errors.

@petslane
Copy link
Owner

I don't know why build fails for you, I am unable to reproduce you errors. Some things to test:

  • delete CMakeLists.txt or any CMakeLists* files <- I think these files should not be commited
  • try to use older pio - pip uninstall platformio && pip install "platformio<4.0.3"
  • try to use beta pio - pip uninstall platformio && pip install https://github.com/platformio/platformio/archive/develop.zip"

Also, because PIO LDF uses python to resolve dependencies, then what python version you have?

@petslane
Copy link
Owner

Found this: https://community.platformio.org/t/arduinojson-library-errors-on-compile/9128/9

Something to do with too long file paths in windows (???). Please test if moving project folder to somewhere else help.

@petslane
Copy link
Owner

@larsenglund have you tested something?

@larsenglund
Copy link
Author

@petslane Sorry, busy with other stuff atm.. I'll revisit this soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants