Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

cannot build firmware, please help #16

Closed
prankousky opened this issue Sep 2, 2019 · 3 comments
Closed

cannot build firmware, please help #16

prankousky opened this issue Sep 2, 2019 · 3 comments

Comments

@prankousky
Copy link

Description

Firmware will not compile. I moved src/setup_template.h to src/setup.h and ran platformio run. This produces the error below. Then I installed atom with platformio plugin, opened the root folder of the project, and pressed ctrl+alt+B to build. Will produce the error below as well.

I don't know that much about compiling these things, so I am not sure how to manually install the libraries, as the documents state. However, it seems like platformio will (try??) install the libraries for me, anyway.

When I go to .pio/libdeps/nodemcuv2, there are these folders, which look like the very libraries I'd need to build:

drwxr-xr-x be be 140 B Mon Sep  2 15:50:33 2019   .
drwxr-xr-x be be  18 B Mon Sep  2 15:50:33 2019   ..
drwx------ be be 268 B Mon Sep  2 15:50:33 2019   Adafruit NeoPixel_ID28
drwx------ be be 474 B Mon Sep  2 15:50:30 2019   ArduinoJson_ID64
drwx------ be be 236 B Mon Sep  2 15:50:31 2019   PubSubClient_ID89
drwx------ be be 230 B Mon Sep  2 15:50:32 2019   WS2812FX_ID1647

Below is the log. Can you please help me build the binary? This project looks so fun and I'd love to try it. Thank you for your help.

Additional information

❯ platformio run
Warning! `monitor_baud` configuration option in section [env:nodemcuv2] is deprecated and will be removed in the next release! Please use `monitor_speed` instead
Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.2 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 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 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 6.11.5
|-- <PubSubClient> 2.7
|-- <WS2812FX> 1.2.0
|   |-- <Adafruit NeoPixel> 1.1.8
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
Compiling .pio/build/nodemcuv2/src/main.cpp.o
src/main.cpp:14:0: warning: "MQTT_MAX_PACKET_SIZE" redefined [enabled by default]
 #define MQTT_MAX_PACKET_SIZE 512
 ^
In file included from src/main.cpp:8:0:
.pio/libdeps/nodemcuv2/PubSubClient_ID89/src/PubSubClient.h:26:0: note: this is the location of the previous definition
 #define MQTT_MAX_PACKET_SIZE 128
 ^
src/main.cpp:180:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
           ^
src/main.cpp:203:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
           ^
In file included from src/main.cpp:3:0:
src/setup.h:11:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 char *MQTT_STATE_TOPIC_PREFIX = "light/"; // e.g. led/<deviceName> and led/<deviceName>/set
                                 ^
src/setup.h:22:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 char *deviceName = "led";
                    ^
Archiving .pio/build/nodemcuv2/lib3ae/libESP8266WiFi.a
Indexing .pio/build/nodemcuv2/lib3ae/libESP8266WiFi.a
Compiling .pio/build/nodemcuv2/lib78d/ESP8266mDNS/LEAmDNS_Transfer.cpp.o
Compiling .pio/build/nodemcuv2/libd0e/ArduinoOTA/ArduinoOTA.cpp.o
Archiving .pio/build/nodemcuv2/libFrameworkArduinoVariant.a
Indexing .pio/build/nodemcuv2/libFrameworkArduinoVariant.a
Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp-frag.cpp.o
Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp-version.cpp.o
Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/nodemcuv2/FrameworkArduino/FS.cpp.o
Compiling .pio/build/nodemcuv2/FrameworkArduino/FunctionalInterrupt.cpp.o
src/main.cpp: In function 'void sendState()':
src/main.cpp:180:19: error: expected primary-expression before '<' token
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                   ^
src/main.cpp:180:33: error: 'jsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                                 ^
src/main.cpp:185:54: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject& {aka ArduinoJson6115_000001::ObjectRef&}' from an rvalue of type 'ArduinoJson6115_000001::ObjectRef'
   JsonObject &color = root.createNestedObject("color");
                                                      ^
src/main.cpp:194:20: error: 'ArduinoJson::JsonObject' has no member named 'measureLength'
   char buffer[root.measureLength() + 1];
                    ^
src/main.cpp:195:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
   root.printTo(buffer, sizeof(buffer));
        ^
src/main.cpp:195:16: error: 'buffer' was not declared in this scope
   root.printTo(buffer, sizeof(buffer));
                ^
src/main.cpp: In function 'bool processJson(char*)':
src/main.cpp:203:19: error: expected primary-expression before '<' token
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                   ^
src/main.cpp:203:33: error: 'jsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                                 ^
src/main.cpp:207:13: error: 'ArduinoJson::JsonObject' has no member named 'success'
   if (!root.success()) {
             ^
src/main.cpp: In function 'void callback(char*, byte*, unsigned int)':
src/main.cpp:259:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < length; i++) {
                       ^
*** [.pio/build/nodemcuv2/src/main.cpp.o] Error 1
============================================================================ [ERROR] Took 1.97 seconds ============================================================================


@ChrisJohns-me
Copy link

Since I was using PlatformIO, I was able to fix this by editing platformio.ini and changing
lib_deps = ArduinoJson, PubSubClient, WS2812FX
to
lib_deps = ArduinoJson@5.13.1, PubSubClient, WS2812FX

@prankousky
Copy link
Author

Thank you @ChrisJohns-me =)

I ended up using this solution myself a while ago, but forgot to mention it here. For some reason, the ArduinoJson version needs to be specified.

@ghost
Copy link

ghost commented Nov 30, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Repository owner locked as resolved and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants