Processing math: 50%
1 Star 0 Fork 0

陈培俊/sky_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

mqtt2db

介绍

从mqtt接收数据,存储到db中

软件架构

软件架构说明

安装教程

  • pgadmin4安装
curl -fsSL https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/pgadmin4.gpg

sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/pgadmin4.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main"\
| sudo tee /etc/apt/sources.list.d/pgadmin4.list

sudo apt update && sudo apt install pgadmin4-web

/usr/pgadmin4/bin/setup-web.sh

访问 http://your_server_ip/pgadmin4

mqtt

主题级别

  • "/" 用于分割主题级别,并为主题名称提供层次结构。
  • 当订阅客户但指定的主题过滤器中遇到两个通配符中的任意一个时,分隔符的使用非常重要。
  • 级别分隔符可以出现在主题名称的任意位置。
  • 两个相邻的分隔符// 表示0长度的主题级别。

订阅通配符"#"

  • "#"匹配的是分隔符之后的任意级别,且包含父级
  • "#"只能是过滤器的最后一个字符 例如,如果客户端订阅“sport/tennis/player1/#”,它将收到使用这些主题名称发布的消息:
"sport/tennis/player1”
“sport/tennis/player1/rank”
“sport/tennis/player1/score/wimbledon”

sport/# 可以匹配 sport 主题,因为# 包括父级

单个的 # 也是有效的,这将收到服务端任何消息

sport/tennis/# 有效
sport/tennis# 无效
sport/tennis/#/ranking 无效

订阅通配符 "+"

  • "+" 表示单级别通配符,可以在过滤器中的任何级别使用,包括第一级和最后一级

例如:

"sport/tennis/+"

匹配

"sport/tennis/payler1" 和 "sport/tennis/payler2"

但是不匹配

“sport/tennis/player1/ranking”

由于单级通配符仅匹配单个级别,因此“sport/+”不匹配“sport”,但它匹配“sport/”

另外

单个 "+" 有效,匹配单级主题

“+/tennis/#” 有效

“sport+” 无效

“sport/+/player1” 有效

“/finace” 和 “+/+” 以及 “/+” 匹配,但是和 “+”不匹配

$开头的主题

服务器存储的主题名称不能以通配符(#或+)开头。

但是主题名称可以以开头的主题已经被广泛采用,作为包含服务器特性信息或控制API的前缀

非规范评论

  • 应用程序不能用$前缀做业务主题
  • 订阅“#”将不会收到任何发布到以 $ 开头的主题的消息
  • 订阅“+/monitor/Clients”将不会收到任何发布到“$SYS/monitor/Clients”的消息
  • 订阅“SYS/#”将收到发布到以“SYS/”开头的主题的消息
  • 订阅“SYS/monitor/+”将收到发布到“SYS/monitor/Clients”的消息
  • 为了让客户端接收来自以 SYS/ 开头的主题和不以 开头的主题的消息,它必须同时订阅“#”和“$SYS/#”
MIT License Copyright (c) 2025 陈培俊 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

AIOT back-end written in python 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pei-jun-chen/sky_python.git
git@gitee.com:pei-jun-chen/sky_python.git
pei-jun-chen
sky_python
sky_python
master

搜索帮助