mqtt

MQTT学习笔记——MQTT协议体验 Mosquitto安装和使用

馋奶兔 提交于 2019-12-10 02:29:00
MQTT学习笔记——MQTT协议体验 Mosquitto安装和使用 标签: MQTT物联网Mosquitto 2014-09-13 16:30 27023人阅读 评论(15) 收藏 举报 分类: 物联网学习笔记(37) 版权声明:本文为博主原创文章,未经博主允许不得转载。 0 前言 MQTT是IBM开发的一个即时通讯协议。MQTT是面向M2M和物联网的连接协议,采用轻量级发布和订阅消息传输机制。Mosquitto是一款实现了 MQTT v3.1 协议的开源消息代理软件,提供轻量级的,支持发布/订阅的的消息推送模式,使设备对设备之间的短消息通信简单易用。 若初次接触MQTT协议,可先理解以下概念: 【MQTT协议特点】——相比于RESTful架构的物联网系统,MQTT协议借助消息推送功能,可以更好地实现远程控制。 【MQTT协议角色】——在RESTful架构的物联网系统,包含两个角色客户端和服务器端,而在MQTT协议中包括发布者,代理器(服务器)和订阅者。 【MQTT协议消息】——MQTT中的消息可理解为发布者和订阅者交换的内容(负载),这些消息包含具体的内容,可以被订阅者使用。 【MQTT协议主题】——MQTT中的主题可理解为相同类型或相似类型的消息集合。 1 安装和使用注意点 1.1 安装 截止2015年12月,最新版本为mosquitto-1.4.5 下载源代码包 wget

How can i connect a Java mqtt client with username and password to an emqttd(EMQ) broker?

半腔热情 提交于 2019-12-09 22:58:54
问题 I am able to subscribe to the mosquitto broker with this Java code, without username and password. Now, i would like to subscribe to an emqttd broker which requires some dummy username and password. How can i do this?. Thanks. http://tgrall.github.io/blog/2017/01/02/getting-started-with-mqtt/#disqus_thread https://github.com/emqtt/emqttd package com.mapr.demo.mqtt.simple; import org.eclipse.paho.client.mqttv3.MqttClient; import org.eclipse.paho.client.mqttv3.MqttException; public class

mqtt开源服务器 EMQX 使用指南

送分小仙女□ 提交于 2019-12-09 20:36:26
官网: https://docs.emqx.io/broker/v3/cn/getstarted.html#mqtt-clients 一、安装启动 # 各平台下载https://www.emqx.io/downloads/broker?osType=Linux # 解压(例子linux) , window RARunzip emqx-macosx-v3.2.0.zip && cd emqx # 启动emqx ./bin/emqx start # 检查运行状态 ./bin/emqx_ctl status # 停止emqx ./bin/emqx stop 二、进入后台管理 控制台地址: http://127.0.0.1:18083,默认用户名: admin,密码:public 来源: https://www.cnblogs.com/qinlongqiang/p/12013213.html

erlang,rabbitMQ,mqtt安装配置

ε祈祈猫儿з 提交于 2019-12-09 17:36:45
1、官网下载erlang,rabbitMQ软件。 推进地址: (1) http://www.erlang.org/downloads (2) http://www.rabbitmq.com/download.html 2、设置erlang的环境变量: ERLANG_HOME:C:\Program Files\erl9.0 %ERLANG_HOME%\bin; 加入到Path中。 windows键+R键,输入cmd,再输入erl,看到版本号就说明erlang安装成功了 3、安装完rabbitmq-server后,在sbin目录下,执行如下: (1)激活 RabbitMQ's Management Plugin(必须) (2)rabbitmq-plugins enable rabbitmq_mqtt (如果需要使用到MQTT) (3)rabbitmq-plugins list(查看激活的插件) 4 访问网址访问测试 http://localhost:15672 默认账号密码:guest/guest 5、注意 RabbitMQ 默认端口号 : 4369 (epmd), 25672 (Erlang distribution) 5672, 5671 (AMQP 0-9-1 without and with TLS) 15672 (if management plugin is enabled

Mqtt client using Moscapsule in Swift 3

旧巷老猫 提交于 2019-12-09 13:11:01
问题 Last month I was trying to use Mqtt for the 1st time in one of my app. As a beginner, it was very difficult for me to find out how and where to put sample codes that I found in various sources. After spending a week on my problem, I managed to make mqtt work in my project, so here I am to share what I learned steps by steps. This is not really a question (xD!) First of all, let give the credits to the developer(s) of Moscapsule. You can find more info and details on their github page. Okay,

Paho MQTT client connection reliability (reconnect on disconnection)

青春壹個敷衍的年華 提交于 2019-12-09 06:40:03
问题 What is the most reliable way to use the Python Paho MQTT client? I want to be able to handle connection interruptions due to WiFi drops and keep trying to reconnect until it's successful. What I have is the following, but are there any best practices I'm not adhering to? import argparse from time import sleep import paho.mqtt.client as mqtt SUB_TOPICS = ("topic/something", "topic/something_else") RECONNECT_DELAY_SECS = 2 def on_connect(client, userdata, flags, rc): print "Connected with

MQTT Library on Microcontroller

情到浓时终转凉″ 提交于 2019-12-09 06:09:48
问题 I want use MQtt Protocol as Messing protocol. I want to port the Mqtt Library on Microcontroller TMS470(Texas Instrument) with CCS Compiler. Since I am new to this Protocol, Can any body suggest me how use this protocol using the GPRS module. I made some study on MQtt. But i don't know how to start. After Opening the TCP/IP, how to publish or subscribe the data. Typically how to port the Library. And where i will get a library 回答1: You can use the Paho embedded client library: https://eclipse

Max MQTT connections

拟墨画扇 提交于 2019-12-09 06:02:56
问题 I have a need to create a server farm that can handle 5+ million connections, 5+ million topics (one per client), process 300k messages/sec. I tried to see what various message brokers were capable so I am currently using two RHEL EC2 instances (r3.4xlarge) to make lots of available resources. So you do not need to look it up, it has 16vCPU, 122GB RAM. I am nowhere near that limit in usage. I am unable to pass the 600k connections limit. Since there doesn't seem to be any O/S limitation

java.io.EOFException with paho

不羁岁月 提交于 2019-12-09 05:54:37
问题 i want to make stress test on mosquitto, so i create some code as below for (int i = 0; i < 800; i++) { final int j = i; Thread t = new Thread(new Runnable() { @Override public void run() { System.out.println(j + " : ************"); try { MqttClient client = new MqttClient("tcp://192.168.88.203", SERVER_CLIENTID_PREFIX + j); client.connect(); MqttMessage message = new MqttMessage((j + ":me").getBytes()); message.setQos(2); client.publish(TOPIC_PREFIX + j, message); } catch

Android device needs to be connected to server - C2DM, polling or something third?

我的梦境 提交于 2019-12-09 04:38:27
I'm currently in the process of developing an app which has some very demanding needs. The Project An application which can communicate with a server is needed. Small messages has to be send to the app which could display a notification or start an activity. The Demands Client needs to be sure that the phone is 'connected' at all times. The client expects that the app can tell when it's no longer connected (or able to connect) to the server it tells the user. Client needs to be able to send a message to individual devices If the client needs to broadcast a message to the connected devices and