Error : first defined here - collect2.exe: error: ld returned 1 exit status

I’m trying to build a LoRa temperature probe. I first made it in the arduino IDE and it all works bud I want to use a different LoRa library that is not supported with the arduino IDE. So I’m trying to get everything working in platformIO bud I get a compiling error I can’t fix.

error:

Linking .pio\build\ttgo_lora32_v1\firmware.elf
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_base.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src/senml/../util/base64.h:9: first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_basepack.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_cbor_parser.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\record/../../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_helpers.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_json_parser.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_jsonstreamingparser.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_logging.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_pack.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(cbor.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\cbor\../senml/../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
.pio\build\ttgo_lora32_v1\lib73f\libThingsML.a(senml_base_parser.cpp.o): In function `base64_dec_len(char*, int)':
D:\Users\Sander\Downloads\ESP32-LMIC-DeepSleep-example-master\ESP32-LMIC-DeepSleep-example-master/.pio\libdeps\ttgo_lora32_v1\ThingsML\src\senml\record/../../util/base64.h:9: multiple definition of `base64_dec_len(char*, int)'
.pio\build\ttgo_lora32_v1\src\main.cpp.o:main.cpp:(.text._Z14base64_dec_lenPci+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\ttgo_lora32_v1\firmware.elf] Error 1

This is my code:

#include <arduino.h>

#include <thingsml.h>

#include <lmic.h>

#include <hal/hal.h>

#include <SPI.h>

#include <ttn_credentials.h>

#include <Wire.h>

#include <Adafruit_MAX31865.h>

/*Custum variables */

//#define useOled

//#define loraUit

float temp = 0;

#define battMax 1480

#define battMin 1140

float battPercent = 0;

float battCo = 0;

SenMLPack device("tempProbe");

//SenMLDoubleRecord temperature(THINGSML_TEMPERATURE);

//SenMLDoubleRecord battery(THINGSML_BATTERY_LEVEL);

//Temp setup

Adafruit_MAX31865 thermo = Adafruit_MAX31865(13);

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000

#define RREF      430.0

// The 'nominal' 0-degrees-C resistance of the sensorr

// 100.0 for PT100, 1000.0 for PT1000

#define RNOMINAL  100.0

bool GOTO_DEEPSLEEP = false;

// rename ttn_credentials.h.example to ttn_credentials.h and add you keys

static const u1_t PROGMEM APPEUI[8] = TTN_APPEUI;

static const u1_t PROGMEM DEVEUI[8] = TTN_DEVEUI;

static const u1_t PROGMEM APPKEY[16] = TTN_APPKEY;

void os_getArtEui(u1_t *buf) { memcpy_P(buf, APPEUI, 8); }

void os_getDevEui(u1_t *buf) { memcpy_P(buf, DEVEUI, 8); }

void os_getDevKey(u1_t *buf) { memcpy_P(buf, APPKEY, 16); }

static uint8_t mydata[] = "Test";

static osjob_t sendjob;

// Schedule TX every this many seconds

// Respect Fair Access Policy and Maximum Duty Cycle!

// https://www.thethingsnetwork.org/docs/lorawan/duty-cycle.html

// https://www.loratools.nl/#/airtime

const unsigned TX_INTERVAL = 60;

// Saves the LMIC structure during DeepSleep

RTC_DATA_ATTR lmic_t RTC_LMIC;

#ifdef HELTEC_WIFI_LORA_32_V2_pins

    #define PIN_LMIC_NSS 18

    #define PIN_LMIC_RST 14

    #define PIN_LMIC_DIO0 26

    #define PIN_LMIC_DIO1 35

    #define PIN_LMIC_DIO2 34

    #define Vext 21

#endif

#ifdef TTGO_LORA32_V1_pins

    #define PIN_LMIC_NSS 18

    #define PIN_LMIC_RST 14

    #define PIN_LMIC_DIO0 26

    #define PIN_LMIC_DIO1 33

    #define PIN_LMIC_DIO2 32

    #define Vext 21

#endif

// Pin mapping

const lmic_pinmap lmic_pins = {

    .nss = PIN_LMIC_NSS,

    .rxtx = LMIC_UNUSED_PIN,

    .rst = PIN_LMIC_RST,

    .dio = {PIN_LMIC_DIO0, PIN_LMIC_DIO1, PIN_LMIC_DIO2},

};

void battMeasure() {

  battCo = (battMax - battMin) / 100;

  digitalWrite(Vext, LOW); //Turn on external power

  uint16_t ADC_voltage = analogRead(37);

  float percent = (ADC_voltage - battMin) / battCo;

  battPercent = percent;

  Serial.print("batt percent: ");

  Serial.println(percent);

  if (battPercent > 100){

    battPercent = 100;

  }

  digitalWrite(Vext, HIGH); //Turn off external power

#ifdef useOled

  displayBatt();

#endif

}

void tempMeasure() {

  Serial.println("Meet temp");

  thermo.begin(MAX31865_3WIRE);  // set to 2WIRE or 4WIRE as necessary

  uint16_t rtd = thermo.readRTD();

  temp = (thermo.temperature(RNOMINAL, RREF));

  Serial.print("RTD value: "); Serial.println(rtd);

  float ratio = rtd;

  ratio /= 32768;

  Serial.print("Ratio = "); Serial.println(ratio, 8);

  Serial.print("Resistance = "); Serial.println(RREF * ratio, 8);

  Serial.print("Temperature = "); Serial.println(temp);

  // Check and print any faults

  uint8_t fault = thermo.readFault();

  if (fault) {

    Serial.print("Fault 0x"); Serial.println(fault, HEX);

    if (fault & MAX31865_FAULT_HIGHTHRESH) {

      Serial.println("RTD High Threshold");

    }

    if (fault & MAX31865_FAULT_LOWTHRESH) {

      Serial.println("RTD Low Threshold");

    }

    if (fault & MAX31865_FAULT_REFINLOW) {

      Serial.println("REFIN- > 0.85 x Bias");

    }

    if (fault & MAX31865_FAULT_REFINHIGH) {

      Serial.println("REFIN- < 0.85 x Bias - FORCE- open");

    }

    if (fault & MAX31865_FAULT_RTDINLOW) {

      Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");

    }

    if (fault & MAX31865_FAULT_OVUV) {

      Serial.println("Under/Over voltage");

    }

    thermo.clearFault();

  }

  Serial.println();

#ifdef useOled

  displayTemp();

#endif

  return;

}

// opmode def

// https://github.com/mcci-catena/arduino-lmic/blob/89c28c5888338f8fc851851bb64968f2a493462f/src/lmic/lmic.h#L233

void LoraWANPrintLMICOpmode(void)

{

    Serial.print(F("LMIC.opmode: "));

    if (LMIC.opmode & OP_NONE)

    {

        Serial.print(F("OP_NONE "));

    }

    if (LMIC.opmode & OP_SCAN)

    {

        Serial.print(F("OP_SCAN "));

    }

    if (LMIC.opmode & OP_TRACK)

    {

        Serial.print(F("OP_TRACK "));

    }

    if (LMIC.opmode & OP_JOINING)

    {

        Serial.print(F("OP_JOINING "));

    }

    if (LMIC.opmode & OP_TXDATA)

    {

        Serial.print(F("OP_TXDATA "));

    }

    if (LMIC.opmode & OP_POLL)

    {

        Serial.print(F("OP_POLL "));

    }

    if (LMIC.opmode & OP_REJOIN)

    {

        Serial.print(F("OP_REJOIN "));

    }

    if (LMIC.opmode & OP_SHUTDOWN)

    {

        Serial.print(F("OP_SHUTDOWN "));

    }

    if (LMIC.opmode & OP_TXRXPEND)

    {

        Serial.print(F("OP_TXRXPEND "));

    }

    if (LMIC.opmode & OP_RNDTX)

    {

        Serial.print(F("OP_RNDTX "));

    }

    if (LMIC.opmode & OP_PINGINI)

    {

        Serial.print(F("OP_PINGINI "));

    }

    if (LMIC.opmode & OP_PINGABLE)

    {

        Serial.print(F("OP_PINGABLE "));

    }

    if (LMIC.opmode & OP_NEXTCHNL)

    {

        Serial.print(F("OP_NEXTCHNL "));

    }

    if (LMIC.opmode & OP_LINKDEAD)

    {

        Serial.print(F("OP_LINKDEAD "));

    }

    if (LMIC.opmode & OP_LINKDEAD)

    {

        Serial.print(F("OP_LINKDEAD "));

    }

    if (LMIC.opmode & OP_TESTMODE)

    {

        Serial.print(F("OP_TESTMODE "));

    }

    if (LMIC.opmode & OP_UNJOIN)

    {

        Serial.print(F("OP_UNJOIN "));

    }

}

void LoraWANDebug(lmic_t lmic_check)

{

    Serial.println("");

    Serial.println("");

    LoraWANPrintLMICOpmode();

    Serial.println("");

    Serial.print(F("LMIC.seqnoUp = "));

    Serial.println(lmic_check.seqnoUp);

    Serial.print(F("LMIC.globalDutyRate = "));

    Serial.print(lmic_check.globalDutyRate);

    Serial.print(F(" osTicks, "));

    Serial.print(osticks2ms(lmic_check.globalDutyRate) / 1000);

    Serial.println(F(" sec"));

    Serial.print(F("LMIC.globalDutyAvail = "));

    Serial.print(lmic_check.globalDutyAvail);

    Serial.print(F(" osTicks, "));

    Serial.print(osticks2ms(lmic_check.globalDutyAvail) / 1000);

    Serial.println(F(" sec"));

    Serial.print(F("LMICbandplan_nextTx = "));

    Serial.print(LMICbandplan_nextTx(os_getTime()));

    Serial.print(F(" osTicks, "));

    Serial.print(osticks2ms(LMICbandplan_nextTx(os_getTime())) / 1000);

    Serial.println(F(" sec"));

    Serial.print(F("os_getTime = "));

    Serial.print(os_getTime());

    Serial.print(F(" osTicks, "));

    Serial.print(osticks2ms(os_getTime()) / 1000);

    Serial.println(F(" sec"));

    Serial.print(F("LMIC.txend = "));

    Serial.println(lmic_check.txend);

    Serial.print(F("LMIC.txChnl = "));

    Serial.println(lmic_check.txChnl);

    Serial.println(F("Band \tavail \t\tavail_sec\tlastchnl \ttxcap"));

    for (u1_t bi = 0; bi < MAX_BANDS; bi++)

    {

        Serial.print(bi);

        Serial.print("\t");

        Serial.print(lmic_check.bands[bi].avail);

        Serial.print("\t\t");

        Serial.print(osticks2ms(lmic_check.bands[bi].avail) / 1000);

        Serial.print("\t\t");

        Serial.print(lmic_check.bands[bi].lastchnl);

        Serial.print("\t\t");

        Serial.println(lmic_check.bands[bi].txcap);

    }

    Serial.println("");

    Serial.println("");

}

void PrintRuntime()

{

    long seconds = millis() / 1000;

    Serial.print("Runtime: ");

    Serial.print(seconds);

    Serial.println(" seconds");

}

void PrintLMICVersion()

{

    Serial.print(F("LMIC: "));

    Serial.print(ARDUINO_LMIC_VERSION_GET_MAJOR(ARDUINO_LMIC_VERSION));

    Serial.print(F("."));

    Serial.print(ARDUINO_LMIC_VERSION_GET_MINOR(ARDUINO_LMIC_VERSION));

    Serial.print(F("."));

    Serial.print(ARDUINO_LMIC_VERSION_GET_PATCH(ARDUINO_LMIC_VERSION));

    Serial.print(F("."));

    Serial.println(ARDUINO_LMIC_VERSION_GET_LOCAL(ARDUINO_LMIC_VERSION));

}

void onEvent(ev_t ev)

{

    Serial.print(os_getTime());

    Serial.print(": ");

    switch (ev)

    {

    case EV_SCAN_TIMEOUT:

        Serial.println(F("EV_SCAN_TIMEOUT"));

        break;

    case EV_BEACON_FOUND:

        Serial.println(F("EV_BEACON_FOUND"));

        break;

    case EV_BEACON_MISSED:

        Serial.println(F("EV_BEACON_MISSED"));

        break;

    case EV_BEACON_TRACKED:

        Serial.println(F("EV_BEACON_TRACKED"));

        break;

    case EV_JOINING:

        Serial.println(F("EV_JOINING"));

        break;

    case EV_JOINED:

        Serial.println(F("EV_JOINED"));

        {

            u4_t netid = 0;

            devaddr_t devaddr = 0;

            u1_t nwkKey[16];

            u1_t artKey[16];

            LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);

            Serial.print("netid: ");

            Serial.println(netid, DEC);

            Serial.print("devaddr: ");

            Serial.println(devaddr, HEX);

            Serial.print("artKey: ");

            for (size_t i = 0; i < sizeof(artKey); ++i)

            {

                Serial.print(artKey[i], HEX);

            }

            Serial.println("");

            Serial.print("nwkKey: ");

            for (size_t i = 0; i < sizeof(nwkKey); ++i)

            {

                Serial.print(nwkKey[i], HEX);

            }

            Serial.println("");

        }

        // Disable link check validation (automatically enabled

        // during join, but because slow data rates change max TX

        // size, we don't use it in this example.

        LMIC_setLinkCheckMode(0);

        break;

    /*

        || This event is defined but not used in the code. No

        || point in wasting codespace on it.

        ||

        || case EV_RFU1:

        ||     Serial.println(F("EV_RFU1"));

        ||     break;

        */

    case EV_JOIN_FAILED:

        Serial.println(F("EV_JOIN_FAILED"));

        break;

    case EV_REJOIN_FAILED:

        Serial.println(F("EV_REJOIN_FAILED"));

        break;

    case EV_TXCOMPLETE:

        Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));

        if (LMIC.txrxFlags & TXRX_ACK)

            Serial.println(F("Received ack"));

        if (LMIC.dataLen)

        {

            Serial.print(F("Received "));

            Serial.print(LMIC.dataLen);

            Serial.println(F(" bytes of payload"));

        }

        GOTO_DEEPSLEEP = true;

        break;

    case EV_LOST_TSYNC:

        Serial.println(F("EV_LOST_TSYNC"));

        break;

    case EV_RESET:

        Serial.println(F("EV_RESET"));

        break;

    case EV_RXCOMPLETE:

        // data received in ping slot

        Serial.println(F("EV_RXCOMPLETE"));

        break;

    case EV_LINK_DEAD:

        Serial.println(F("EV_LINK_DEAD"));

        break;

    case EV_LINK_ALIVE:

        Serial.println(F("EV_LINK_ALIVE"));

        break;

    /*

        || This event is defined but not used in the code. No

        || point in wasting codespace on it.

        ||

        || case EV_SCAN_FOUND:

        ||    Serial.println(F("EV_SCAN_FOUND"));

        ||    break;

        */

    case EV_TXSTART:

        Serial.println(F("EV_TXSTART"));

        break;

    case EV_TXCANCELED:

        Serial.println(F("EV_TXCANCELED"));

        break;

    case EV_RXSTART:

        /* do not print anything -- it wrecks timing */

        break;

    case EV_JOIN_TXCOMPLETE:

        Serial.println(F("EV_JOIN_TXCOMPLETE: no JoinAccept"));

        break;

    default:

        Serial.print(F("Unknown event: "));

        Serial.println((unsigned)ev);

        break;

    }

}

void do_send(osjob_t *j)

{

    // Check if there is not a current TX/RX job running

    if (LMIC.opmode & OP_TXRXPEND)

    {

        Serial.println(F("OP_TXRXPEND, not sending"));

    }

    else

    {

        // Prepare upstream data transmission at the next possible time.

        LMIC_setTxData2(1, mydata, sizeof(mydata) - 1, 0);

        Serial.println(F("Packet queued"));

    }

    // Next TX is scheduled after TX_COMPLETE event.

}

void SaveLMICToRTC(int deepsleep_sec)

{

    Serial.println(F("Save LMIC to RTC"));

    RTC_LMIC = LMIC;

    // ESP32 can't track millis during DeepSleep and no option to advanced millis after DeepSleep.

    // Therefore reset DutyCyles

    unsigned long now = millis();

    // EU Like Bands

#if defined(CFG_LMIC_EU_like)

    Serial.println(F("Reset CFG_LMIC_EU_like band avail"));

    for (int i = 0; i < MAX_BANDS; i++)

    {

        ostime_t correctedAvail = RTC_LMIC.bands[i].avail - ((now / 1000.0 + deepsleep_sec) * OSTICKS_PER_SEC);

        if (correctedAvail < 0)

        {

            correctedAvail = 0;

        }

        RTC_LMIC.bands[i].avail = correctedAvail;

    }

    RTC_LMIC.globalDutyAvail = RTC_LMIC.globalDutyAvail - ((now / 1000.0 + deepsleep_sec) * OSTICKS_PER_SEC);

    if (RTC_LMIC.globalDutyAvail < 0)

    {

        RTC_LMIC.globalDutyAvail = 0;

    }

#else

    Serial.println(F("No DutyCycle recalculation function!"));

#endif

}

void LoadLMICFromRTC()

{

    Serial.println(F("Load LMIC from RTC"));

    LMIC = RTC_LMIC;

}

void GoDeepSleep()

{

    Serial.println(F("Go DeepSleep"));

    PrintRuntime();

    Serial.flush();

    esp_sleep_enable_timer_wakeup(TX_INTERVAL * 1000000);

    esp_deep_sleep_start();

}

void setup()

{

    Serial.begin(115200);

   

    pinMode(Vext, OUTPUT);

    digitalWrite(Vext, LOW); //Turn on external power

    adcAttachPin(37);

    analogSetClockDiv(255); // 1338mS

    tempMeasure();

    battMeasure();

      //Setup ThingsMl

    //device.add(temperature);

    //device.add(battery);

    //temperature.set(temp);

    //battery.set(battPercent);

    digitalWrite(Vext, HIGH); //Turn off external power

    Serial.println(F("Starting DeepSleep test"));

    PrintLMICVersion();

    // LMIC init

    os_init();

    // Reset the MAC state. Session and pending data transfers will be discarded.

    LMIC_reset();

    if (RTC_LMIC.seqnoUp != 0)

    {

        LoadLMICFromRTC();

    }

    LoraWANDebug(LMIC);

    // Start job (sending automatically starts OTAA too)

    do_send(&sendjob);

}

void loop()

{

    static unsigned long lastPrintTime = 0;

    os_runloop_once();

    const bool timeCriticalJobs = os_queryTimeCriticalJobs(ms2osticksRound((TX_INTERVAL * 1000)));

    if (!timeCriticalJobs && GOTO_DEEPSLEEP == true && !(LMIC.opmode & OP_TXRXPEND))

    {

        Serial.print(F("Can go sleep "));

        LoraWANPrintLMICOpmode();

        SaveLMICToRTC(TX_INTERVAL);

        GoDeepSleep();

    }

    else if (lastPrintTime + 2000 < millis())

    {

        Serial.print(F("Cannot sleep "));

        Serial.print(F("TimeCriticalJobs: "));

        Serial.print(timeCriticalJobs);

        Serial.print(" ");

        LoraWANPrintLMICOpmode();

        PrintRuntime();

        lastPrintTime = millis();

    }

}

And the platformio.ini

; PlatformIO Project Configuration File

;

;   Build options: build flags, source filter

;   Upload options: custom upload port, speed and extra flags

;   Library options: dependencies, extra library storages

;   Advanced options: extra scripting

;

; Please visit documentation for the other options and examples

; https://docs.platformio.org/page/projectconf.html

[platformio]

default_envs =

[env:heltec_wifi_lora_32_v2]

platform = espressif32

board = heltec_wifi_lora_32_V2

framework = arduino

monitor_speed = 115200

build_unflags = -Werror=reorder

lib_deps =

    ${common.lib_deps}

build_flags =

    -D HELTEC_WIFI_LORA_32_V2_pins

    ${common.build_flags}

[env:ttgo_lora32_v1]

platform = espressif32

board = ttgo-lora32-v1

framework = arduino

monitor_speed = 115200

build_unflags = -Werror=reorder

lib_deps =

    ${common.lib_deps}

build_flags =

    -D TTGO_LORA32_V1_pins

    ${common.build_flags}

[common]

lib_deps =

    mcci-catena/MCCI LoRaWAN LMIC library @ ^4.0.0

    adafruit/Adafruit MAX31865 library@^1.3.0

    ;kpn-iot/ThingsML@^1.0.2

build_flags =

    -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS

    -D CFG_eu868=1

    -D LMIC_DEBUG_LEVEL=1

    -D CFG_sx1276_radio=1

    -D DISABLE_PING=1

    -D DISABLE_BEACONS=1

    -D USE_ORIGINAL_AES

    -w

Who can help my?

Greetings,
Sander

The error is coming from the ThingsML library which you tried to remove alread in

but there was still some residue. Remove the (hidden) .pio folder in the project and rebuild to get a clean build.

Aah, yes.

I comment out to check if there was a problem with a double include or something, bud that did not work.
Indeed, I comment oud that library and all the code. Than it works, bud I need that library for my project. Can you tell me how I could get the library working with platformio?

Thank you for your response.

Sander

The library package in the registry (PlatformIO Registry) is severly outdated, from 2 years ago, although the library was updated just 5 days ago (GitHub - kpn-iot/thingsml-c-library: C library for ThingsML on your device). I’m not sure why it’s not updating. (@ivankravets?)

In the meantime, you can use the lib_deps expression

lib_deps =
    mcci-catena/MCCI LoRaWAN LMIC library @ ^4.0.0
    adafruit/Adafruit MAX31865 library@^1.3.0
    https://github.com/kpn-iot/thingsml-c-library/archive/refs/tags/1.4.0.zip

to make use of the latest version. Maybe the compile errors are automatically gone with that version.

1 Like

I’ve just made a PR Set repository type by ivankravets · Pull Request #24 · kpn-iot/thingsml-c-library · GitHub

Fixed in

You guys are awesome.
I did no noticed that there was a new version. I copied the latest release to my lib folder and it works without any problem.

Thank you!