 #include "JnPlugs.h"
 
 #define JG_EEPROM_ADDR ((uint8_t*) 0x80)
+
+// Flags indicating actions on the serial port
+static byte useSerial = 1;   // If we want the serial port active
+static byte readSerial = 0;  // If we've ever received anything
 
 // Lame floating point format, only powers of ten = mant*10^exp
 // 4 bits mantissa (0..15), 4 bits exponent (-8..7)

        return 1;
    }

    // Print measurements
    myprintf("%d: ", plug.port);
    for(byte j=0; j<dev->num_measurements; j++) {
        myprintf("%d, ", measurements[j]);
    }
    myputs("\n");
    serialFlush();

    if(record) {
        bufferMeasurements(plug, measurements);

    scheduler.timer(TASK_ANNOUNCE, 0);    // start the announcements
}

void loop () {
    // pollWaiting goes to low-power mode but also disables the serial port.
    // So we listen to the serial port for the first minute after boot.  If
    // we don't receive something in that time assume noone is there and
    // stop monitoring.
    byte event;

    if( !readSerial && millis() > 60000 )
        useSerial = 0;
    if( useSerial ) {
        while (Serial.available())
        {
            readSerial = 1;
