Git Product home page Git Product logo

esp_mesh_demo's Introduction

概述

本项目主要演示了esp32的ESP-MESH自组网功能,由官方参考示例Mesh Internal Communication修改而来。

现阶段实现的功能:

  • 智能配网。初次使用时,可以通过手机发送路由器wifi的ssid和密码给esp32,使之获得mesh组网需要的路由器信息。随后,相关信息会保存到nvs分区中,以后启动无需重新配置。
  • ESP-MESH自组网。多个esp32会根据配置的路由器信息自动连接并组成网络,当距离路由器过远而信号质量差时,会连接到周围的esp32节点以保证自己的网络质量。
  • mesh超时(暂定为2分钟)自动进入智能配网。
  • 通过sensorif接口可以接入多种传感器。每隔一段时间,会循环读取每个注册的传感器采集到的数据,并通过mesh网络发送到服务器端(没有编写服务器端程序,现在使用打印输出代替)。另外,也可以手动指定需要读取数据的传感器。

文件说明

  • main.c
    • esp32启动完成后,通过nvs存储的键值对信息,判断是要进行智能配网还是自组网。
    • 注册需要接入的传感器。
  • my_smartconfig.c
    • 智能配网部分的代码。智能配网完成后会将信息保存入nvs分区,并启动ESP-MESH。
  • my_mesh.c
    • ESP-MESH部分的代码。启动后,会创建mesh和sensorif任务。
    • mesh任务主要是接收sensorif任务发送的传感器数据并将其转发出去。以及给sensorif发送需要读取的传感器sid,读取对应的传感器数据。
  • my_sensorif.c
    • 在sensorif任务中,接收mesh任务发送的sid来调用对应的传感器的采集数据的函数。以及定时循环读取每个注册的传感器的数据并发送给mesh任务。

TODO

  • mesh超时自动进入智能配网。用户的路由器信息可能会更改(如修改wifi名称或密码等),这时候esp32无法连接到正确的路由器上并进行自组网。应该设定超时后打开智能配网功能,使用户可以重新配置路由器信息。
  • 手动进入智能配网功能。理由如上。
  • 尝试将设备接入云端,实现更多功能。

esp_mesh_demo's People

Contributors

maxiaowei0216 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.