Repository navigation
Releases: Mi-Bee-Studio/ai-thinker-esp32-cam
Release list
v0.2.0
MiBee Cam Firmware v0.2.0
Major update — Web UI restructuring, file manager, web-based OTA upgrades, and smart WiFi roaming.
New Features
File Manager Page
- New "Files" page showing all SD card files (photos + recordings)
- Type filter tabs: All / Photos / Recordings
- File type labels (green for photos, red for recordings)
- Download and delete files by type
Web UI Upgrade (SPIFFS OTA)
- New
POST /api/ota/spiffsendpoint - Upload SPIFFS image via web to update HTML/CSS/JS
- No serial cable needed for UI updates
- Auto erase, write, and reboot after upload
Firmware OTA Upgrade
- New
POST /api/ota/uploadendpoint - Upload firmware binary via web browser
- Progress bar display
- Auto partition switch and reboot after upload
- A/B partition scheme with rollback protection
Auto Firmware Versioning
- Version derived from git tags (
git describe --tags) - Format:
v1.2.3-4-gabcdef(tag-commits-hash) - Clean version number when proper tag is created
Smart WiFi Roaming
- Backup WiFi RSSI threshold configuration
- Auto-scan backup networks when signal drops below threshold
- Configurable signal gap to prevent frequent switching
- Roaming config API and Web UI controls
Configurable XCLK Frequency
- Camera clock frequency dropdown (10/16/20 MHz)
- 10 MHz mode for unstable OV2640 clone modules
- Resolves
NO-SOI(invalid JPEG) errors
Snapshot Fallback Mode
- Auto-switch to snapshot mode when MJPEG stream fails
- Timed captures for approximate real-time view
- Periodic attempts to recover MJPEG stream
Improvements
Navigation Restructured
- New order: Dashboard → Live Preview → Files → Settings
- "Photos" page renamed to "Files"
- "Config" page renamed to "Settings"
Settings Page Collapsible Sections
- All settings sections collapsed by default
- Click title to expand/collapse
- Firmware upgrade embedded in settings (no separate page)
Enhanced File List API
GET /api/filessupportstypeparameter (all/photos/recordings)- Boot-time file list cache for reliable access after camera init
- Resolves
opendir()hang caused by GPIO14 SPI conflict
Enhanced Download API
GET /api/downloadsupportstypeparameter (photo/recording)- Download recording files (AVI format)
Network Optimizations
- TCP buffer tuning for better stream stability on weak links
- Fixed stream starvation by reverting core pinning strategy
- WiFi TX power and power save config applied after boot
- Periodic reconnect to prevent network degradation
Recording Improvements
- Config FPS passed to frame broker
- Idle at 2fps when no stream clients to save resources
- Fixed
save_to_sdcheckbox state issue
Bug Fixes
- Fixed file list cache corruption after first query (tab characters not restored)
- Removed erroneous
xSemaphoreGiveinstorage_save_photo - Fixed
f_getfree()in storage cleanup causing GPIO14 SPI hang - Fixed stale HTML after firmware update (added Cache-Control header)
- Fixed config page save button silently failing due to missing comma
- Fixed serial config printf format error
- Fixed preview page reconnection logic
Build Improvements
- Optimized firmware size and IRAM usage to resolve linker overflow
- A/B OTA partition layout with rollback Kconfig
- Config version upgraded to V13 (XCLK) and V14 (roaming)
新功能
文件管理页
- 全新"文件"页面,显示 SD 卡所有文件(照片 + 录像)
- 类型筛选标签:全部 / 照片 / 录像
- 文件类型标签显示(绿色照片、红色录像)
- 支持按类型下载和删除文件
Web UI 升级(SPIFFS OTA)
- 新增
POST /api/ota/spiffs端点 - 通过网页上传 SPIFFS 镜像文件更新 Web 界面
- 无需串口即可更新 HTML/CSS/JS
- 上传后自动擦除、写入、重启
固件 OTA 升级
- 新增
POST /api/ota/upload端点 - 网页上传固件二进制文件
- 支持进度条显示
- 上传完成后自动切换分区并重启
- A/B 分区方案,支持回滚保护
固件版本自动管理
- 版本号从 git 标签自动生成(
git describe --tags) - 格式:
v1.2.3-4-gabcdef(标签-提交数-哈希) - 创建正式标签后显示干净版本号
智能 WiFi 漫游
- 新增备用 WiFi RSSI 阈值配置
- 信号低于阈值时自动扫描备用网络
- 可配置切换信号差值,避免频繁跳转
- 智能漫游配置 API 和 Web UI 控制
XCLK 频率可配置
- 新增摄像头时钟频率下拉选择(10/16/20 MHz)
- 10 MHz 模式兼容不稳定的 OV2640 克隆模块
- 解决
NO-SOI(无效 JPEG)错误
快照回退模式
- MJPEG 流连接失败时自动切换到截图模式
- 定时拍照显示近似实时画面
- 定期尝试恢复 MJPEG 流
改进
导航重构
- 新顺序:仪表盘 → 实时预览 → 文件 → 设置
- "照片"页更名为"文件"
- "配置"页更名为"设置"
设置页折叠面板
- 所有设置区域默认折叠,减少滚动
- 点击标题展开/收起
- 固件升级嵌入设置页(不再单独页面)
文件列表 API 增强
GET /api/files支持type参数(all/photos/recordings)- 开机时缓存文件列表,摄像头初始化后仍可查询
- 解决 GPIO14 SPI 冲突导致的
opendir()挂死问题
下载 API 增强
GET /api/download支持type参数(photo/recording)- 支持下载录像文件(AVI 格式)
网络优化
- TCP 缓冲区调优,改善弱网环境下的流稳定性
- 修复流饥饿问题,回退核心绑定策略
- WiFi TX 功率和省电模式配置在启动后应用
- 定期重连防止长时间运行后网络变慢
录像改进
- 配置的 FPS 参数传递到帧代理
- 无流客户端时降至 2fps 节省资源
- 修复
save_to_sd复选框状态问题
Bug 修复
- 修复文件列表缓存在首次查询后损坏的问题(tab 字符未恢复)
- 修复
storage_save_photo中多余的xSemaphoreGive - 修复存储清理中
f_getfree()导致 GPIO14 SPI 挂死 - 修复固件更新后浏览器缓存旧 HTML 的问题(添加 Cache-Control 头)
- 修复配置页面保存按钮因缺少逗号而静默失败
- 修复串口配置 printf 格式错误
- 修复流预览页重连逻辑
构建改进
- 优化固件体积和 IRAM 使用,解决链接器溢出
- A/B OTA 分区布局 + 回滚 Kconfig
- 配置版本升级到 V13(XCLK)和 V14(漫游)
Full Changelog: v0.1.0...v0.2.0
v0.1.0
MiBee Cam Firmware v0.1.0
Initial release — Professional-grade ESP32-CAM firmware with OV2640 streaming, motion detection, and REST API.
Features
Camera
- OV2640 sensor support, VGA/SVGA/XGA/UXGA resolution modes
- JPEG compressed output, adjustable quality (1-63)
- Vertical flip (vflip) support
- Capture retry logic for better reliability on weak connections
Video Streaming
- MJPEG real-time video streaming (async, non-blocking HTTP server)
- Up to 2 concurrent viewers
- Real-time FPS display
Motion Detection
- Frame difference algorithm with configurable threshold (1-100)
- Cooldown timer to prevent frequent triggers
- Smart flash control: JPEG-size based dark scene detection
- Auto LED flash trigger in low-light conditions
Timelapse
- Static timelapse: fixed interval capture
- Dynamic timelapse: exponential decay interval, adapts to scene changes
- Configurable capture interval (5s to 60min)
- Burst capture mode (1-10 frames)
Recording
- AVI video recording with 3 modes: continuous, timelapse, dynamic timelapse
- Segmented recording with automatic file splitting
- Smart frame dropping to reduce CPU load
SD Card Storage
- Auto-save photos to
/sdcard/photos/YYYY-MM/directories - Auto-save recordings to
/sdcard/recordings/YYYY-MM-DD/directories - Hot-plug detection
- Auto-cleanup: delete oldest recordings when usage exceeds threshold
- Photo list cache for reduced SD card access
WiFi Management
- STA mode: auto-reconnect, auto-retry on weak signal
- AP mode: first-time setup hotspot (SSID: MiBeeCam, Pass: 12345678)
- Dual WiFi failover: auto-switch to backup network on primary failure
- Configurable WiFi power save mode
- Periodic reconnect to prevent network degradation
Web Interface
- Dashboard: device status, camera, WiFi, storage, motion, memory, recording
- Live Preview: MJPEG stream, capture, record control, resolution/quality adjust
- Configuration: WiFi, camera, device, motion, timelapse, recording, storage cleanup
- File Manager: SD card file list, download, delete, pagination
- Setup Wizard: step-by-step WiFi configuration for first boot
REST API
/api/status— System status/api/config— Configuration read/write/api/files— File listing/api/download— File download/api/record— Recording control/api/flash— Flash LED control/api/timelapse— Timelapse control/api/motion— Motion detection control/api/storage— Storage info/capture— Single photo capture/stream— MJPEG video stream/metrics— Prometheus metrics
System
- 16-step boot sequence with strict initialization order
- NVS config persistence (version 13)
- Health monitor: periodic memory, WiFi, storage metrics collection
- Status LED indicator (GPIO33)
- SD card error logging
- ONVIF discovery and service (NVR compatible)
- Serial AT command configuration
功能特性
摄像头
- OV2640 传感器支持,VGA/SVGA/XGA/UXGA 四档分辨率
- JPEG 压缩输出,质量可调(1-63)
- 镜头上下翻转(vflip)
- 拍照重试逻辑,提高弱网环境成功率
视频流
- MJPEG 实时视频流(异步处理,不阻塞 HTTP 服务器)
- 最多 2 个客户端同时观看
- 实时帧率显示
运动检测
- 帧差算法,可配置检测阈值(1-100)
- 冷却时间设置,防止频繁触发
- 智能闪光控制:基于 JPEG 数据量的暗场景检测
- 暗场景自动触发 LED 闪光拍照
延时摄影
- 静态延时:固定间隔拍摄
- 动态延时:指数衰减间隔,自动适应场景变化
- 可配置拍摄间隔(5秒-60分钟)
- 运动连拍模式(1-10张)
录像功能
- AVI 视频录制,支持连续录像、延时录像、动态延时录像三种模式
- 分段录制,自动分割大文件
- 智能丢帧降低 CPU 负载
SD 卡存储
- 照片自动保存到
/sdcard/photos/YYYY-MM/目录 - 录像自动保存到
/sdcard/recordings/YYYY-MM-DD/目录 - 热插拔检测
- 存储清理策略:使用率超阈值自动删除旧录像
- 照片列表缓存,减少 SD 卡访问
WiFi 管理
- STA 模式:自动重连,信号弱时自动重连
- AP 模式:首次配置热点(SSID: MiBeeCam, 密码: 12345678)
- 双 WiFi 故障转移:主网络失败自动切换备用网络
- WiFi 省电模式可配置
- 定期重连防止长时间运行后网络变慢
Web 界面
- 仪表盘:设备状态、摄像头、WiFi、存储、运动检测、内存、录像状态
- 实时预览:MJPEG 流、拍照、录像控制、分辨率/质量调节
- 配置页面:WiFi、摄像头、设备、运动检测、延时拍摄、录像、存储清理
- 文件管理:SD 卡照片列表、下载、删除、分页浏览
- 设置向导:首次配置 WiFi 的分步引导
REST API
/api/status— 系统状态/api/config— 配置读写/api/files— 文件列表/api/download— 文件下载/api/record— 录像控制/api/flash— 闪光灯控制/api/timelapse— 延时拍摄控制/api/motion— 运动检测控制/api/storage— 存储信息/capture— 单张拍照/stream— MJPEG 视频流/metrics— Prometheus 指标
系统
- 16 步启动序列,严格初始化顺序
- NVS 配置持久化(版本 13)
- 健康监控:内存、WiFi、存储定期采集
- 状态 LED 指示(GPIO33)
- SD 卡日志记录
- ONVIF 发现和服务(NVR 兼容)
- 串口 AT 命令配置
Full Changelog: https://github.com/Mi-Bee-Studio/ai-thinker-esp32-cam/commits/v0.1.0