Giter Site home page Giter Site logo

esp8266_led's Introduction

Esp8266_Led

基于ESP8266芯片使用 EasyLinkerEasyLinkerApp 实现的物联网入门Demo

ESP8266(NodeMCU)代码基本来源于https://gitee.com/ilt/nodemcuesp8266mqtt_connection

一、刷入NodeMCU固件

可直接下载固件nodemcu-master-10-modules-2018-05-05-01-39-00-float.bin后进行刷入,也可以根据自己的需求去这里定制(注:qq邮箱收不到创建固件的邮件)。
下载好固件后使用nodemcu-flasher刷入。

  1. 配置参数,根据自己的ESP8266芯片进行相应的参数配置,具体查手册。

  2. 选择要刷入的固件。

  3. 将ESP8266设置为升级模式,点击FLASH进行刷入。刷入后遇到问难题参考这里

二、上传NodeMCU控制代码(代码注释参考这里

  1. 根据自己在EasyLinker 中的用户和设备修改config.config配置文件,如下:

    
     {
         "pwd":"你的wifi密码",
         "ssid":"你的wifi名称",
         "host":"服务器ip",
         "port":"emq监听端口,默认1883",
         "userId":"Easyliker里的用户ID",
         "groupId":"Easyliker里的设备所在群组的ID",
         "deviceId":"Easyliker里的设备的ID"
     }
     
  2. init.luaconfig.lua修改过后的config.configmqttd.lua四个文件通过ESPlorer上传到NodeMCU。

  3. 重启NodeMCU(重启后NodeMCU会自动加载init.lua文件)

  4. 使用EasyLinkerApp手机端向config.config文件中配置的设备发送控制指令,本例控制了GPIO2(Esp8266自带LED和开发板上的第三个LED)
    GPIO对应关系:

    指令发送:

效果如下图:

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.