Coder Social home page Coder Social logo

mqtt-flask's Introduction

Thanks

Froked from https://gitee.com/ouuleilei/mqtt-flask

mqtt-flask

介绍

一个Flask程序,给Mqtt服务提供对外的网络API接口。
项目支持打包,可以离线部署,请参阅Flask文档python文档

软件架构

软件架构说明

安装教程

  1. 克隆仓库
  2. 安装软件
sudo apt install python3-venv 
python3 -m venv .venv
. .venv/bin/activate
pip3 install -r requirements.txt
  1. 修改config.py配置文件
  2. 修改systemd配置文件gunicorn.service,然后移动至 /etc/systemd/system/ 下,
  3. 根据gunicorn.service内容创建日志文件
  4. 修改devicelist.json设备列表文件
  5. 运行systemd服务
sudo systemctl daemon-reload
sudo systemctl status  gunicorn.service

离线部署

  1. 克隆仓库
  2. 项目构建
python3 -m venv .venv
. .venv/bin/activate
pip3 install build
  1. 获取安装包
ls dist/
mqtt_flask-1.0.0-py3-none-any.whl  mqtt-flask-1.0.0.tar.gz
  1. 在新的环境下安装
tar xf mqtt-flask-1.0.0.tar.gz
cd mqtt-flask-1.0.0/
python3 -m venv .venv
. .venv/bin/activate
pip3 install ../mqtt_flask-1.0.0-py3-none-any.whl

使用说明

  1. 获取帮助信息
curl http://服务器IP:port/help
  1. 重启
curl http://服务器IP:port/reset/设备ID
  1. 获取设备列表
curl http://服务器IP:port/devicelist

mqtt-flask's People

Contributors

yuzibo avatar

Watchers

 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.