/*
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_system.h"
#include "esp_wifi.h"
#include "driver/uart.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_event.h"
#include "esp_event_loop.h"
#include "mqtt_client.h"
#include "nvs_flash.h"
#define MQTT_HOST // MQTT服务端域名/IP地址
#define MQTT_PORT 1883 // 网络连接端口号
#define MQTT_CLIENT_ID // 官方例程中是"Device_ID" // 客户端标识符
#define MQTT_USER // MQTT用户名
#define MQTT_PASS // MQTT密码
#define STA_SSID // WIFI名称
#define STA_PASS // WIFI密码
TaskHandle_t wifi_Handle = NULL;
void wifi_Task(void *pvParameters);
static EventGroupHandle_t wifi_event_group;
const int WIFI_CONNECTED_BIT = BIT0;
static const char *TAG = "simple wifi";
static void mqtt_app_init(void);
char buf[4096];
static void delay_ms(uint16_t nms)
{
vTaskDelay(nms / portTICK_PERIOD_MS);
}
static e