Cannot compile via cloud

Hi there,

Today I began to use Particle Workbench for Visual Studio Code. It is very nice. However, when I tried to use “Particle Cloud Compile”, the following logs were shown. It seemed that there were only warnings but no errors. No hex file was generated. Why? I can get the hex firmware generated by using the local compiler.


Compiling code for electron
Targeting version: 0.8.0-rc.10

Including:
    lib/HttpClient/src/HttpClient.h
    lib/HttpClient/src/HttpClient/HttpClient.h
    lib/LIS3DH/src/LIS3DH.h
    lib/OneWire/src/DS18.h
    lib/OneWire/src/OneWire.h
    lib/SparkJson/src/ArduinoJson.h
    lib/SparkJson/src/DynamicJsonBuffer.h
    lib/SparkJson/src/IndentedPrint.h
    lib/SparkJson/src/JsonArray.h
    lib/SparkJson/src/JsonBuffer.h
    lib/SparkJson/src/JsonBufferAllocated.h
    lib/SparkJson/src/JsonObject.h
    lib/SparkJson/src/JsonPair.h
    lib/SparkJson/src/JsonParser.h
    lib/SparkJson/src/JsonPrintable.h
    lib/SparkJson/src/JsonVariant.h
    lib/SparkJson/src/JsonVariantContent.h
    lib/SparkJson/src/JsonVariantType.h
    lib/SparkJson/src/JsonWriter.h
    lib/SparkJson/src/List.h
    lib/SparkJson/src/ListConstIterator.h
    lib/SparkJson/src/ListIterator.h
    lib/SparkJson/src/ListNode.h
    lib/SparkJson/src/Prettyfier.h
    lib/SparkJson/src/Print.h
    lib/SparkJson/src/QuotedString.h
    lib/SparkJson/src/ReferenceType.h
    lib/SparkJson/src/SparkJson.h
    lib/SparkJson/src/StaticJsonBuffer.h
    lib/SparkJson/src/StringBuilder.h
    src/spark-dallas-temperature.h
    lib/OneWire/examples/Address_Scanner/Address_Scanner.ino
    lib/OneWire/examples/DS18x20_Temperature/DS18x20_Temperature.ino
    lib/SparkJson/examples/IndentedPrintExample/IndentedPrintExample.ino
    lib/SparkJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino
    lib/SparkJson/examples/JsonParserExample/JsonParserExample.ino
    lib/SparkJson/examples/JsonServer/JsonServer.ino
    lib/SparkJson/src/my-core.ino
    src/electron.ino
    lib/HttpClient/examples/application/application.cpp
    lib/HttpClient/src/HttpClient.cpp
    lib/LIS3DH/examples/1_WakeOnMove/1_WakeOnMove.cpp
    lib/LIS3DH/examples/2_Samples/2_Samples.cpp
    lib/LIS3DH/examples/3_I2C/3_I2C.cpp
    lib/LIS3DH/examples/4_Position/4_Position.cpp
    lib/LIS3DH/examples/5_Movement/5_Movement.cpp
    lib/LIS3DH/src/LIS3DH.cpp
    lib/OneWire/src/DS18.cpp
    lib/OneWire/src/OneWire.cpp
    lib/SparkJson/src/IndentedPrint.cpp
    lib/SparkJson/src/JsonArray.cpp
    lib/SparkJson/src/JsonBuffer.cpp
    lib/SparkJson/src/JsonObject.cpp
    lib/SparkJson/src/JsonParser.cpp
    lib/SparkJson/src/JsonVariant.cpp
    lib/SparkJson/src/List.cpp
    lib/SparkJson/src/Prettyfier.cpp
    lib/SparkJson/src/Print.cpp
    lib/SparkJson/src/QuotedString.cpp
    lib/SparkJson/src/SparkJson.cpp
    lib/SparkJson/src/StringBuilder.cpp
    src/spark-dallas-temperature.cpp
    project.properties
attempting to compile firmware 

Processing  lib/OneWire/examples/Address_Scanner/Address_Scanner.ino
Processing  lib/OneWire/examples/DS18x20_Temperature/DS18x20_Temperature.ino
Processing  lib/SparkJson/examples/IndentedPrintExample/IndentedPrintExample.ino
Processing  lib/SparkJson/examples/JsonGeneratorExample/JsonGeneratorExample.ino
Processing  lib/SparkJson/examples/JsonParserExample/JsonParserExample.ino
Processing  lib/SparkJson/examples/JsonServer/JsonServer.ino
Processing  lib/SparkJson/src/my-core.ino
Processing  src/electron.ino
Checking library SparkJson...
Checking library OneWire...
Checking library HttpClient...
Checking library LIS3DH...
Installing library HttpClient 0.0.5 to lib/HttpClient ...
Installing library SparkJson 0.0.2 to lib/SparkJson ...
Library SparkJson 0.0.2 installed.
Installing library OneWire 2.0.3 to lib/OneWire ...
Installing library LIS3DH 0.2.2 to lib/LIS3DH ...
Library LIS3DH 0.2.2 installed.
Library OneWire 2.0.3 installed.
Library HttpClient 0.0.5 installed.
make -C ../modules/electron/user-part all
make[1]: Entering directory '/firmware/modules/electron/user-part'
make -C ../../../user 
make[2]: Entering directory '/firmware/user'
Building cpp file: src/spark-dallas-temperature.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-10-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=10 -DPLATFORM_NAME=electron -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00A -DUSBD_PID_CDC=0xC00A -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=10 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.8.0-rc.10 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../services/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/include -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/portable/GCC/ARM_CM3 -I../hal/src/electron -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -Isrc -I./libraries -Ilib/SparkJson/src -Ilib/LIS3DH/src -Ilib/HttpClient/src -Ilib/OneWire/src -I. -MD -MP -MF ../build/target/user/platform-10-msrc/spark-dallas-temperature.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=UBLOXSARA -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x8080000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=5 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,309 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/user/platform-10-msrc/spark-dallas-temperature.o src/spark-dallas-temperature.cpp

Building cpp file: src/electron.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-10-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=10 -DPLATFORM_NAME=electron -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00A -DUSBD_PID_CDC=0xC00A -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=10 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.8.0-rc.10 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../services/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/include -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/portable/GCC/ARM_CM3 -I../hal/src/electron -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -Isrc -I./libraries -Ilib/SparkJson/src -Ilib/LIS3DH/src -Ilib/HttpClient/src -Ilib/OneWire/src -I. -MD -MP -MF ../build/target/user/platform-10-msrc/electron.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=UBLOXSARA -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x8080000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=5 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,309 -DMODULE_DEPENDENCY2=0,0,0 -D_WINSOCK_H -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -std=gnu++11 -c -o ../build/target/user/platform-10-msrc/electron.o src/electron.cpp
In file included from lib/SparkJson/src/./ArduinoJson.h:7:0,
                 from lib/SparkJson/src/SparkJson.h:13,
                 from src/electron.ino:7:
lib/SparkJson/src/././DynamicJsonBuffer.h: In destructor 'ArduinoJson::DynamicJsonBuffer::~DynamicJsonBuffer()':
lib/SparkJson/src/././DynamicJsonBuffer.h:20:33: warning: deleting object of polymorphic class type 'ArduinoJson::DynamicJsonBuffer' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
   ~DynamicJsonBuffer() { delete _next; }
                                 ^

Building cpp file: lib/SparkJson/src/JsonVariant.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-10-mSparkJson/src/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=10 -DPLATFORM_NAME=electron -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00A -DUSBD_PID_CDC=0xC00A -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=10 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=0.8.0-rc.10 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../services/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/include -I/rtos/FreeRTOSv8.2.2/FreeRTOS/Source/portable/GCC/ARM_CM3 -I../hal/src/electron -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../platform/shared/inc -I../platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I../platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I../platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I../platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I../platform/MCU/shared/STM32/inc -I../platform/MCU/STM32F2xx/CMSIS/Include -I../platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I../dynalib/inc -Isrc -I./libraries -Ilib/SparkJson/src -Ilib/LIS3DH/src -Ilib/HttpClient/src -Ilib/OneWire/src -I. -MD -MP -MF ../build/target/user/platform-10-mSparkJson/src/JsonVariant.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DSPARK_PLATFORM_NET=UBLOXSARA -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc  -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x8080000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=5 -DMODULE_FUNCTION=5 -DMODULE_IN
	at makeError (/Users/john/.vscode/extensions/particle.particle-vscode-core-1.0.0-alpha.5/node_modules/execa/index.js:174:9)
	at module.exports.Promise.all.then.arr (/Users/john/.vscode/extensions/particle.particle-vscode-core-1.0.0-alpha.5/node_modules/execa/index.js:278:16)
	at <anonymous>

- - - -


The reason is that the library examples are also built which will not result in a single binary.
You need to remove the examples folders from the libraries.
An entire project can only have one .ino file and in all source files only one set of setup()/loop() is allowed.

@m_m, I think this is a similar situation as what we last discussed in another thread about importing projects that come with dependencies :wink:

The same problem after removing all the examples folders from the libraries.

@ScruffR I understand what you said. But how do you know the error is related to the examples?

It works now after I replace SparkJson with ArduinoJson.

1 Like

Hi

I have the same problem. I use web ide so i don’t know how to remove example from library. I also tried replac SparkJson by ArduinoJson but this is the same problem.

i will appreciate your help

When you use Web IDE you can post a SHARE THIS REVISION link for someone to try out your project and maybe spot the problem and find a solution.

Ok, so this is the link.
https://go.particle.io/shared_apps/5dd5a3dd4b417a001b3310b2

Edit: I should be added that I use particle photon, not electron

There have been some issues with Web IDE where it didn’t really report any useful error messages anymore, but that should be fixed.
However, no I get a file not found message for the imported library header(s) which seems wrong too. Maybe this issue is linked to the one above.

Maybe @marekparticle can investigate that with the devs and report back.

BTW, I’d use JsonParserGeneratorRK as that’s a library written by Rick from Particle and would be a lot easier to debug if needed than ArduinoJson with its multitude of separate files of which we don’t even see all the sources.

1 Like

I believe a fix has either just been deployed or will be deployed today to address the above strange reporting behavior from the Web IDE compiler. Please let me know if you continue to experience these issues.

@marekparticle, this is the project that still doesn’t build.
The strange (cannot compile and HTTP 400) reported in another thread seem to have gone, but I don’t understand why the header file of an obviouls imported library cannot be found.
https://go.particle.io/shared_apps/5dd62d1dcf9f6b001b4ac7d4 link deactivated.

I can duplicate this issue, thanks @ScruffR.

1 Like

So i should use another IDE? On Visual Code this error should not occurs?

@Gatzky / @ScruffR - it’s this particular app that’s not working. It has two project.properties files for a reason I don’t quite understand. Please remake the App in the web IDE and it should be fine.

1 Like

An associated issue is that
if you compile using ArduinoJson library on WebIDE - it will work.
if you compile using ArduinoJson library on Workbench locally - it will work.
if you compile using ArduinoJson library on Workbench Cloud compile - it will fail.

The reason is that ArduinoJson uses .hpp files in its (many) files of its library and the .hpp are not considered in the building process

This is another reason foy my proposal that Web IDE could do with a CLEAN THIS PROJECT button.
Another was that once compiling with a library, then removing the library since you realise you need to tweak its sources and copy/paste the sources to your project, you will get multi-definition errors from the new local sources vs. the precompiled object files of the now removed library.

As in this issue report that has never got any attention from official side AFAICT

2 Likes

The reason is that ArduinoJson uses .hpp files in its (many) files of its library and the .hpp are not considered in the building process

the pr i linked to in the comment you linked was merged back in august and shipped in particle-cli@1.44.0 (current is v1.51.0).

running particle compile photon against a project which uses the ArduinoJson library, i see the many .hpp files being sent up and my compilation succeeds.

can you confirm you are using an up-to-date version of the Particle CLI and let me know if the problem is still happening?

now that all said, i do get a compilation error (locally and via the cloud):

lib/ArduinoJson/src/ArduinoJson/Deserialization/Reader.hpp:20:26: error: 'class String' has no member named 'read'
     return _source->read();

...when i try to run some of its example code.

so, regardless, i think the best bet is to use JsonParserGeneratorRK going forward :+1:

Agreed - I integrated this library instead into my code base and it is actually simpler to use and I have had no issues since then.