   cmd.raw = Serial.read();
   if (cmd.raw != Serial.peek())
     return;
+
   Serial.read();  // Consume the copy msg;
   if (cmd.op == SET_PERIOD)  {
     switch (cmd.channel) {

volatile uint8_t zerocross_isr_flag;
uint16_t num_cycles;
uint8_t led2_state;
DimmerChannel<SSR1_PIN> ch1;
DimmerChannel<SSR2_PIN> ch2;
DimmerChannel<SSR3_PIN> ch3;
DimmerChannel<SSR4_PIN> ch4;

void setup()
{
  pinMode(LED1, OUTPUT);

  }
  led2_state = led2_state ? LOW : HIGH;
  digitalWrite(LED2, led2_state);
  mins_since_last_remote_command = 0;
}

void hm10_beacon_send_current_brightness() {
