           if(push2_state!=prev_push2_state) 
           {
             if(push2_state==HIGH) {
-              Serial.println("Push2 High");
               update(PUSH2, true);
             }
             else if(push2_state==LOW) {
-              Serial.println("Push2 Low");
               update(PUSH2, false);
             }
             client.print(aJson.print(frame));
             delay(50);
           }
-         
-          
           
           prev_push1_state = push1_state;
           prev_push2_state = push2_state;
         }
-        Serial.println("connection closed");
+        
         digitalWrite(RED_LED, LOW);
         client.stop();
         

#include <WiFiClient.h>
#include <aJSON.h>

#define DEFAULT_UDP_MEMBERSHIP  "225.0.0.37"
#define DEFAULT_UDP_PORT  21928


    delay(300);
  }
  
  WiFi.macAddress(mac);
  for(int i=0;i<sizeof(mac);i++) {
    mac_string += String(mac[sizeof(mac)-1-i],HEX);
    if(i<(sizeof(mac)-1))
      mac_string += ":";
  }
  
  printWifiStatus();

  server.begin();
  Udp.begin(DEFAULT_UDP_PORT);
  
  //device profile
  if(announce) {
    aJson.addStringToObject(announce, "devicename", "TI-CC3200");
    aJson.addStringToObject(announce, "uuid", uuid);
    aJson.addStringToObject(announce, "mac", mac_string.c_str());
    aJson.addStringToObject(announce, "manufacturer", "Texas Instrument");
    aJson.addStringToObject(announce, "author", "cossb");
    aJson.addStringToObject(announce, "component", "cc3200button");
    aJson.addStringToObject(announce, "protocol", "tcp");
    aJson.addNumberToObject(announce, "port", 8000);
    aJson.addStringToObject(announce, "command","auth");
  }
  
  if(frame) {
    aJson.addStringToObject(frame, "devicename", "TI-CC3200");
    aJson.addStringToObject(frame, "uuid", uuid);
    aJson.addStringToObject(frame, "mac", mac_string.c_str());
    aJson.addStringToObject(frame, "component", "cc3200button");
    aJson.addStringToObject(frame, "command","buttonread");
    aJson.addBooleanToObject(frame, "button1", false);
    aJson.addBooleanToObject(frame, "button2", false);
