LoRaWAN event takes long to come

I am trying to implement a low power sensor node using an ATmega328p processor with Arduino bootloader. I call os_runloop_once in the loop once and acquiring the EV_TXCOMPLETE can take up to a few minutes, but usually around 20-30 seconds. Due to my application, I need to keep sensors on until I get the event and this violates my low power needs. Any help/idea is appreciated. Attached you can find my related code excerpt(of course not functional due to the deleted parts):

volatile boolean alarm = true;
void onEvent (ev_t ev) {
  if (ev == EV_TXCOMPLETE) {
    Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
    if(alarm == false){
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
    // Schedule next transmission
    os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);

void do_send(osjob_t* j) {
  // Payload to send (uplink)
  alarm = false;
  digitalWrite(5, HIGH); // Turning on the mosfet the keep sensors alive
  uint8_t message[7];
  message [0] = temp >> 8;
  message [1] = temp;
  message [2] = econd >> 8;
  message [3] = econd;
  message [4] = pH;
  message [5] = random(0, 250);
  message [6] = random(0, 250);
  // 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, message, sizeof(message) - 1, 0);
    Serial.println(F("Sending uplink packet..."));
    digitalWrite(13, LOW);
  // Next TX is scheduled after TX_COMPLETE event.
  digitalWrite(5, LOW); // shut the MOSFET

void setup() {
  pinMode(5, OUTPUT); // MOSFET Switch
  pinMode(ECPin, INPUT);
  pinMode(ECPower, OUTPUT); //Setting pin for sourcing current
  pinMode(interruptPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, CHANGE);


  // LMIC init
  // Reset the MAC state. Session and pending data transfers will be discarded.
  // Set static session parameters.
  // Disable link check validation
  // TTN uses SF9 for its RX2 window.
  LMIC.dn2Dr = DR_SF9;
  // Set data rate and transmit power for uplink (note: txpow seems to be ignored by the library)
  LMIC_setDrTxpow(DR_SF8, 14);
  // Start job
void loop() {
  if (alarm == true) {
void handleInterrupt() {
  alarm = true;

Post ALL the code. The declarations, etc. are extremely important.

If all message bytes are important, I would suggest to send all of them.

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

Due to my application, I need to keep sensors on until I get the event and this violates my low power needs. Any help/idea is appreciated.

The fragment of code you posted is just a small part of your code we presume, there is for instance no code in there that shows exactly how or when you are reading your sensors and we dont even know which sensors they are.

So yes you need to post all your code.

If you 'need' to keep the sensors powered it might also be useful to us to explain why.

Be aware that there fair access rules for TTN that limit you to 30seconds of air time per day and probably legal duty cycle limits restricting transmission to only 1% of the total time available. So sending data too often may not be possible.