# fish-tank **Repository Path**: clibing/fish-tank ## Basic Information - **Project Name**: fish-tank - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 一、鱼缸 半自动的小型DIY鱼缸 ![](./doc/example/6.png) ### 二、功能实现 #### 功能介绍 * [x] 吸粪便等杂物 * [x] 夜间照明 * [x] 供氧 * [x] 太阳能供电 * [x] 绿植 * [x] 晒台 * [ ] 其他 #### 软件部分 * [ ] 自动配网 * [ ] 固件升级 * [x] mqtt-ssl通道 * [x] 指令下发 * [x] 温度、湿度上报 * [ ] 今日天气 #### 电路周围 ![](doc/CircuitDiagram.png) * [x] OLED 显示如下 + 基础电路 - GND: GND - VCC: 3.3v - SCL: GPIO 12 (NodeMCU D6) - SDA: GPIO 13 (NodeMCU D7) - RESET: GPIO 15 (NodeMCU D8) + 温度、湿度 + 水温 + 今日天气 + 当前运行状态(Running,Error) * [x] 温湿度模块 采集当前空气下的温度、湿度 * [x] 温敏电阻采集水温 * [ ] 摄像头采集照片(Esp8266不支持,内存太小,cpu频率低等原因) ### 三、整体实现 * 3.1 所需物品 * 3.2 效果图 ### 四、源码实现 * 4.1 物联控制端 ```plantuml @startuml title 设备启动初始化流程 start :加电; -> 3.3v; floating note left: ESP供电与设备供电隔离 :nvs初始化; if (condition 初始状态) then (yes) :初始化GPIO按键; :初始化OLED屏幕; :显示系统加载中Loading...; else (no) :显示系统异常LED; stop endif if (condition 按键是否按下) then (yes) : 检查按键持续时间; if (condition 大于10s) then (yes) : 进入配网流程; : 启动一个超时监听任务; if (condition 配置超过60秒) then (yes) :restart; end endif endif else (no) : 接入网络; if (condition 成功接入) then (yes) : 成功接入网络,并获取ip; : OLED显示当前ip地址; : 发送网络接入成功信号; : 等待网络接入正常后进行MQTT接入; if (condition 状态) then (yes) : 设置掉线遗言; : 订阅相关的主题; else (no) : 点亮系统异常; : OLED中显示详细的错误; : 启动超时重连任务; if (condition 配置超过60秒) then (yes) :restart; end endif endif else (no) : 点亮系统异常; : OLED中显示详细的错误; if (condition 配置超过60秒) then (yes) :restart; end endif endif endif :接收消息; while (condtion 消息类型) :根据消息处理} :打开LED照明] :打开排便水泵] :打开供氧] endwhile end @enduml ``` * 4.2 后台平台 * 4.3 相关资料 ### 五、参考 * [sdk](https://github.com/espressif/ESP8266_RTOS_SDK) * [document](https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/?badge=latest) * [PlantUML and Gitlab Support](https://blog.csdn.net/aixiaoyang168/article/details/76888254)