In this section, we will build a project to enable an ESP32 board to work with mobile devices. We can create Wi-Fi services on an ESP32 board to allow mobile devices to perform tasks on ESP32, such as turning on a lamp and turning off a motor. Our scenario is described in Figure 9.1. For a mobile device platform, we use the Android application.
The way in which a smart mobile project works can be seen in the following diagram:
![](https://static.packt-cdn.com/products/9781789956870/graphics/assets/b1e2e95c-5584-4a78-82d8-36e78f7dabcf.png)
Figure 9.1: A general design for a smart mobile project
We can control three lamps with an ESP32 board through relay modules as shown in the preceding diagram. For a simple demonstration, we only use three LEDs for lamp simulation. We will expose three HTTP services: /ping, /state, and /lamp:
- The /ping HTTP request is used to perform an echo test.
- The /state HTTP request is used to obtain all the LED states that...