Cubecell HTCC-AB02 configuration with DS18B20

Hi there guys!
I am struggling with measuring the temperature witihin the loop function. What I tried to do is to call “measureTemperature()” function inside switch case “DEVICE_STATE_SEND”, but it seemed not to measure temperatures. It only works when i use it within the “setup()” function. So I came up with the idea that in case to measure temperature in every step, I will reset either LoraWan or the CubeCell board using “CySoftwareReset();” or “void(* resetFunc) (void) = 0;” after "LoraWan.sleep(), but the board didnt seem to get into sleep at all, what It did is just keep resetting no matter the sleep cycle. Do you have any idea how can i manage it to work? My code looks like this:

DallasSensor.ino:

//
// First we include the libraries
#include “OneWire.h”
#include “DallasTemperature.h”
/
/
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS GPIO1
//
// Setup a oneWire instance to communicate with any OneWire devices
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
/
/
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
/********************************************************************/

void setupTemperatureSensor(void)
{
// Turn on voltage supply on temperature sensor
pinMode(Vext, OUTPUT);
digitalWrite(Vext, LOW);

delay(500);

// Start up the library
sensors.begin();
}

void measureTemperature(void)
{

// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print(" Requesting temperatures…");
sensors.requestTemperatures(); // Send the command to get temperature readings
Serial.println(“DONE”);

// You can have more than one DS18B20 on the same bus.
// 0 refers to the first IC on the wire
Serial.print(sensors.getTempCByIndex(0));
Serial.print(",");
Serial.println(sensors.getTempCByIndex(1));
// delay(1000);
}

LoraSettings.ino:

/* OTAA para*/
uint8_t devEui[] = { 0x70, 0xB3, 0x64, 0x7E, 0x10, 0x00, 0x24, 0x30 };
uint8_t appEui[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t appKey[] = { 0x63, 0x70, 0xD0, 0x7E, 0x48, 0x4A, 0xH3, 0x51, 0x54, 0x61, 0x32, 0xD2, 0xEF, 0xFD, 0x06, 0x8E };

/* ABP para*/
uint8_t nwkSKey[] = { 0x15, 0xb1, 0xd0, 0xef, 0xa4, 0x63, 0xdf, 0xbe, 0x3d, 0x11, 0x18, 0x1e, 0x1e, 0xc7, 0xda,0x85 };
uint8_t appSKey[] = { 0xd7, 0x2c, 0x78, 0x75, 0x8c, 0xdc, 0xca, 0xbf, 0x55, 0xee, 0x4a, 0x77, 0x8d, 0x16, 0xef,0x67 };
uint32_t devAddr = ( uint32_t )0x007e6ae1;

/LoraWan channelsmask, default channels 0-7/
uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };

/LoraWan region, select in arduino IDE tools/
LoRaMacRegion_t loraWanRegion = ACTIVE_REGION;

/LoraWan Class, Class A and Class C are supported/
DeviceClass_t loraWanClass = LORAWAN_CLASS;

/the application data transmission duty cycle. value in [ms]./
uint32_t SLEEP_DURATION_MS = 1 * 60 * 60 * 1000;
uint32_t appTxDutyCycle = SLEEP_DURATION_MS;

/OTAA or ABP/
bool overTheAirActivation = LORAWAN_NETMODE;

/ADR enable/
bool loraWanAdr = LORAWAN_ADR;

/* set LORAWAN_Net_Reserve ON, the node could save the network info to flash, when node reset not need to join again */
bool keepNet = LORAWAN_NET_RESERVE;

/* Indicates if the node is sending confirmed or unconfirmed messages */
bool isTxConfirmed = LORAWAN_UPLINKMODE;

uint8_t appPort = 2;

uint8_t confirmedNbTrials = 4;

Monitoring.ino

#include “LoRaWan_APP.h”
#include “Arduino.h”
#include “LoraSettings.h”

/* Prepares the payload of the frame */
static void prepareDataPacket()
{
appDataSize = 4;
appData[0] = 0x00;
appData[1] = 0x01;
appData[2] = 0x02;
appData[3] = 0x03;
}

// declare reset fuction at address 0
void(* resetFunc) (void) = 0;

void setupLora()
{
#if(AT_SUPPORT)
enableAt();
#endif
deviceState = DEVICE_STATE_INIT;
LoRaWAN.ifskipjoin();
}

void setup() {
// Start serial communication
Serial.begin(9600);
setupTemperatureSensor();
measureTemperature();
setupLora();
}

void loop()
{
switch( deviceState )
{
case DEVICE_STATE_INIT:
{
#if(LORAWAN_DEVEUI_AUTO)
LoRaWAN.generateDeveuiByChipID();
#endif
#if(AT_SUPPORT)
getDevParam();
#endif
printDevParam();
LoRaWAN.init(loraWanClass,loraWanRegion);
deviceState = DEVICE_STATE_JOIN;
break;
}
case DEVICE_STATE_JOIN:
{
LoRaWAN.join();
break;
}
case DEVICE_STATE_SEND:
{
prepareDataPacket();
LoRaWAN.send();
deviceState = DEVICE_STATE_CYCLE;
break;
}
case DEVICE_STATE_CYCLE:
{
// Schedule next packet transmission
txDutyCycleTime = SLEEP_DURATION_MS + randr( 0, APP_TX_DUTYCYCLE_RND );
LoRaWAN.cycle(txDutyCycleTime);
deviceState = DEVICE_STATE_SLEEP;
break;
}
case DEVICE_STATE_SLEEP:
{
LoRaWAN.sleep();

  // Resets the LoraWan Module
  //CySoftwareReset();
  //resetFunc();
  break;
}
default:
{
  deviceState = DEVICE_STATE_INIT;
  break;
}

}
}