Giter Site home page Giter Site logo

esp8266_mqtt_dc1's Introduction

ESP8266_MQTT_DC1

将斐讯DC1排插接入MQTT服务器

斐讯DC1智能排插,由于某些原因斐讯公司的服务器已经关闭,官方app已经无法再使用。排插失去远程控制的功能,所以价格也沦为普通排插的价格。但是可以通过自主搭建MQTT服务器实现远程控制。

  1. 低成本(40RMB)
  2. 可在线升级(OTA)
  3. 可查看电压、电流、功率
  4. 改造现成插座,简单,美观
  5. 间接有了智能台灯、智能风扇......
  6. APP远程控制:APP开发中 或 使用机智云平台

使用方法

  1. 搭建MQTT服务器
  2. clone 项目
  3. 修改 mqtt_config.h文件
    • MQTT_HOSTMQTT服务器域名或IP
    • MQTT_PORTMQTT服务器端口号
    • MQTT_USERMQTT用户名
    • MQTT_PASSMQTT密码
  4. 修改 Makefile 文件
    • 芯片型号带B为8Mbit SPI_SIZE_MAP?=2
    • 芯片型号不带B为16Mbit SPI_SIZE_MAP?=5
  5. 拆解DC1排插取出控制板
  6. 编译下载
    • 使用USB转TTL下载
    • 下载前请先拉低IO0(按下白色按键)
  7. 重新上电LED慢闪即固件刷入成功
  8. 将控制板安装回插排中(请将后盖盖好再插上电源)
  9. 长按总开关WIFI信号灯快闪进入配网模式
  10. 进行配网(ESPTouch、Airkiss)

使用说明

  1. 任意开关打开都会触发总开关
  2. USB的开关随总开关的状态
  3. LOGO灯即是总开关和USB的状态
  4. WIFI信号灯慢闪即正在连接WIFI
  5. WIFI信号灯快闪即进入配网模式
  6. WIFI信号灯常亮即成功连接WIFI
  7. 长按总开关进入配网模式,用于重新配网
  8. 每次配网自动保存,可共存两个WIFI信息

话题说明

  1. 定义文件mqtt_config.h
  2. %s即芯片的MAC
  3. 状态话题:/dc1/{mac}/status{0-3}
  4. 控制话题:/dc1/{mac}/control{0-3}
  5. 功率信息话题:/dc1/{mac}/power
  6. 电压信息话题:/dc1/{mac}/voltage
  7. 电流信息话题:/dc1/{mac}/current
  8. 遗嘱话题:/dc1/lwt/{mac}
  9. 出生话题:/dc1/birth/{mac}
  10. ota升级话题:/dc1/ota/{mac}

OAT升级说明

  • 使用ota升级话题发送升级文件获取地址
  • 消息格式{"url"="http://yourdomain.com:9001/ota/"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.