 #else
   Simblee_ULPDelay((60000 * runPeriod) - time_elapsed) ;
 #endif
+
   Serial.begin(9600);
+  // time to settle, method in troduced by @bertrooode
+  // wait for serial interface up and running or if 5 secs are elapsed
+  unsigned long ct = mymillis();
+  while ( !Serial && ((mymillis()-ct) < 5000) ) {
+    delay(100);
+  }
+  print_statef("serial interface ready after %d ms", ct-mymillis());
 }
 
 /*

 *  V0.9.06
 *  - queue length adjusted to 8h
 *  - added debug output for decodeSN
 */

/* ********************* program configuration options **********************/

#define RFD                     // enable for RFduino platform?
//#define N_RFD                   // enable for Simblee platform
#define N_USE_DEAD_SENSOR       // enable to work with live sensors
//#define USE_DEAD_SENSOR         // enable to test with a dead sensor
#define USE_SPIKE_FILTER        // enable to use a spike filter on raw data
// #define N_USE_SPIKE_FILTER     // enable to not use a spike filter on raw data
#define USE_XBRIDGE2            // enable to use two way xbridge2 protocol with backfilling
//#define N_USE_XBRIDGE2            // enable to use plain LimiTTer text transmission without backchannel
#define USE_SHADOWFRAM          // work with a shadow FRAM copy of the Libre sensor FRAM
//#define NSHADOWFRAM            // read a full Libre sensor FRAM content each cycle

//#define SHORTSTARTCYCLE         // first 10 cycles with 1 min period
#define N_SHORTSTARTCYCLE         // normal system start

/* 
 * debug and other less important options
 * add an "N_" prefix to disbale the option
 */
#define N_DEBUG
#define N_SIM_MINUTES_UPCOUNT     // for testing backfilling with dead sensor

/*
 * BLE and central seetings
 */
#define DXQUEUESIZE (8*12)     // 12 h of queue (remember and send the last x hours when reconnected via BLE)

#define LB_NAME   "xbridge1"    // dont change "xbridge", space for 1 char left to indicate different versions
#define LB_ADVERT "rfduino"     // dont change "rfduino"
                                // length of device name and advertisement <=15!!!
#define LB_VERSION "V0.9"       // program version
#define LB_MINOR_VERSION ".06"  // indicates minor version
#define LB_DATETIME "180213_1332" // date_time
#define SPIKE_HEIGHT 40         // minimum delta to be a spike

#define MAX_VOLTAGE 3600        // adjust voltage measurement to have a wider rrange

void RFduinoBLE_onDisconnect()
{
  BTconnected = false;
#ifdef ULP_WITH_SERIAL
  print_state("+++++++++++++ BLE lost");
#endif
}

void RFduinoBLE_onConnect()
{
  BTconnected = true;
#ifdef ULP_WITH_SERIAL
  print_state("+++++++++++++ BLE conn");
#endif
}

void RFduinoBLE_onRSSI(int rssi)
