1	/**
2	 * @file config.h
3	 * @brief 全局配置文件 - 五劳无感康养监测系统
4	 *
5	 * 协议版本: V0.08 (2026-07-17)
6	 * 包含: 硬件引脚定义、WiFi/MQTT 默认参数、
7	 *        雷达协议常量、告警阈值、任务配置等
8	 */
9
10	#ifndef CONFIG_H
11	#define CONFIG_H
12
13	#include <Arduino.h>
14
15	// ============================================================
16	// 1. 硬件引脚定义 (ESP32-S3)
17	// ============================================================
18
19	// --- 雷达型号选择 ---
20	#define RADAR_TYPE_ABD1       0   // R60ABD1: 心率/呼吸精准, 跌倒一般
21	#define RADAR_TYPE_AFD1       1   // R60AFD1: 跌倒/姿态精准, 无心率呼吸
22	#define RADAR_TYPE            RADAR_TYPE_ABD1  // ABD1 (心率/呼吸/睡眠)
23
24	// --- 毫米波雷达 ---
25	#define RADAR_UART_PORT       Serial2
26	#define RADAR_RX_PIN          17
27	#define RADAR_TX_PIN          1
28	#define RADAR_BAUD_RATE       115200
29
30	// --- 雷达备用 GPIO ---
31	#define RADAR_GPIO1_PIN       2             // 活跃/静止指示 (从10挪到2)
32	#define RADAR_GPIO2_PIN       11            // 有人/无人指示
33
34	// --- DHT11 温湿度传感器 ---
35	#define DHT11_PIN             4             // 温湿度传感器
36
37	// --- 水浸传感器 ---
38	#define WATER_SENSOR_PIN      45            // 数字输入, 低电平=有水
39
40	// --- 蜂鸣器 (PWM) ---
41	#define BUZZER_PIN            21
42	#define BUZZER_PWM_CHANNEL    0
43	#define BUZZER_PWM_FREQ       2000
44	#define BUZZER_PWM_RESOLUTION 8
45
46	// --- 配网按钮 ---
47	#define CONFIG_BUTTON_PIN     0             // 长按 3 秒复位 WiFi
48	#define BUTTON_LONG_PRESS_MS  3000
49
50	// --- 状态指示灯 ---
51	#define LED_WIFI_PIN          8             // 蓝色 - WiFi 状态
52	#define LED_ALARM_PIN         9             // 红色 - 报警指示
53
54	// --- OLED 显示屏 (SSD1306 128x64 I2C) ---
55	#define OLED_SDA_PIN          15            // I2C 数据线
56	#define OLED_SCL_PIN          16            // I2C 时钟线
57
58	// --- 交互按钮 ---
59	#define BTN_PROVISION_PIN     14            // 擦除WiFi配网按钮 (长按3秒)
60	#define BTN_ALARM_DISMISS_PIN 13            // 解除报警按钮
61	#define BTN_PAGE_SWITCH_PIN   46            // 翻页按钮
62	#define BTN_DEBOUNCE_MS       50            // 去抖时间
63	#define BTN_LONG_PRESS_MS     1500          // 长按判定
64
65	// ============================================================
66	// 2. 设备标识 (协议规范 §2)
67	// ============================================================
68
69	#define SALEID_DEFAULT        "10100001"    // 站点/系统编号
70	#define GATEID_DEFAULT        "10100001001" // 网关唯一编号
71	#define METER_ID_DEFAULT      "ENV001"      // 感知节点ID (卧室=ENV001, 卫生间=ENV002, 客厅=ENV003)
72	#define METER_NAME_DEFAULT    "RadarDHT11"  // 设备型号名称
73	#define FW_VERSION            "V1.0.0"
74
75	// ============================================================
76	// 3. WiFi 默认配置 (配网使用)
77	// ============================================================
78
79	#define WIFI_AP_SSID          "HealthMonitor-Setup"
80	#define WIFI_AP_PASSWORD      "1234567890"
81	#define WIFI_CONFIG_TIMEOUT   0   // 0=不超时, 一直等待配置
82	#define WIFI_CONNECT_TIMEOUT  15
83	#define WIFI_RETRY_INTERVAL   10000
84
85	// ============================================================
86	// 4. MQTT 默认配置 (协议规范 §2)
87	// ============================================================
88
89	#define MQTT_DEFAULT_SERVER   "202.110.234.102"
90	#define MQTT_DEFAULT_PORT     8000
91	#define MQTT_DEFAULT_PORT_STR "8000"         // WiFiManager 参数用字符串
92	#define MQTT_DEFAULT_USER     "test"
93	#define MQTT_DEFAULT_PASS     "testtest"
94	#define MQTT_DEFAULT_DEVICE   "10100001001"  // 默认网关ID = gateid
95	#define MQTT_DEFAULT_ENV      "主卧"           // 默认环境备注
96	#undef MQTT_KEEPALIVE
97	#define MQTT_KEEPALIVE        30              // 30秒 (协议规范)
98	#define MQTT_RECONNECT_MIN    1000
99	#define MQTT_RECONNECT_MAX    60000
100
101	// ============================================================
102	// 5. MQTT 主题定义 (协议规范 §3)
103	// ============================================================
104
105	// --- 上行主题 (设备 → 服务端) ---
106	#define MQTT_TOPIC_REPORT_ALLPOINTS   "report/allpoints"                // 全量遥测上报 QoS0
107	#define MQTT_TOPIC_STATUS_ONLINE      "status/%s/online"                // 上线通知 QoS1
108	#define MQTT_TOPIC_STATUS_OFFLINE     "status/%s/offline"               // 离线遗嘱 QoS1
109	#define MQTT_TOPIC_STATUS_PROVISION   "status/%s/provision"             // 配网状态 QoS1
110	#define MQTT_TOPIC_RESPONSE_CMD       "response/%s/cmd"                 // 指令响应 QoS1
111	#define MQTT_TOPIC_RESPONSE_PROVISION "response/%s/provision"           // 配网响应 QoS1
112
113	// --- 下行主题 (服务端 → 设备) ---
114	#define MQTT_TOPIC_CMD_ALARM          "cmd/%s/alarm"                    // 告警指令 QoS1
115	#define MQTT_TOPIC_CMD_ALARM_RESTORE  "cmd/%s/alarm/restore"            // 告警恢复 QoS1
116	#define MQTT_TOPIC_CMD_CONTROL        "cmd/%s/control"                  // 控制指令 QoS1
117	#define MQTT_TOPIC_CMD_PROVISION_WIFI "cmd/%s/provision/wifi"           // WiFi配网 QoS1
118
119	// ============================================================
120	// 6. 上报配置 (协议规范 §4.1, §7.2)
121	// ============================================================
122
123	#define REPORT_INTERVAL_MS    1000                // 遥测上报周期 1秒 (有人时)
124	#define REPORT_QOS            0                   // 遥测 QoS 0
125	#define PRESENCE_HEARTBEAT_MS 60000               // 无人心跳间隔 60秒 (4G省流量)
126	#define STATUS_QOS            1                   // 状态/响应 QoS 1
127
128	// ============================================================
129	// 7. 报警阈值 (协议规范 §6, 服务端判定用)
130	// ============================================================
131
132	#define HEART_RATE_MIN        50
133	#define HEART_RATE_MAX        120
134	#define BREATH_RATE_MIN       8
135	#define BREATH_RATE_MAX       24
136	#define TEMP_LOW              5.0f
137	#define TEMP_HIGH             45.0f
138	#define HUMI_LOW              15.0f
139	#define PRESENCE_HYSTERESIS   8   // 有人无人防抖 (PCB信号抖动时过滤)
140	#define HUMI_HIGH             90.0f
141	#define WATER_DEBOUNCE_MS     50
142
143	// ============================================================
144	// 8. 任务配置
145	// ============================================================
146
147	#define RADAR_TASK_STACK      4096
148	#define RADAR_TASK_PRIORITY   5
149	#define RADAR_TASK_CORE       0
150
151	#define MQTT_TASK_STACK       8192
152	#define MQTT_TASK_PRIORITY    4
153	#define MQTT_TASK_CORE        1
154
155	// ============================================================
156	// 9. NTP 时间同步
157	// ============================================================
158
159	#define NTP_SERVER            "ntp.aliyun.com"
160	#define NTP_GMT_OFFSET_SEC    28800             // UTC+8 (北京时间)
161	#define NTP_DAYLIGHT_OFFSET   0
162
163	// ============================================================
164	// 10. LittleFS 配置文件名
165	// ============================================================
166
167	#define CONFIG_FILE_MQTT      "/mqtt_config.json"
168	#define CONFIG_FILE_WIFI      "/wifi_config.json"
169	#define CONFIG_FILE_DEVICE    "/device_config.json"
170
171	// ============================================================
172	// 11. 结构体: 全量遥测数据 (协议规范 §4.1)
173	// ============================================================
174
175	struct TelemetryData {
176	    // --- 设备标识 ---
177	    char     saleid[12];          // 站点编号 (已弃用)
178	    char     gateid[16];          // 网关编号
179	    char     meterId[8];          // 节点ID (已弃用, 新用 gateid+后缀)
180	    char     meterName[16];       // 设备型号 "RadarDHT11"
181	    char     deviceType[16];      // 设备类型枚举 bedroom/bathroom/...
182
183	    // --- 环境数据 (DHT11) ---
184	    float    temp;                // 温度 ℃
185	    float    humi;                // 湿度 %RH
186	    bool     dhtValid;            // 温湿度有效性
187
188	    // --- 雷达: 存在/运动 ---
189	    bool     presence;            // 有人=1 无人=0
190	    bool     motion;              // 有运动=1 无运动=0
191	    bool     fall;                // 跌倒检测 1=触发
192	    bool     resident;            // 驻留状态 1=驻留
193
194	    // --- 雷达: 生命体征 ---
195	    uint8_t  heartRate;           // 心率 bpm (无效=0)
196	    uint8_t  breathRate;          // 呼吸 次/分 (无效=0)
197	    uint8_t  body;                // 人体能量/体征值
198	    uint8_t  sleepState;          // 睡眠状态 0=清醒 1=浅睡 2=深睡
199	    uint8_t  sleepScore;          // 睡眠评分 0~100
200	    bool     radarValid;          // 雷达数据有效性
201	    bool     vitalValid;          // 心率呼吸有效性
202
203	    // --- 水浸 ---
204	    bool     rainDO;              // 1=正常 0=水浸触发
205	    bool     rainValid;           // 水浸传感器有效性
206
207	    // --- 设备状态 ---
208	    bool     wifiReady;           // WiFi/MQTT 连接状态
209	    uint32_t uptimeSec;           // 设备累计运行秒数
210	    bool     buzzerState;         // 蜂鸣器状态 1=开启
211
212	    // --- 时间戳 ---
213	    uint32_t lastUpdate;          // 最后更新 ms
214	};
215
216	// 结构体: 下行报警指令 (协议规范 §5.1, §5.2)
217	struct AlarmCommand {
218	    char     cmdId[32];           // 指令唯一ID
219	    char     type[20];            // alarm / alarm_restore
220	    char     alarmType[24];       // fall/water_leak/heart_abnormal/breath_abnormal
221	    char     alarmLevel[8];       // low/medium/high
222	    char     alarmDesc[64];       // 告警描述
223	    char     meterId[8];          // 触发节点ID
224	    char     relatedCmdId[32];    // 关联原始告警ID (恢复用)
225
226	    // 联动动作
227	    bool     buzzerOn;            // 蜂鸣器开关
228	    uint16_t buzzerDuration;      // 蜂鸣持续秒数 (0=持续到恢复)
229	    bool     nightLight;          // 夜灯
230
231	    uint32_t timestamp;
232	};
233
234	// 结构体: 下行控制指令 (协议规范 §5.3)
235	struct ControlCommand {
236	    char     cmdId[32];
237	    char     type[20];            // control
238	    char     controlType[24];     // buzzer_test/device_restart/report_interval_set/factory_reset
239	    uint32_t params_duration;     // 参数: 持续秒数
240	    uint32_t params_interval;     // 参数: 上报间隔
241	    uint32_t timestamp;
242	};
243
244	// 结构体: 下行配网指令 (协议规范 §5.4)
245	struct ProvisionCommand {
246	    char     cmdId[32];
247	    char     wifi_ssid[33];
248	    char     wifi_password[65];
249	    char     wifi_encrypt[8];     // OPEN/WPA2/WPA3
250	    char     mqtt_broker[64];
251	    uint16_t mqtt_port;
252	    bool     mqtt_useTls;
253	    uint32_t timestamp;
254	};
255
256	#endif // CONFIG_H
257

/**
 * @file config.h
 * @brief 全局配置文件 - 五劳无感康养监测系统
 *
 * 协议版本: V0.08 (2026-07-17)
 * 包含: 硬件引脚定义、WiFi/MQTT 默认参数、
 *        雷达协议常量、告警阈值、任务配置等
 */

#ifndef CONFIG_H
#define CONFIG_H

#include <Arduino.h>

// ============================================================
// 1. 硬件引脚定义 (ESP32-S3)
// ============================================================

// --- 雷达型号选择 ---
#define RADAR_TYPE_ABD1       0   // R60ABD1: 心率/呼吸精准, 跌倒一般
#define RADAR_TYPE_AFD1       1   // R60AFD1: 跌倒/姿态精准, 无心率呼吸
#define RADAR_TYPE            RADAR_TYPE_ABD1  // ABD1 (心率/呼吸/睡眠)

// --- 毫米波雷达 ---
#define RADAR_UART_PORT       Serial2
#define RADAR_RX_PIN          17
#define RADAR_TX_PIN          1
#define RADAR_BAUD_RATE       115200

// --- 雷达备用 GPIO ---
#define RADAR_GPIO1_PIN       2             // 活跃/静止指示 (从10挪到2)
#define RADAR_GPIO2_PIN       11            // 有人/无人指示

// --- DHT11 温湿度传感器 ---
#define DHT11_PIN             4             // 温湿度传感器

// --- 水浸传感器 ---
#define WATER_SENSOR_PIN      45            // 数字输入, 低电平=有水

// --- 蜂鸣器 (PWM) ---
#define BUZZER_PIN            21
#define BUZZER_PWM_CHANNEL    0
#define BUZZER_PWM_FREQ       2000
#define BUZZER_PWM_RESOLUTION 8

// --- 配网按钮 ---
#define CONFIG_BUTTON_PIN     0             // 长按 3 秒复位 WiFi
#define BUTTON_LONG_PRESS_MS  3000

// --- 状态指示灯 ---
#define LED_WIFI_PIN          8             // 蓝色 - WiFi 状态
#define LED_ALARM_PIN         9             // 红色 - 报警指示

// --- OLED 显示屏 (SSD1306 128x64 I2C) ---
#define OLED_SDA_PIN          15            // I2C 数据线
#define OLED_SCL_PIN          16            // I2C 时钟线

// --- 交互按钮 ---
#define BTN_PROVISION_PIN     14            // 擦除WiFi配网按钮 (长按3秒)
#define BTN_ALARM_DISMISS_PIN 13            // 解除报警按钮
#define BTN_PAGE_SWITCH_PIN   46            // 翻页按钮
#define BTN_DEBOUNCE_MS       50            // 去抖时间
#define BTN_LONG_PRESS_MS     1500          // 长按判定

// ============================================================
// 2. 设备标识 (协议规范 §2)
// ============================================================

#define SALEID_DEFAULT        "10100001"    // 站点/系统编号
#define GATEID_DEFAULT        "10100001001" // 网关唯一编号
#define METER_ID_DEFAULT      "ENV001"      // 感知节点ID (卧室=ENV001, 卫生间=ENV002, 客厅=ENV003)
#define METER_NAME_DEFAULT    "RadarDHT11"  // 设备型号名称
#define FW_VERSION            "V1.0.0"

// ============================================================
// 3. WiFi 默认配置 (配网使用)
// ============================================================

#define WIFI_AP_SSID          "HealthMonitor-Setup"
#define WIFI_AP_PASSWORD      "1234567890"
#define WIFI_CONFIG_TIMEOUT   0   // 0=不超时, 一直等待配置
#define WIFI_CONNECT_TIMEOUT  15
#define WIFI_RETRY_INTERVAL   10000

// ============================================================
// 4. MQTT 默认配置 (协议规范 §2)
// ============================================================

#define MQTT_DEFAULT_SERVER   "202.110.234.102"
#define MQTT_DEFAULT_PORT     8000
#define MQTT_DEFAULT_PORT_STR "8000"         // WiFiManager 参数用字符串
#define MQTT_DEFAULT_USER     "test"
#define MQTT_DEFAULT_PASS     "testtest"
#define MQTT_DEFAULT_DEVICE   "10100001001"  // 默认网关ID = gateid
#define MQTT_DEFAULT_ENV      "主卧"           // 默认环境备注
#undef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE        30              // 30秒 (协议规范)
#define MQTT_RECONNECT_MIN    1000
#define MQTT_RECONNECT_MAX    60000

// ============================================================
// 5. MQTT 主题定义 (协议规范 §3)
// ============================================================

// --- 上行主题 (设备 → 服务端) ---
#define MQTT_TOPIC_REPORT_ALLPOINTS   "report/allpoints"                // 全量遥测上报 QoS0
#define MQTT_TOPIC_STATUS_ONLINE      "status/%s/online"                // 上线通知 QoS1
#define MQTT_TOPIC_STATUS_OFFLINE     "status/%s/offline"               // 离线遗嘱 QoS1
#define MQTT_TOPIC_STATUS_PROVISION   "status/%s/provision"             // 配网状态 QoS1
#define MQTT_TOPIC_RESPONSE_CMD       "response/%s/cmd"                 // 指令响应 QoS1
#define MQTT_TOPIC_RESPONSE_PROVISION "response/%s/provision"           // 配网响应 QoS1

// --- 下行主题 (服务端 → 设备) ---
#define MQTT_TOPIC_CMD_ALARM          "cmd/%s/alarm"                    // 告警指令 QoS1
#define MQTT_TOPIC_CMD_ALARM_RESTORE  "cmd/%s/alarm/restore"            // 告警恢复 QoS1
#define MQTT_TOPIC_CMD_CONTROL        "cmd/%s/control"                  // 控制指令 QoS1
#define MQTT_TOPIC_CMD_PROVISION_WIFI "cmd/%s/provision/wifi"           // WiFi配网 QoS1

// ============================================================
// 6. 上报配置 (协议规范 §4.1, §7.2)
// ============================================================

#define REPORT_INTERVAL_MS    1000                // 遥测上报周期 1秒 (有人时)
#define REPORT_QOS            0                   // 遥测 QoS 0
#define PRESENCE_HEARTBEAT_MS 60000               // 无人心跳间隔 60秒 (4G省流量)
#define STATUS_QOS            1                   // 状态/响应 QoS 1

// ============================================================
// 7. 报警阈值 (协议规范 §6, 服务端判定用)
// ============================================================

#define HEART_RATE_MIN        50
#define HEART_RATE_MAX        120
#define BREATH_RATE_MIN       8
#define BREATH_RATE_MAX       24
#define TEMP_LOW              5.0f
#define TEMP_HIGH             45.0f
#define HUMI_LOW              15.0f
#define PRESENCE_HYSTERESIS   8   // 有人无人防抖 (PCB信号抖动时过滤)
#define HUMI_HIGH             90.0f
#define WATER_DEBOUNCE_MS     50

// ============================================================
// 8. 任务配置
// ============================================================

#define RADAR_TASK_STACK      4096
#define RADAR_TASK_PRIORITY   5
#define RADAR_TASK_CORE       0

#define MQTT_TASK_STACK       8192
#define MQTT_TASK_PRIORITY    4
#define MQTT_TASK_CORE        1

// ============================================================
// 9. NTP 时间同步
// ============================================================

#define NTP_SERVER            "ntp.aliyun.com"
#define NTP_GMT_OFFSET_SEC    28800             // UTC+8 (北京时间)
#define NTP_DAYLIGHT_OFFSET   0

// ============================================================
// 10. LittleFS 配置文件名
// ============================================================

#define CONFIG_FILE_MQTT      "/mqtt_config.json"
#define CONFIG_FILE_WIFI      "/wifi_config.json"
#define CONFIG_FILE_DEVICE    "/device_config.json"

// ============================================================
// 11. 结构体: 全量遥测数据 (协议规范 §4.1)
// ============================================================

struct TelemetryData {
    // --- 设备标识 ---
    char     saleid[12];          // 站点编号 (已弃用)
    char     gateid[16];          // 网关编号
    char     meterId[8];          // 节点ID (已弃用, 新用 gateid+后缀)
    char     meterName[16];       // 设备型号 "RadarDHT11"
    char     deviceType[16];      // 设备类型枚举 bedroom/bathroom/...

    // --- 环境数据 (DHT11) ---
    float    temp;                // 温度 ℃
    float    humi;                // 湿度 %RH
    bool     dhtValid;            // 温湿度有效性

    // --- 雷达: 存在/运动 ---
    bool     presence;            // 有人=1 无人=0
    bool     motion;              // 有运动=1 无运动=0
    bool     fall;                // 跌倒检测 1=触发
    bool     resident;            // 驻留状态 1=驻留

    // --- 雷达: 生命体征 ---
    uint8_t  heartRate;           // 心率 bpm (无效=0)
    uint8_t  breathRate;          // 呼吸 次/分 (无效=0)
    uint8_t  body;                // 人体能量/体征值
    uint8_t  sleepState;          // 睡眠状态 0=清醒 1=浅睡 2=深睡
    uint8_t  sleepScore;          // 睡眠评分 0~100
    bool     radarValid;          // 雷达数据有效性
    bool     vitalValid;          // 心率呼吸有效性

    // --- 水浸 ---
    bool     rainDO;              // 1=正常 0=水浸触发
    bool     rainValid;           // 水浸传感器有效性

    // --- 设备状态 ---
    bool     wifiReady;           // WiFi/MQTT 连接状态
    uint32_t uptimeSec;           // 设备累计运行秒数
    bool     buzzerState;         // 蜂鸣器状态 1=开启

    // --- 时间戳 ---
    uint32_t lastUpdate;          // 最后更新 ms
};

// 结构体: 下行报警指令 (协议规范 §5.1, §5.2)
struct AlarmCommand {
    char     cmdId[32];           // 指令唯一ID
    char     type[20];            // alarm / alarm_restore
    char     alarmType[24];       // fall/water_leak/heart_abnormal/breath_abnormal
    char     alarmLevel[8];       // low/medium/high
    char     alarmDesc[64];       // 告警描述
    char     meterId[8];          // 触发节点ID
    char     relatedCmdId[32];    // 关联原始告警ID (恢复用)

    // 联动动作
    bool     buzzerOn;            // 蜂鸣器开关
    uint16_t buzzerDuration;      // 蜂鸣持续秒数 (0=持续到恢复)
    bool     nightLight;          // 夜灯

    uint32_t timestamp;
};

// 结构体: 下行控制指令 (协议规范 §5.3)
struct ControlCommand {
    char     cmdId[32];
    char     type[20];            // control
    char     controlType[24];     // buzzer_test/device_restart/report_interval_set/factory_reset
    uint32_t params_duration;     // 参数: 持续秒数
    uint32_t params_interval;     // 参数: 上报间隔
    uint32_t timestamp;
};

// 结构体: 下行配网指令 (协议规范 §5.4)
struct ProvisionCommand {
    char     cmdId[32];
    char     wifi_ssid[33];
    char     wifi_password[65];
    char     wifi_encrypt[8];     // OPEN/WPA2/WPA3
    char     mqtt_broker[64];
    uint16_t mqtt_port;
    bool     mqtt_useTls;
    uint32_t timestamp;
};

#endif // CONFIG_H


1	; PlatformIO Project Configuration File
2	; ESP32-S3 + R60ABD1 60G 毫米波雷达 健康监测系统
3
4	[env:esp32-s3-devkitc-1]
5	platform = espressif32
6	board = esp32-s3-devkitc-1
7	framework = arduino
8
9	; 串口监视器
10	monitor_speed = 115200
11	monitor_filters = direct
12	monitor_rts = 0
13	monitor_dtr = 0
14
15	; Flash 配置
16	board_build.flash_mode = qio
17	board_build.filesystem = littlefs
18	board_build.partitions = default_8MB.csv
19	board_build.arduino.memory_type = qio_opi
20
21	; 编译选项 - 优化速度
22	build_flags =
23	    -Os
24	    -DCORE_DEBUG_LEVEL=0
25	    -DARDUINO_USB_CDC_ON_BOOT=1
26	    -DBOARD_HAS_PSRAM
27
28	; 库依赖
29	lib_deps =
30	    ; MQTT 客户端
31	    knolleary/PubSubClient@^2.8
32
33	    ; JSON 解析 (更省内存)
34	    bblanchon/ArduinoJson@^7.1.0
35
36	    ; DHT11 温湿度传感器
37	    adafruit/DHT sensor library@^1.4.6
38	    adafruit/Adafruit Unified Sensor@^1.1.14
39
40	    ; OLED 显示屏 (SSD1306 128x64 I2C)
41	    olikraus/U8g2@^2.35.30
42
43	; 上传配置
44	upload_speed = 921600
45	upload_port = COM20
46

; PlatformIO Project Configuration File
; ESP32-S3 + R60ABD1 60G 毫米波雷达 健康监测系统

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

; 串口监视器
monitor_speed = 115200
monitor_filters = direct
monitor_rts = 0
monitor_dtr = 0

; Flash 配置
board_build.flash_mode = qio
board_build.filesystem = littlefs
board_build.partitions = default_8MB.csv
board_build.arduino.memory_type = qio_opi

; 编译选项 - 优化速度
build_flags =
    -Os
    -DCORE_DEBUG_LEVEL=0
    -DARDUINO_USB_CDC_ON_BOOT=1
    -DBOARD_HAS_PSRAM

; 库依赖
lib_deps =
    ; MQTT 客户端
    knolleary/PubSubClient@^2.8

    ; JSON 解析 (更省内存)
    bblanchon/ArduinoJson@^7.1.0

    ; DHT11 温湿度传感器
    adafruit/DHT sensor library@^1.4.6
    adafruit/Adafruit Unified Sensor@^1.1.14

    ; OLED 显示屏 (SSD1306 128x64 I2C)
    olikraus/U8g2@^2.35.30

; 上传配置
upload_speed = 921600
upload_port = COM20


The user wants to continue our previous chat. Unfortunately, the memory directory is empty and I don't have access to the previous conversation transcript. Let me look at the AI session files to see if I can find context about what was being discussed previously.

Let me check the most recent session transcript.


Let me check the most recent AI session for context about what we were discussing.