Compilation fails in the Particle Workbench with "Cloud Compile"

I can compile the following source code successfully on https://build.particle.io, but the compilation fails in the Particle Workbench with “Cloud Compile”.

Source code:

SYSTEM_MODE(AUTOMATIC);
SYSTEM_THREAD(ENABLED);

void setup() {
  waitUntil(Mesh.ready());
  Mesh.subscribe("temperature", myHandler);
  Mesh.subscribe("pressure", myHandler);
}

void loop() {
}

void myHandler(const char *event, const char *data)  // char * means a pointer to a charcter string with the ending of "\0"
{
  Particle.publish(event, data, PRIVATE );
}

Compilation logs:

Compiling code for argon
Targeting version: 0.8.0-rc.25

Including:
    src/argon_subscribeAndPublish.ino
    src/argon_subscribeAndPublish.cpp
    project.properties
attempting to compile firmware 

Processing  src/argon_subscribeAndPublish.ino
make -C ../modules/argon/user-part all
make[1]: Entering directory '/firmware/modules/argon/user-part'

make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory '/firmware/modules/argon/user-part'
Creating module_user_memory.ld ...
make[2]: Leaving directory '/firmware/modules/argon/user-part'

make -C ../../../user 
make[2]: Entering directory '/firmware/user'
Building cpp file: src/argon_subscribeAndPublish.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-12-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=12 -DPLATFORM_NAME=argon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00C -DUSBD_PID_CDC=0xC00C -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=12 -DPRODUCT_FIRMWARE_VERSION=65535 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=0.8.0-rc.25 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/argon -I../hal/network/lwip/esp32 -I../hal/src/nRF52840 -I../hal/src/armv7 -I../hal/src/nRF52840 -I../hal/src/nRF52840/lwip -I../hal/src/nRF52840/freertos -I../hal/src/nRF52840/openthread -I../hal/src/nRF52840/mbedtls -I../hal/src/nRF52840/littlefs -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/openthread -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../platform/shared/inc -I../third_party/nrf5_sdk -I../third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/mdk -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/src/prs -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/util -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/crc32 -I../third_party/nrf5_sdk/nrf5_sdk/components/drivers_nrf/usbd -I../third_party/nrf5_sdk/nrf5_sdk/integration/nrfx/legacy -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log/src -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/queue -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/mbr/nrf52840/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/strerror -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_flags -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc/acm -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/common -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/nrf_ble_gatt -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/ble_advertising -I../third_party/nrf5_sdk/nrf5_sdk/external/nrf_cc310/include -I../third_party/littlefs/littlefs -I../platform/MCU/nRF52840/inc -I../dynalib/inc -Isrc -I./libraries -I. -MD -MP -MF ../build/target/user/platform-12-msrc/argon_subscribeAndPublish.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=ESP32 -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=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=5 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,324 -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-12-msrc/argon_subscribeAndPublish.o src/argon_subscribeAndPublish.cpp
In file included from ../wiring/inc/spark_wiring.h:50:0,
                 from ./inc/application.h:40,
                 from src/argon_subscribeAndPublish.cpp:1:
src/argon_subscribeAndPublish.ino: In lambda function:
../wiring/inc/spark_wiring_system.h:458:74: error: expression cannot be used as a function
 #define waitUntil(condition) System.waitCondition([]{ return (condition)(); })
                                                                          ^
src/argon_subscribeAndPublish.ino:5:3: note: in expansion of macro 'waitUntil'
   waitUntil(Mesh.ready());
   ^
../wiring/inc/spark_wiring_system.h: In instantiation of 'static bool SystemClass::waitConditionWhile(Condition, While) [with Condition = setup()::<lambda()>; While = SystemClass::waitCondition(Condition) [with Condition = setup()::<lambda()>]::<lambda()>]':
../wiring/inc/spark_wiring_system.h:251:34:   required from 'static bool SystemClass::waitCondition(Condition) [with Condition = setup()::<lambda()>]'
src/argon_subscribeAndPublish.ino:5:3:   required from here
../wiring/inc/spark_wiring_system.h:244:39: error: could not convert '_condition.setup()::<lambda()>()' from 'void' to 'bool'
         while (_while() && !_condition()) {
                                       ^
../wiring/inc/spark_wiring_system.h:244:28: error: in argument to unary !
         while (_while() && !_condition()) {
                            ^
../wiring/inc/spark_wiring_system.h:247:27: error: void value not ignored as it ought to be
         return _condition();
                           ^
../build/module.mk:277: reci
Error: Command failed: /Users/john/.vscode/extensions/particle.particle-vscode-core-1.0.0-alpha.5/src/cli/bin/darwin/amd64/particle cloud compile argon --target 0.8.0-rc.25


Compiling code for argon
Targeting version: 0.8.0-rc.25

Including:
    src/argon_subscribeAndPublish.ino
    src/argon_subscribeAndPublish.cpp
    project.properties
attempting to compile firmware 

Processing  src/argon_subscribeAndPublish.ino
make -C ../modules/argon/user-part all
make[1]: Entering directory '/firmware/modules/argon/user-part'

make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory '/firmware/modules/argon/user-part'
Creating module_user_memory.ld ...
make[2]: Leaving directory '/firmware/modules/argon/user-part'

make -C ../../../user 
make[2]: Entering directory '/firmware/user'
Building cpp file: src/argon_subscribeAndPublish.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-12-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=12 -DPLATFORM_NAME=argon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD00C -DUSBD_PID_CDC=0xC00C -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=12 -DPRODUCT_FIRMWARE_VERSION=65535 -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"openthread-config-project.h\" -DENABLE_FEM=1 -DNRF_802154_PROJECT_CONFIG=\"openthread-platform-config.h\" -DRAAL_SOFTDEVICE=1 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=0.8.0-rc.25 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/argon -I../hal/network/lwip/esp32 -I../hal/src/nRF52840 -I../hal/src/armv7 -I../hal/src/nRF52840 -I../hal/src/nRF52840/lwip -I../hal/src/nRF52840/freertos -I../hal/src/nRF52840/openthread -I../hal/src/nRF52840/mbedtls -I../hal/src/nRF52840/littlefs -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/openthread -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/GCC/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/external/freertos/portable/CMSIS/nrf52 -I../third_party/openthread/openthread/include -I../third_party/openthread/openthread/src/core -I../third_party/openthread/openthread/examples/platforms -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/hal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal -I../third_party/openthread/openthread/third_party/NordicSemiconductor/drivers/radio/raal/softdevice -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../platform/shared/inc -I../third_party/nrf5_sdk -I../third_party/nrf5_sdk/nrf5_sdk/components/toolchain/cmsis/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/include -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/mdk -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/hal -I../third_party/nrf5_sdk/nrf5_sdk/modules/nrfx/drivers/src/prs -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/util -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/crc32 -I../third_party/nrf5_sdk/nrf5_sdk/components/drivers_nrf/usbd -I../third_party/nrf5_sdk/nrf5_sdk/integration/nrfx/legacy -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_log/src -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/experimental_section_vars -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/delay -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/queue -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/common -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/mbr/nrf52840/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140 -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers -I../third_party/nrf5_sdk/nrf5_sdk/components/softdevice/s140/headers/nrf52 -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_fifo -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/strerror -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/fstorage -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/atomic_flags -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc -I../third_party/nrf5_sdk/nrf5_sdk/components/libraries/usbd/class/cdc/acm -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/common -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/nrf_ble_gatt -I../third_party/nrf5_sdk/nrf5_sdk/components/ble/ble_advertising -I../third_party/nrf5_sdk/nrf5_sdk/external/nrf_cc310/include -I../third_party/littlefs/littlefs -I../platform/MCU/nRF52840/inc -I../dynalib/inc -Isrc -I./libraries -I. -MD -MP -MF ../build/target/user/platform-12-msrc/argon_subscribeAndPublish.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=ESP32 -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=0xD4000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=5 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,324 -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-12-msrc/argon_subscribeAndPublish.o src/argon_subscribeAndPublish.cpp
In file included from ../wiring/inc/spark_wiring.h:50:0,
                 from ./inc/application.h:40,
                 from src/argon_subscribeAndPublish.cpp:1:
src/argon_subscribeAndPublish.ino: In lambda function:
../wiring/inc/spark_wiring_system.h:458:74: error: expression cannot be used as a function
 #define waitUntil(condition) System.waitCondition([]{ return (condition)(); })
                                                                          ^
src/argon_subscribeAndPublish.ino:5:3: note: in expansion of macro 'waitUntil'
   waitUntil(Mesh.ready());
   ^
../wiring/inc/spark_wiring_system.h: In instantiation of 'static bool SystemClass::waitConditionWhile(Condition, While) [with Condition = setup()::<lambda()>; While = SystemClass::waitCondition(Condition) [with Condition = setup()::<lambda()>]::<lambda()>]':
../wiring/inc/spark_wiring_system.h:251:34:   required from 'static bool SystemClass::waitCondition(Condition) [with Condition = setup()::<lambda()>]'
src/argon_subscribeAndPublish.ino:5:3:   required from here
../wiring/inc/spark_wiring_system.h:244:39: error: could not convert '_condition.setup()::<lambda()>()' from 'void' to 'bool'
         while (_while() && !_condition()) {
                                       ^
../wiring/inc/spark_wiring_system.h:244:28: error: in argument to unary !
         while (_while() && !_condition()) {
                            ^
../wiring/inc/spark_wiring_system.h:247:27: error: void value not ignored as it ought to be
         return _condition();
                           ^
../build/module.mk:277: reci
	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>

- - - -


It works now after replacing “waitUntil(Mesh.ready());” to “waitUntil(Mesh.ready);”

Confused. Is “ready” a property or a function of Mesh?

waitUntil() expects a function pointer to a function which doesn’t take and returns a bool.

You can imagine waitUntil() defined like this (obviously just for illustration)

typedef bool (*awaitable)(void);
void waitUntil(awaitable fn) {
  while (!fn())  // call the function that was passed in and loop as long it returns false 
    Particle.process();
}
2 Likes

I too can compile the following source code successfully with the web ide, but will not with Particle Workbench with “Cloud Compile”.

/*
    Project BUScore by Jason
    This project file is for the "HoverBoard" (Particle Photon wifi module)
    It containst the functions that grab data from the webhook, parse it, and send it to the "BattleShip"
                                                                                    */

#include <string.h>
#include <WProgram.h>
#include "functions.h"

using namespace std;

// This function will Serial1 print the data in the format of:
// data,home score,away score,period,minutes,seconds
void got_scores(const char* event, const char* data)
{

    static string data_temp;
    static int data_count = 0;
    string data_byte = strtok(strdup(data), ",");

    // if first data_byte is not "data", or if data is the same as previous then don't print data.
    // Also note that data will print out if it hasn't printed in the last 10 times
    if (strcmp(data_byte.c_str(), "data") != 0 || (strcmp(data, data_temp.c_str()) == 0 && data_count < 10)) {
        data_count++;
        return;
    }

    data_count = 0;
    data_temp = data;
    string isUnplayed = strtok(NULL, ",");
    string isinProgress = strtok(NULL, ",");
    string isCompleted = strtok(NULL, ",");

    // If game has not been played yet display no score or time
    if (strcmp(isUnplayed.c_str(), "true") == 0) {
        Serial1.println("data,00,00,0,00,00");
    }

    // if game is currently in progress
    else if (strcmp(isinProgress.c_str(), "true") == 0) {

        int away_score = atoi(strtok(NULL, ","));
        int home_score = atoi(strtok(NULL, ","));
        int period = atoi(strtok(NULL, ","));
        int seconds_remaining = atoi(strtok(NULL, ","));

        int minutes = seconds_remaining / 60;
        int seconds = seconds_remaining % 60;

        Serial1.printf("data,%02d,%02d,%d,%02d,%02d\n", away_score, home_score, period, minutes, seconds);
    }

    // if game is finished display the final score, the time as 0, and "10" for period
    else {

        int away_score = atoi(strtok(NULL, ","));
        int home_score = atoi(strtok(NULL, ","));
        Serial1.printf("data,%02d,%02d,10,00,00\n", away_score, home_score);
    }
}

Compiling for: photon | v1.2.0-beta.1. Log output below.

> Compiling code for photon
> Targeting version: 1.2.0-beta.1
> 
> Including:
>     src/functions.h
>     src/BUHover.ino
>     src/BUHover.cpp
>     src/functions.cpp
>     project.properties
> attempting to compile firmware 
> 
> Processing  src/BUHover.ino
> Checking library HttpClient...
> Installing library HttpClient 0.0.5 to lib/HttpClient ...
> Library HttpClient 0.0.5 installed.
> make -C ../modules/photon/user-part all
> make[1]: Entering directory '/firmware/modules/photon/user-part'
> make -C ../../../user 
> make[2]: Entering directory '/firmware/user'
> Building cpp file: src/BUHover.cpp
> Invoking: ARM GCC CPP Compiler
> mkdir -p ../build/target/user/platform-6-msrc/
> arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=6 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=1.2.0-beta.1 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../third_party/miniz/miniz -I../services/inc -I../third_party/nanopb/nanopb -I../communication/src -I../hal/inc -I../hal/shared -I../hal/src/photon -I../hal/src/stm32f2xx -I../hal/src/stm32 -I../hal/src/photon/api -I../hal/src/photon/include -I../hal/src/photon/wiced/security/BESL/host/WICED/ -I../hal/src/photon/wiced/security/BESL/include -I../hal/src/photon/wiced/security/BESL -I../hal/src/photon/wiced/security/BESL/crypto -I../hal/src/photon/wiced/WWD/include/ -I../hal/src/photon/wiced/platform/include/ -I../hal/src/photon/wiced/platform/GCC/ -I../hal/src/photon/wiced/security/BESL/supplicant/ -I../hal/src/photon/libraries/crypto -I../hal/src/photon/libraries/daemons/DNS_redirect -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/HttpClient/src -I. -MD -MP -MF ../build/target/user/platform-6-msrc/BUHover.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 -DBOOTLOADER_SDK_3_3_0_PARTICLE -DPARTICLE_DCT_COMPATIBILITY -DSPARK_PLATFORM_NET=BCM9WCDUSI09 -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=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,1201 -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-6-msrc/BUHover.o src/BUHover.cpp
> src/BUHover.ino: In function 'int team_league(String)':
> src/BUHover.ino:52:101: error: no matching function for call to 'USBSerial::print(char [256], unsigned int, const char [26], char [10], const char*)'
>    Serial.print(date_team, sizeof(date_team), "{\"date\":\"%s\",\"team\":\"%s\"}", date, team.c_str());
>                                                                                                      ^
> In file included from ../wiring/inc/spark_wiring_string.h:34:0,
>                  from ../wiring/inc/spark_wiring_stream.h:30,
>                  from ../wiring/inc/spark_wiring.h:40,
>                  from ./inc/application.h:40,
>                  from src/BUHover.cpp:1:
> ../wiring/inc/spark_wiring_print.h:70:12: note: candidate: size_t Print::print(const char*)
>      size_t print(const char[]);
>             ^
> ../wiring/inc/spark_wiring_print.h:70:12: note:   candidate expects 1 argument, 5 provided
> ../wiring/inc/spark_wiring_print.h:71:12: note: candidate: size_t Print::print(char)
>      size_t print(char);
>             ^
> ../wiring/inc/spark_wiring_print.h:71:12: note:   candidate expects 1 argument, 5 provided
> ../wiring/inc/spark_wiring_print.h:72:12: note: candidate: size_t Print::print(unsigned char, int)
>      size_t print(unsigned char, int = DEC);
>             ^
> ../wiring/inc/spark_wiring_print.h:72:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:73:12: note: candidate: size_t Print::print(int, int)
>      size_t print(int, int = DEC);
>             ^
> ../wiring/inc/spark_wiring_print.h:73:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:74:12: note: candidate: size_t Print::print(unsigned int, int)
>      size_t print(unsigned int, int = DEC);
>             ^
> ../wiring/inc/spark_wiring_print.h:74:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:75:12: note: candidate: size_t Print::print(long int, int)
>      size_t print(long, int = DEC);
>             ^
> ../wiring/inc/spark_wiring_print.h:75:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:76:12: note: candidate: size_t Print::print(long unsigned int, int)
>      size_t print(unsigned long, int = DEC);
>             ^
> ../wiring/inc/spark_wiring_print.h:76:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:77:12: note: candidate: size_t Print::print(double, int)
>      size_t print(double, int = 2);
>             ^
> ../wiring/inc/spark_wiring_print.h:77:12: note:   candidate expects 2 arguments, 5 provided
> ../wiring/inc/spark_wiring_print.h:78:12: note: candidate: size_t Print::print(const Printable&)
>      size_t print(const Printable&);
>             ^
> ../wiring/inc/spark_wiring_print.h:78:12: note:   candidate expects 1 argument, 5 provided
> ../wiring/inc/spark_wiring_print.h:79:12: note: candidate: size_t Print::print(const __FlashStringHelper*)
>      size_t print(const __FlashStringHelper*);
>             ^
> ../wiring/inc/spark_wiring_print.h:79:12: note:   candidate expects 1 argument, 5 provided
> ../build/module.mk:277: recipe for target '../build/target/user/platform-6-msrc/BUHover.o' failed
> make[2]: Leaving directory '/firmware/user'
> Compile failed: Compiler encountered an error
> Error: Command failed: /Users/scott/.vscode/extensions/particle.particle-vscode-core-1.4.2/src/cli/bin/darwin/amd64/particle cloud compile photon --target 1.2.0-beta.1
Serial.print(date_team, sizeof(date_team), "{\"date\":\"%s\",\"team\":\"%s\"}", date, team.c_str());

I’d be surprised if that buildt in Web IDE.
First, it would be Serial.printf() and secondly, then you’d not provide a buffer nor a buffer size to the command.

Since I can’t see that command in your code snippet, I’d deduce you are not actually compiling that very code :wink:

My bad, there are a couple of other files that I forgot to attach.

function.cpp

/*
    Project BUScore by Jason
    This project file is for the "HoverBoard" (Particle Photon wifi module)
    It containst the functions that grab data from the webhook, parse it, and send it to the "BattleShip"
                                                                                    */

#include <string.h>
#include <WProgram.h>
#include "functions.h"

using namespace std;

// This function will Serial1 print the data in the format of:
// data,home score,away score,period,minutes,seconds
void got_scores(const char* event, const char* data)
{

    static string data_temp;
    static int data_count = 0;
    string data_byte = strtok(strdup(data), ",");

    // if first data_byte is not "data", or if data is the same as previous then don't print data.
    // Also note that data will print out if it hasn't printed in the last 10 times
    if (strcmp(data_byte.c_str(), "data") != 0 || (strcmp(data, data_temp.c_str()) == 0 && data_count < 10)) {
        data_count++;
        return;
    }

    data_count = 0;
    data_temp = data;
    string isUnplayed = strtok(NULL, ",");
    string isinProgress = strtok(NULL, ",");
    string isCompleted = strtok(NULL, ",");

    // If game has not been played yet display no score or time
    if (strcmp(isUnplayed.c_str(), "true") == 0) {
        Serial1.println("data,00,00,0,00,00");
    }

    // if game is currently in progress
    else if (strcmp(isinProgress.c_str(), "true") == 0) {

        int away_score = atoi(strtok(NULL, ","));
        int home_score = atoi(strtok(NULL, ","));
        int period = atoi(strtok(NULL, ","));
        int seconds_remaining = atoi(strtok(NULL, ","));

        int minutes = seconds_remaining / 60;
        int seconds = seconds_remaining % 60;

        Serial1.printf("data,%02d,%02d,%d,%02d,%02d\n", away_score, home_score, period, minutes, seconds);
    }

    // if game is finished display the final score, the time as 0, and "10" for period
    else {

        int away_score = atoi(strtok(NULL, ","));
        int home_score = atoi(strtok(NULL, ","));
        Serial1.printf("data,%02d,%02d,10,00,00\n", away_score, home_score);
    }
}

function.h

/*
    Project BUScore by Jason
    This project file is for the "HoverBoard" (Particle Photon wifi module)
    It declares all functions
                                                                                    */

void got_scores(const char *, const char *);

This is something that I was working on a long time ago and just back at it and thought I would try this software to see if everything was working as it should. Perhaps I’m a way off in left field, but with no programming skills, I thought I might start somewhere.

The error message indicates which file causes the problem and in the additional files you posted above the offending line of code isn’t present either.
You need to find that line and change that.