MaQiaTTo ESP32 Client
Environment Setup for ESP32
Get ESP32 Sample Code
- Before start, please follow this brilliant setup guide to make your environment ready with ESP32.
- Get MaQiaTTo sample codes via git or just download it as zip :
$ git clone https://github.com/cagdasdoner/maqiatto.git
- Navigate into the ESP32 sample directory :
Configuring the Device with your Credentials
$ cd esp32
- Navigate into sample code's directory.
- Type below command to set your configurations first :
$ make menuconfig
Running the Sample Code
- From the opened config menu screen, we will first configure our Wi-Fi credentials. To do that, select Example Connection Configuration like given below :
- Provide your SSID and Password into the opening screen :
- Save and exit.
- Jump into the MaQiaTTo MQTT Configuration tab to provide MQTT credentials of your user :
- You will be asked for your MQTT username, password and test topic. Provide them into the menu :
- Save and exit.
- Now your configuration is ready to connect to WiFi and MQTT Broker. Exit from the menuconfig to the console.
- Be sure that your ESP32 device is connected to your PC and type the below command both to compile and flash :
$ make flash
- After it succeeds, navigate to the monitor tool with below command to check your connection :
$ make monitor
- Device will start to run and connect to maqiatto.com. The logs will demonstrate the status of the connectivity like below :
I (3561) MaQiaTTo_MQTT_EXAMPLE: Other event id:7
I (3891) MQTT_CLIENT: Sending MQTT CONNECT message, type: 1, id: 0000
I (4091) MaQiaTTo_MQTT_EXAMPLE: MQTT_EVENT_CONNECTED
I (4301) MaQiaTTo_MQTT_EXAMPLE: MQTT_EVENT_SUBSCRIBED, msg_id=39314
I (4501) MaQiaTTo_MQTT_EXAMPLE: MQTT_EVENT_DATA
I (4711) MaQiaTTo_MQTT_EXAMPLE: MQTT_EVENT_PUBLISHED, msg_id=40675
I (4711) MaQiaTTo_MQTT_EXAMPLE: MQTT_EVENT_DATA
DATA=test data on esp32!