GithubHelp home page GithubHelp logo

h-zhaohe / blufiesp32wechat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuhongv/blufiesp32wechat

0.0 0.0 0.0 2 MB

一款开源的蓝牙ble配网blufi乐鑫芯片esp32的开源微信小程序(持续维护,欢迎star)

JavaScript 100.00%

blufiesp32wechat's Introduction

BlufiEsp32WeChat
让微信小程序也可以配网设备

维护日志,版本修订;

修改时间 更新日志
2019.5.17 初次拟稿,完成配网,暂不开放
2019.11.30 首次开源
2019.12.4 去除全局配置文件,增加对外使用文档

一、简介

BlufiEsp32WeChat 是基于 微信小程序蓝牙配网设备 实现的开源仓库,致力开源国内互联网。

周所周知,目前市面上很多都是基于原生app做的配网,而在小程序实现和开源是极少的。本人参考官网示范,做了一个蓝牙配网demo,仅仅适合esp32。

二、如何集成

  • 1.首先把 《blufi》 这个配网核心库所需文件夹放在你的工程里面;
  • 2.为了方便,直接把 《images》下面的图片复制到自己到工程里面,以及把界面《bleConnect》也复制到自己到工程里面去;
  • 3.蓝牙搜索附近设备展示列表,自行处理;最后要传给界面《bleConnect》到参数只有四个:
参数 含义
deviceId 要连接的蓝牙设备的deviceId
ssid 要连接的路由器的名字
password 要连接的路由器的密码
callBackUri 自定义配网回调结果的界面(比如 /pages/index/index )
  • 4.比如这样:
wx.navigateTo({
  url: '/pages/blueConnect/index?deviceId=123456&ssid=TP-xx&password=12345678&callBackUri=/pages/index/index"
  })
  • 5.其中,当配网不管成功与否,都会带参数跳转到 callBackUri 这个定义的页面;参数名为 blufiResult 如下:
参数 含义
true 配网成功
false 配网失败
  • 6.比如这样处理:
    //生命周期函数--监听页面加载 
    onLoad: function (options) {
        var that = this;
        if (options.blufiResult){
          var result = options.blufiResult === 'ok' ? "配网成功" : "配网失败";
          wx.showToast({
            title: result,
            icon: 'none',
            duration: 2000
          });
        }
     }

三、本人开源 微信物联网控制 一览表

开源项目 地址 开源时间
微信小程序连接mqtt服务器,控制esp8266智能硬件 https://github.com/xuhongv/WeChatMiniEsp8266 2018.11
微信公众号airkiss配网以及近场发现在esp8266 rtos3.1 的实现 https://github.com/xuhongv/xLibEsp8266Rtos3.1AirKiss 2019.3
微信公众号airkiss配网以及近场发现在esp32 esp-idf 的实现 https://github.com/xuhongv/xLibEsp32IdfAirKiss 2019.9
微信小程序控制esp8266实现七彩效果项目源码 https://github.com/xuhongv/WCMiniColorSetForEsp8266 2019.9
微信小程序蓝牙配网blufi实现在esp32源码 https://github.com/xuhongv/BlufiEsp32WeChat 2019.11
微信小程序蓝牙ble控制esp32七彩灯效果 https://blog.csdn.net/xh870189248/article/details/101849759 2019.10
可商用的事件分发的微信小程序mqtt断线重连框架 https://blog.csdn.net/xh870189248/article/details/88718302 2019.2
微信小程序以 websocket 连接阿里云IOT物联网平台mqtt服务器 https://blog.csdn.net/xh870189248/article/details/91490697 2019.6
微信公众号网页实现连接mqtt服务器 https://blog.csdn.net/xh870189248/article/details/100738444 2019.9

四、讨论交流

QQ群号:434878850

本人微信公众号:徐宏blog

私人工作微信,添加标明来意

blufiesp32wechat's People

Contributors

xuhongv avatar

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.