To use the ESP8266 as a client for sending data to a broker you will need a library that offers MQTT support. For this you can use the PubSubClient library, which can be installed like other libraries; see Chapter 1, Getting Started with the ESP8266:
- Go to Sketch | Include Library | Manage Libraries..., as follows:
Manage libraries
- And search for the PubSubClient library and click Install as in the following screenshot: