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

  ch3.initialize();
  ch4.initialize();

  Serial.begin(9600);
  initialize_hm10_beacon();


volatile uint8_t zerocross_isr_flag;
uint16_t num_cycles;
uint8_t led2_state;
uint8_t mins_since_last_remote_command;

DimmerChannel<SSR1_PIN> ch1;
DimmerChannel<SSR2_PIN> ch2;
DimmerChannel<SSR3_PIN> ch3;
DimmerChannel<SSR4_PIN> ch4;


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