             Serial.println(F("Exit test mode"));
             g_fTestMode = false;
             // we're in the LMIC, we don't want to send from here. Schedule a job.
-            os_setTimedCallback(&sendjob, os_getTime() + ms2osticks(10), do_send);
+            os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);
             return;
         }
         case LMIC_COMPLIANCE_RX_ACTION_IGNORE: {

    // Reset the MAC state. Session and pending data transfers will be discarded.
    LMIC_reset();

    // do the network-specific setup.
    setupForNetwork();

    // Start job (sending automatically starts OTAA too)
    do_send(&sendjob);
}

void setupForNetwork(void) {
#if defined(CFG_us915)
    LMIC_setLinkCheckMode(0);
    LMIC_setDrTxpow(DR_SF7, 14);
    LMIC_selectSubBand(1);
#endif
}

void loop() {
    os_runloop_once();
}

        case EV_TXSTART:
            // this event tells us that a transmit is about to start.
            // but printing here is bad for timing.
            Serial.print(F(": ch "));
            Serial.print(unsigned(e.txChnl));
            printRps(e.rps);
            Serial.print(F(", datarate ")); Serial.print(unsigned(e.datarate));
            Serial.print(F(", opmode ")); Serial.print(unsigned(e.opmode), HEX);
            break;

        case EV_RXSTART:
            Serial.print(F(": freq="));
            printFreq(e.freq);
            printRps(e.rps);
            Serial.print(F(", datarate ")); Serial.print(unsigned(e.datarate));
            Serial.print(F(", opmode ")); Serial.print(unsigned(e.opmode), HEX);
            Serial.print(F(", txend ")); Serial.print(e.txend); 
            Serial.print(F(", delta ms ")); Serial.print(osticks2ms(e.time - e.txend));
            break;

        case EV_JOIN_TXCOMPLETE:
            Serial.print(F(": saveIrqFlags 0x"));
            Serial.print(unsigned(e.saveIrqFlags), HEX);
            break;

        default:
            break;
    }
    Serial.println("");
}

/*
