user33547: I'm getting these in my serial port, but what does wifi evt 3 and 7 mean?
I am trying to complete this tutorial. https://youtu.be/4Z0gBG8dkqw
The PHP file is on my hosting, and the ESP reads out the temperature and humidity from the sensor so that's fine.
The serial code:
Connecting
wifi evt: 3
Connected
Temperature:
24.10
Humidity:
39.70
[hostByName] request IP for: lucasdebelder.be
[hostByName] Host: lucasdebelder.be IP: 185.182.57.81
connected
HTTP/1.1 200 OK
Date: Fri, 11 May 2018 13:14:17 GMT
Server: Apache/2
Upgrade: h2,h2c
Connection: Upgrade, close
Vary: User-Agent
Content-Length: 0
Content-Type: text/html; charset=UTF-8

�
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7

The code that I am running in Arduino.
 
#include <ESP8266WiFi.h>
#include "DHT.h"

const char* ssid     = "bbox2";      // SSID of local network
const char* password = "azerty";   // Password on network

WiFiClient client;
char servername[]="lucasdebelder.be";  // remote server we will connect to
String result;

float temperature;
float humidity;

#define DHTPIN 14  

#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  dht.begin();
  delay(2000);
  Serial.begin(115200);
  Serial.println("Connecting");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
  }
  Serial.println("Connected");
  delay(1000);
  readSensor();
  String temperatureString = String(temperature,1);
  String humidityString = String(humidity,1);
  sendDataToServer(temperatureString,humidityString);
}

void loop() {

}

void sendDataToServer(String temperature, String humidity)
{
  if (client.connect(servername, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /send_email.php?temperature="+temperature+"&humidity="+humidity+" HTTP/1.1"); //Send data
    client.println("Host: lucasdebelder.be");
    client.println("Connection: close");  //close 1.1 persistent connection  
    client.println(); //end of get request
  } 
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

 while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
      result = result+c;
    }

  client.stop(); //stop client
  Serial.println(result);

}


void readSensor()
{

  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  Serial.println("Temperature:");
  Serial.println(temperature);
  Serial.println("Humidity:");
  Serial.println(humidity);

}


user37622: You see the "wifi" debug messages because you set in Tools menu Debug Level "WiFi". SetDebug Level "None"


user30175: The codes are explained in this forum thread. The wifi event types are  described here (and also duplicated here, which are ultimately coming from the Espressif Non-RTOS SDK, chapter 6.2.4):
typedef enum WiFiEvent 
{
    WIFI_EVENT_STAMODE_CONNECTED = 0,
    WIFI_EVENT_STAMODE_DISCONNECTED,
    WIFI_EVENT_STAMODE_AUTHMODE_CHANGE,
    WIFI_EVENT_STAMODE_GOT_IP,
    WIFI_EVENT_STAMODE_DHCP_TIMEOUT,
    WIFI_EVENT_SOFTAPMODE_STACONNECTED,
    WIFI_EVENT_SOFTAPMODE_STADISCONNECTED,
    WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED,
    WIFI_EVENT_MAX,
    WIFI_EVENT_ANY = WIFI_EVENT_MAX,
    WIFI_EVENT_MODE_CHANGE
} WiFiEvent_t;

The enum's values are increasing downwards, meaning that 7 is WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED. Receiving a probe request means that some other device has scanned the surrounding WiFi networks and your ESP answered. This indicates that your ESP is in the Software Access Point (AP) + Station (SoftAP + STA) mode. But you only want to be a station in your own WiFi network, not an access point yourself.
The output is triggered by this function.
This comment on an issue suggests that you add WiFi.mode(WIFI_STA); to your setup, like
void setup() {
  WiFi.mode(WIFI_STA);
  dht.begin();  
  delay(2000);
  Serial.begin(115200);
  Serial.println("Connecting");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
  }
  Serial.println("Connected");
  delay(1000);
  readSensor();
  String temperatureString = String(temperature,1);
  String humidityString = String(humidity,1);
  sendDataToServer(temperatureString,humidityString);
}

Subsequently, a WiFi event 3 indicates WIFI_EVENT_STAMODE_GOT_IP. Which also makes sense because you're telling the module to connect to the WiFi, it acquires an IP over DHCP and is then fully connected. This message is harmless since it doesn't indicate an error.
You should investigate on why these debug messages are thrown in the first place. The messages are only printed if two macros are set: DEBUG_ESP_WIFI and DEBUG_ESP_PORT (see here). So something must do #define DEBUG_ESP_WIFI and #define DEBUG_ESP_PORT Serial somewhere. 
This is either done in some compiler settings which you are not aware of or because you modified a header file to include this change. Either way, you can try to use the #undef pre-processor macro to remove these definitions again before including the library. Change your first line to the following:
//Try to kill the DEBUG defines
#undef DEBUG_ESP_WIFI
#undef DEBUG_ESP_PORT
#undef DEBUG_WIFI
#include <ESP8266WiFi.h>


33547: <p>I'm getting these in my serial port, but what does wifi evt 3 and 7 mean?
I am trying to complete this tutorial. <a href="https://youtu.be/4Z0gBG8dkqw" rel="nofollow noreferrer">https://youtu.be/4Z0gBG8dkqw</a></p>

<p>The PHP file is on my hosting, and the ESP reads out the temperature and humidity from the sensor so that's fine.</p>

<p><strong>The serial code:</strong></p>

<pre><code>Connecting
wifi evt: 3
Connected
Temperature:
24.10
Humidity:
39.70
[hostByName] request IP for: lucasdebelder.be
[hostByName] Host: lucasdebelder.be IP: 185.182.57.81
connected
HTTP/1.1 200 OK
Date: Fri, 11 May 2018 13:14:17 GMT
Server: Apache/2
Upgrade: h2,h2c
Connection: Upgrade, close
Vary: User-Agent
Content-Length: 0
Content-Type: text/html; charset=UTF-8

�
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
wifi evt: 7
</code></pre>

<p><strong>The code that I am running in Arduino.</strong>
&nbsp;</p>

<pre><code>#include &lt;ESP8266WiFi.h&gt;
#include "DHT.h"

const char* ssid     = "bbox2";      // SSID of local network
const char* password = "azerty";   // Password on network

WiFiClient client;
char servername[]="lucasdebelder.be";  // remote server we will connect to
String result;

float temperature;
float humidity;

#define DHTPIN 14  

#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  dht.begin();
  delay(2000);
  Serial.begin(115200);
  Serial.println("Connecting");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
  }
  Serial.println("Connected");
  delay(1000);
  readSensor();
  String temperatureString = String(temperature,1);
  String humidityString = String(humidity,1);
  sendDataToServer(temperatureString,humidityString);
}

void loop() {

}

void sendDataToServer(String temperature, String humidity)
{
  if (client.connect(servername, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /send_email.php?temperature="+temperature+"&amp;humidity="+humidity+" HTTP/1.1"); //Send data
    client.println("Host: lucasdebelder.be");
    client.println("Connection: close");  //close 1.1 persistent connection  
    client.println(); //end of get request
  } 
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

 while(client.connected() &amp;&amp; !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
      result = result+c;
    }

  client.stop(); //stop client
  Serial.println(result);

}


void readSensor()
{

  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  Serial.println("Temperature:");
  Serial.println(temperature);
  Serial.println("Humidity:");
  Serial.println(humidity);

}
</code></pre>
 37622: <p>You see the "wifi" debug messages because you set in Tools menu <code>Debug Level "WiFi"</code>. Set<code>Debug Level "None"</code></p>

<p><a href="https://i.stack.imgur.com/rNSRB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rNSRB.png" alt="enter image description here"></a></p>
 30175: <p>The codes are explained in <a href="https://www.esp8266.com/viewtopic.php?f=32&amp;t=15454" rel="nofollow noreferrer">this forum thread</a>. The wifi event types are  described <a href="https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiType.h#L51" rel="nofollow noreferrer">here</a> (and also <a href="https://github.com/esp8266/Arduino/blob/master/tools/sdk/include/user_interface.h#L444" rel="nofollow noreferrer">duplicated here</a>, which are ultimately coming from the <a href="https://www.espressif.com/sites/default/files/documentation/2c-esp8266_non_os_sdk_api_reference_en.pdf" rel="nofollow noreferrer">Espressif Non-RTOS SDK</a>, chapter 6.2.4):</p>

<pre class="lang-cpp prettyprint-override"><code>typedef enum WiFiEvent 
{
    WIFI_EVENT_STAMODE_CONNECTED = 0,
    WIFI_EVENT_STAMODE_DISCONNECTED,
    WIFI_EVENT_STAMODE_AUTHMODE_CHANGE,
    WIFI_EVENT_STAMODE_GOT_IP,
    WIFI_EVENT_STAMODE_DHCP_TIMEOUT,
    WIFI_EVENT_SOFTAPMODE_STACONNECTED,
    WIFI_EVENT_SOFTAPMODE_STADISCONNECTED,
    WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED,
    WIFI_EVENT_MAX,
    WIFI_EVENT_ANY = WIFI_EVENT_MAX,
    WIFI_EVENT_MODE_CHANGE
} WiFiEvent_t;
</code></pre>

<p>The enum's values are increasing downwards, meaning that 7 is <code>WIFI_EVENT_SOFTAPMODE_PROBEREQRECVED</code>. Receiving a probe request means that some other device has scanned the surrounding WiFi networks and your ESP answered. This indicates that your ESP is in the Software Access Point (AP) + Station (SoftAP + STA) mode. But you only want to be a station in your own WiFi network, not an access point yourself.</p>

<p>The output is triggered by <a href="https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L217" rel="nofollow noreferrer">this function</a>.</p>

<p><a href="https://github.com/esp8266/Arduino/issues/2068" rel="nofollow noreferrer">This comment on an issue</a> suggests that you add <code>WiFi.mode(WIFI_STA);</code> to your <code>setup</code>, like</p>

<pre class="lang-cpp prettyprint-override"><code>void setup() {
  WiFi.mode(WIFI_STA);
  dht.begin();  
  delay(2000);
  Serial.begin(115200);
  Serial.println("Connecting");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
  }
  Serial.println("Connected");
  delay(1000);
  readSensor();
  String temperatureString = String(temperature,1);
  String humidityString = String(humidity,1);
  sendDataToServer(temperatureString,humidityString);
}
</code></pre>

<p>Subsequently, a WiFi event 3 indicates <code>WIFI_EVENT_STAMODE_GOT_IP</code>. Which also makes sense because you're telling the module to connect to the WiFi, it acquires an IP over DHCP and is then fully connected. This message is harmless since it doesn't indicate an error.</p>

<p>You should investigate on why these debug messages are thrown in the first place. The messages are only printed if two macros are set: <code>DEBUG_ESP_WIFI</code> and <code>DEBUG_ESP_PORT</code> (<a href="https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFi.h#L43" rel="nofollow noreferrer">see here</a>). So <em>something</em> must do <code>#define DEBUG_ESP_WIFI</code> and <code>#define DEBUG_ESP_PORT Serial</code> somewhere. </p>

<p>This is either done in some compiler settings which you are not aware of or because you modified a header file to include this change. Either way, you can try to use the <code>#undef</code> pre-processor macro to remove these definitions again before including the library. Change your first line to the following:</p>

<pre><code>//Try to kill the DEBUG defines
#undef DEBUG_ESP_WIFI
#undef DEBUG_ESP_PORT
#undef DEBUG_WIFI
#include &lt;ESP8266WiFi.h&gt;
</code></pre>
