     switch(event) {
         case WIFI_EVENT_STAMODE_GOT_IP:
             Serial.println("ESCONNECT");
-            success = udp.begin(localUdpPort);
-            if (!success) {
+            udpUp = udp.begin(localUdpPort);
+            if (!udpUp) {
               Serial.println("ESUDP:FAIL");
             } else {
               Serial.printf("ESUDP:%s:%d\n", WiFi.localIP().toString().c_str(), localUdpPort);

            break;
        case WIFI_EVENT_STAMODE_DISCONNECTED:
            Serial.println("ESDISCONN");
            break;
    }
}

const char* password = "CreativeResearch";
const unsigned int localUdpPort = 5111;

IPAddress remIP(192, 168, 1, 20);
const int remPort = 5101;

char buf[255];
int bufLen = 0;
bool bufDone = false;

WiFiUDP udp;
bool udpUp;
char incomingPacket[255];

long lastTime;
