One of the fundamental components in setting up your DIY smart home or IoT project is to set-up the communication method between your devices and the server.
Given the most accessible wireless network to most of us is our home WiFi, I will be using the MQTT protocol to send messages over WiFi. The main server for this will be a Raspberry Pi and the devices (or clients) are ESP8266, ESP32 or similar devices