mqtt

How to Sign ssl on server

怎甘沉沦 提交于 2020-02-07 00:00:35
问题 I am using mosquitto broker server. I have enabled ssl as instructed here: http://www.steves-internet-guide.com/mosquitto-tls/ But this is self signed certificate. I have only read about adding ssl to websites. How do I add ssl to a mosquitto server so that it can be accessed from sites on https. Should I buy a certificate from a CA and then follow the steps given in the link? I don't know how I would add ssl to a server 回答1: Assuming you want your site to be used be anybody and not just

emq(v3.1.1)关闭MQTT客户端匿名认证

自闭症网瘾萝莉.ら 提交于 2020-02-06 19:09:59
本文前提是正确下载并且开启emqx,我的版本是3.1.1,不保证其它版本可用 实现了关闭MQTT客户端匿名认证并且添加了一个用户/ 以下是正文: 一 关闭匿名认证 emq安装时,默认开启了匿名认证,也就是说客户端不需要用户名和密码只需要IP和端口就可以发布或者订阅主题,所以我们的第一步就是关闭匿名认证。 1 进入emq安装目录下/etc文件夹(我安装在用户目录下),打开emqx.conf文件 cd ~/emq/etc/vim emqx.conf 2 按/键进入搜索模式,搜索关键字anonymous,找到这一行: allow_anonymous = true(我这边是410行) 将true改为false,保存,退出,就关闭了匿名认证. 二 添加Username插件 emqx_auth_username 1 bin目录下执行下面命令,开始emq_auth_username插件 root@iZ2zehkmdztgqr75kcpdjhZ:~/emqx/bin# ./emqx_ctl plugins load emqx_auth_username 成功的返回: 2 执行下面命令,添加一个用户名和密码 ./emqx_ctl users add test 123456 这样就开启了用户认证了,算是进一步加强了安全性! Enjoy It! 来源: https://www.cnblogs.com

MQTT

谁说胖子不能爱 提交于 2020-02-04 05:01:43
MQTT [1] 消息队列遥测传输 (Message Queuing Telemetry Transport) subscribe to a topic and publish messages on that topic. The core of the client library is the client class which provides all of the functions to publish messages and subscribe to topics . Main Client Methods The paho mqtt client class has several methods.The main ones are: connect() and disconnect() subscribe() and unsubscribe() publish() Each of these methods is associated with a callback. 1. create a client instance client = paho.mqtt.client(client_name) 2. connect to a broker or server Before you can publish messages or subscribe to

M5311接入onenet(MQTT方式)

独自空忆成欢 提交于 2020-02-01 19:47:54
相关的AT指令 AT指令 功能 备注################## AT+MQTTCFG=“183.230.40.39”,6002,“设备ID”,120,“产品ID”,“APIKEY”,1 MQTT client 参数配置 APIKEY需要在设备详情页面添加 AT+MQTTOPEN=1,1,0,0,0,"","" 发送连接建立请求 AT+MQTTPUB=$dp,0,1,0,28, 0300197b2261223a392c2262223a392c2263223a392c2264223a397d 上传数据 28为发送数据长度, 数据中:03指明数据为json格式, 0019为json字符串内容长度, 其后为json字串的hex格式 AT+MQTTDISC 断开连接 AT+MQTTDEL 释放资源 具体参数可参考M5311关于MQTT的AT手册。 来源: CSDN 作者: 依古·比古 链接: https://blog.csdn.net/qq_44370363/article/details/104136201

MQTT基础

南笙酒味 提交于 2020-01-31 00:42:58
MQTT拥有14种不同的消息类型: CONNECT:客户端连接到MQTT代理 CONNACK:连接确认 PUBLISH:新发布消息 PUBACK:新发布消息确认,是QoS 1给PUBLISH消息的回复 PUBREC:QoS 2消息流的第一部分,表示消息发布已记录 PUBREL:QoS 2消息流的第二部分,表示消息发布已释放 PUBCOMP:QoS 2消息流的第三部分,表示消息发布完成 SUBSCRIBE:客户端订阅某个主题 SUBACK:对于SUBSCRIBE消息的确认 UNSUBSCRIBE:客户端终止订阅的消息 UNSUBACK:对于UNSUBSCRIBE消息的确认 PINGREQ:心跳 PINGRESP:确认心跳 DISCONNECT:客户端终止连接前优雅地通知MQTT代理 来源: CSDN 作者: LittleAshes 链接: https://blog.csdn.net/weixin_41746317/article/details/104118484

TCP/IP, WebSocket 和 MQTT

帅比萌擦擦* 提交于 2020-01-29 04:20:59
按照OSI网络分层模型,IP是网络层协议,TCP是传输层协议,而HTTP和MQTT是应用层的协议。在这三者之间, TCP是HTTP和MQTT底层的协议。大家对HTTP很熟悉,这里简要介绍下MQTT。MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,有可能成为物联网的重要组成部分。该协议支持所有平台,几乎可以把所有联网物品和外部连接起来,被用来当做传感器的通信协议。 HTTP的不足 HTTP协议经过多年的使用,发现了一些不足,主要是性能方面的,包括: HTTP的连接问题,HTTP客户端和服务器之间的交互是采用请求/应答模式,在客户端请求时,会建立一个HTTP连接,然后发送请求消息,服务端给出应答消息,然后连接就关闭了。(后来的HTTP1.1支持持久连接) 因为TCP连接的建立过程是有开销的,如果使用了SSL/TLS开销就更大。 在浏览器里,一个网页包含许多资源,包括HTML,CSS,JavaScript,图片等等,这样在加载一个网页时要同时打开连接到同一服务器的多个连接。 HTTP消息头问题,现在的客户端会发送大量的HTTP消息头,由于一个网页可能需要50-100个请求,就会有相当大的消息头的数据量。 HTTP通信方式问题,HTTP的请求/应答方式的会话都是客户端发起的,缺乏服务器通知客户端的机制

A call to SSPI failed, see inner exception paho m2mqtt Dot.Net(c#) client SSL/TLS connection

痴心易碎 提交于 2020-01-25 21:46:13
问题 I am trying to connect with mosquitto broker using m2mqtt c# client version 4.3.0 library via SSL/TLS. Below is the code I have tried static void Main(string[] args) { // create client instance MqttClient client = new MqttClient(IPAddress.Parse("127.0.0.1"), 8883, true, new X509Certificate2("C:\\Users\\hp\\Desktop\\certificate\\ca.crt"), new X509Certificate2("C:\\Users\\hp\\Desktop\\certificate\\client.crt"), MqttSslProtocols.TLSv1_2); // register to message received client

MQTT qos parameter has no effect

五迷三道 提交于 2020-01-25 11:57:07
问题 I have installed a mosquitto server on a raspberry server. This server works fine: I have test with mosquitto_sub and mosquitto_pub commands. I have write this python script: import paho.mqtt.client as mqtt import time client = mqtt.Client('module_test_4') client.connect('127.0.0.1', 1883, 10) client.loop_start() for i in range(10): client.publish('topic_2', "valeur %d" % i, qos=0) time.sleep(1) client.loop_stop() client.disconnect() I have launched this script twice on 2 consoles: mosquitto

在Windows下使用MQTT

笑着哭i 提交于 2020-01-23 22:48:51
在此处https://mosquitto.org/download/下载mqtt windows broker。 安装完毕后在服务中 启动mqtt服务。 如果未在服务列表中出现,则需要 C:\Program Files\mosquitto\mosquitto install C:\Program Files\mosquitto\mosquitto uninstall 这两条命令用来安装和卸载mqtt服务。 密码配置 在mosquitto目录下新建一个password.file文件,输入命令 注意,如果需要增加多个密码,需要去掉-c参数 https://www.cnblogs.com/saryli/p/9820532.html .\mosquitto_passwd -c G:\MQTT_SERVER\mosquitto sammy 根据提示输入密码 修改mosquitto.conf文件 改为 allow_anonymous false password_file G:\MQTT_SERVER\mosquitto\password.file 到此,配置完成。 注意:不用配置ip地址和端口信息,就可以用内网ip地址链接到此mqtt服务器。 来源: CSDN 作者: link2dream 链接: https://blog.csdn.net/xuancuocui1413/article

MQTT服务器-emqx安装

主宰稳场 提交于 2020-01-23 08:30:29
MQTT服务器-emqx安装 1、windows (1)、打开官网https://www.emqx.io/cn/downloads 点击下载(这是我所选择的一个版本) (2)、装解压EMQ, 1、把下载的EMQ解压到D盘,得到一个emqx文件夹 2、至官网下载对应版本的LICENSE,具体操作见下载处提示 3、Win10 系统的 【开始】 【右键】 进入win10 系统的 【Windows PowerShell(管理员)】 4、进入 命令: cd D:\emqx\bin 5、在根目录下的bin目录中 执行命令./emqx install 6、接着执行命令 ./emqx start 7、启动后即可访问 localhost:18083 进入登入页面 默认用户名:admin,密码:public 2、Linux(Ubuntu) 来源: CSDN 作者: 啸卿 链接: https://blog.csdn.net/Mr_robot_strange/article/details/103881635