anchor.diff:                  });
                 }
   
  -              wifi.on('connect', function(err, data){
  +              wifi.on('connect', function(data){
                   // you're connected
  -                console.log("connect emitted", err, data);
  +                console.log("connect emitted", data);
                 });
   
  -              wifi.on('disconnect', function(err, data){
  +              wifi.on('disconnect', function(data){
                   // wifi dropped, probably want to call connect() again
  -                console.log("disconnect emitted", err, data);
  +                console.log("disconnect emitted", data);
                 })
   
                 wifi.on('timeout', function(err){
                   // tried to connect but couldn't, retry
                   console.log("timeout emitted"); 
  -                connect();
  +                if (timeouts > 3) {
  +                  // reset the wifi chip if we've timed out too many times
  +                  powerCycle();
  +                } else {
  +                  // try to reconnect
  +                  connect();
  +                }
                 });
   
                 wifi.on('error', function(err){
  
positive.code:               var network = '#####'; // put in your network name here
                var pass = '#####'; // put in your password here, or leave blank for unsecured
                var security = 'wpa2'; // other options are 'wep', 'wpa', or 'unsecured'
  
                // connect to the wifi network
                // check if the wifi chip is busy (currently trying to connect), if not, try to connect
                function tryConnect(){
                  if (!wifi.isBusy()) {
                    connect();
                  } else {
                    // The cc3k is set up to automatically try to connect on boot. 
                    // For the first few seconds of program bootup, you'll always 
                    // see the wifi chip as being "busy"
                    console.log("is busy, trying again");
                    setTimeout(function(){
                      tryConnect();
                    }, 1000);
                  } 
                }
  
                function connect(){
                  wifi.connect({
  
negative.code:                 console.log("error emitted", err);
                });
  
                // reset the wifi chip progammatically
                function powerCycle(){
                  // when the wifi chip resets, it will automatically try to reconnect
                  // to the last saved network
                  wifi.reset(function(){
                    timeouts = 0; // reset timeouts
                    console.log("done power cycling");
                    // give it some time to auto reconnect
                    setTimeout(function(){
                      if (!wifi.isConnected()) {
                        // try to reconnect
                        connect();
                      }
                      }, 20 *10000);
                  })
                }
  
        .row
          .large-12.columns
  