- #include <WiFi.h>#include <PubSubClient.h>#include <ArduinoJson.h>#include "esp_camera.h"#include <WiFiClient.h>// 设置摄像头分辨率#define CAMERA_MODEL_AI_THINKER#define PWDN_GPIO_NUM -1#define RESET_GPIO_NUM -1#define XCLK_GPIO_NUM 14#define SIOD_GPIO_NUM 26#define SIOC_GPIO_NUM 27#define Y9_GPIO_NUM 35#define Y8_GPIO_NUM 34#define Y7_GPIO_NUM 39#define Y6_GPIO_NUM 36#define Y5_GPIO_NUM 21#define Y4_GPIO_NUM 19#define Y3_GPIO_NUM 18#define Y2_GPIO_NUM 5#define VSYNC_GPIO_NUM 25#define HREF_GPIO_NUM 23#define PCLK_GPIO_NUM 22#define LED_GPIO_NUM 4// 定义WiFi名称和密码,以及MQTT服务器地址和端口const char* ssid = "your_wifi_ssid";const char* password = "your_wifi_password";const char* mqtt_server = "mqtt_server_address";const int mqtt_port = 1883;// 定义MQTT主题名称char msg_topic[50] = "camera/data";// 初始化WiFi和MQTT客户端WiFiClient espClient;PubSubClient client
用c知道编写的esp32 cam摄像头发送数据到mqtt的程序
最新推荐文章于 2024-07-18 20:01:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)