Wireless Stick with vs code

Hello I’m new with Wireless Stick, tried to run some example code from Heltec with vs code (with PlatformIO). With the OTAA example I get this output with an error at the end.
Did anyone have an idea ?

Executing task in folder hello world: platformio run <

Processing heltec_wireless_stick (platform: espressif32; board: heltec_wireless_stick; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/heltec_wireless_stick.html
PLATFORM: Espressif 32 1.12.3 > Heltec Wireless Stick
HARDWARE: ESP32 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 3.10004.200129 (1.0.4)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • toolchain-xtensa32 2.50200.80 (5.2.0)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 28 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- <ESP32_LoRaWAN> 2.0
    | |-- 1.0
    |-- 1.0
    Building in release mode
    Linking .pio/build/heltec_wireless_stick/firmware.elf
    .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(LoRa.cpp.o):(.data.DevEui+0x0): multiple definition of DevEui' .pio/build/heltec_wireless_stick/src/main.cpp.o:(.data.DevEui+0x0): first defined here .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(LoRa.cpp.o):(.data.AppEui+0x0): multiple definition ofAppEui’
    .pio/build/heltec_wireless_stick/src/main.cpp.o:(.data.AppEui+0x0): first defined here
    .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(LoRa.cpp.o):(.data.AppKey+0x0): multiple definition of AppKey' .pio/build/heltec_wireless_stick/src/main.cpp.o:(.data.AppKey+0x0): first defined here .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(rtc-board.S.o): In functionTimerGetTimerValue’:
    D:/D:\61722\Documents\Arduino\hardware\heltec\esp32\libraries\ESP32_LoRaWAN\src\rtc-board.c:120:(.text.TimerGetTimerValue+0x31): dangerous relocation: call8: call target out of range: __udivdi3
    .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(rtc-board.S.o): In function TimerGetElapsedAlarmTime': D:\/D:\61722\Documents\Arduino\hardware\heltec\esp32\libraries\ESP32_LoRaWAN\src\rtc-board.c:120:(.text.TimerGetElapsedAlarmTime+0x32): dangerous relocation: call8: call target out of range: __udivdi3 .pio/build/heltec_wireless_stick/lib16d/libESP32_LoRaWAN_ID6633.a(rtc-board.S.o): In functionTimerComputeElapsedTime’:
    D:/D:\61722\Documents\Arduino\hardware\heltec\esp32\libraries\ESP32_LoRaWAN\src\rtc-board.c:134:(.text.TimerComputeElapsedTime+0x32): dangerous relocation: call8: call target out of range: __udivdi3
    collect2: error: ld returned 1 exit status
    *** [.pio/build/heltec_wireless_stick/firmware.elf] Error 1
    ========================================================= [FAILED] Took 3.34 seconds =========================================================
    The terminal process terminated with exit code: 1

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

Can you please give me some hint about how to use platform.io with an external library?

I will test at my side.

Hello, I’m not sure what you mean …
But I tried something. See code below
If I delete the rows
Mcu.begin(SS,RST_SX127x,DIO0,DIO1,LICENSE);
DeviceState = DEVICE_STATE_INIT;
the error doesn’t come

Andreas

/*

  • HelTec Automation™ LoRaWAN 1.0.2 OTAA example use OTAA, CLASS A
  • Function summary:
    • use internal RTC(15KHz);
    • Include stop mode and deep sleep mode;
    • 60S data send cycle;
    • Informations output via serial(115200);
    • Debug log message can be configed in board.h(DebugLevel);
    • Only ESP32 + LoRa series boards can use this library, need a license
  • to make the code run(check you license here:
  • You can change some definition in “Commissioning.h” and “LoRaMac-definitions.h”
  • HelTec AutoMation, Chengdu, China.
  • 成都惠利特自动化科技有限公司
  • www.heltec.cn
  • support@heltec.cn

*/

#include “Arduino.h”
#include “board.h”
#include “LoRaMac.h”
#include “Commissioning.h”
#include <SPI.h>
#include <LoRa.h>
#include <Mcu.h>

#define SCK 5 // GPIO5 – SX127x’s SCK
#define MISO 19 // GPIO19 – SX127x’s MISO
#define MOSI 27 // GPIO27 – SX127x’s MOSI
#define SS 18 // GPIO18 – SX127x’s CS
#define RST 14 // GPIO14 – SX127x’s RESET
#define DIO0 26 // GPIO26 – SX127x’s IRQ(Interrupt Request)
#define DIO1 35 // GPIO33 – SX127x’s IRQ(Interrupt Request)

#define V2
#define CLASS CLASS_A

#ifdef V2 //WIFI Kit series V1 not support Vext control
#define DIO1 35 // GPIO35 – SX127x’s IRQ(Interrupt Request) V2
#else
#define DIO1 33 // GPIO33 – SX127x’s IRQ(Interrupt Request) V1
#endif

#define Vext 21

uint32_t LICENSE[4] = {0xF7BDEA78, 0xB3E1E4F0, 0x128D4F09, 0xD27374DD};
void setup()
{
// Add your initialization code here

Serial.begin(115200);
while (!Serial);
SPI.begin(SCK,MISO,MOSI,SS);
Mcu.begin(SS,RST_SX127x,DIO0,DIO1,LICENSE);
DeviceState = DEVICE_STATE_INIT;

}

// The loop function is called in an endless loop
void loop()
{

}

The ESP32 LoRaWAN library didn’t included in the Heltec ESP32 development framework, I mean how can I add (call) an external library in platform.io?

Then I can test at my side.