mosquitto

NodeMCU and ESP8266: slow mqtt publish

▼魔方 西西 提交于 2019-12-11 13:15:17
问题 I'm using esp8266 with the firmware produced with Marcel's NodeMCU custom builds http://frightanic.com/nodemcu-custom-build/ I tested the "dev" branch and the "master". I changed a little bit the " Connect to MQTT Broker " code found here https://github.com/nodemcu/nodemcu-firmware -- init mqtt client with keepalive timer 120sec m = mqtt.Client("clientid", 120, "user", "password") m:on("connect", function(con) print ("connected") end) m:on("offline", function(con) print ("offline") end) -- m

Connecting Mosquitto to the new Azure MQTT backend

假装没事ソ 提交于 2019-12-11 11:06:39
问题 Recently Microsoft Azure has added a MQTT backend to its' services. This service uses TLS do encrypt its traffic. I can't connect between Mosquitto and the Microsoft Azure Cloud. I downloaded the server certificate with echo -n | openssl s_client -connect mytarget.azure-devices.net:8883 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/test.cert And then tried to connect with mosquitto_sub mosquitto_sub -h mytarget.azure-devices.net -p 8883 -d -t devices/Device1/messages/events -i

Regarding the MQTT fixed header structure?

回眸只為那壹抹淺笑 提交于 2019-12-11 07:44:41
问题 i am trying to implement a MQTT library. And according to a tutorial, the fixed header of the MQTT message should look like as shown in the posted picture. Also in the same tutorial, i found that the encodeing method of the fixed header is written as: mqtt.write((byte) ((retain ? 1 : 0) | qos << 1 | (dup ? 1 : 0) << 3 | type << 4)); My Question is, according to the fixed header specifications posted, the fields retain , qos , dup and the msg type should have 1 , 2 , 1 and 4 bits respectively.

Getting AuthenticationException when connect M2Mqtt.MqttClient to Mosquitto broker with TLS

老子叫甜甜 提交于 2019-12-11 06:11:00
问题 I am new with MQTT protocol. When I searched for an MQTT server I found that Mosquitto broker is one of the most used one and therefore I have started using it. I have to develop an MQTT client on C#/.NET and I found only the M2Mqtt project and this C# MQTT client example. I managed to install Mosquitto broker on Windows 10 and change the access control list using topics. Using MqttClient I am able to connect to the broker with an username, subscribe to topics and publish them with the

nodejs to mosquitto raspberry pi pub sub not work

你说的曾经没有我的故事 提交于 2019-12-11 06:05:21
问题 Hi I am trying to sub and pub to mosquitto service runing on raspberry pi using Nodejs on my windows 10 but no thing happen on Rpi console here is my code var mqtt = require('mqtt'); var client = mqtt.connect('mqtt://192.168.10.97'); client.on('connect', function () { client.subscribe('presence'); client.publish('presence', 'Hello mqtt'); }); client.on('message', function (topic, message) { // message is Buffer console.log(message.toString()); client.end(); }); so my raspberry pi with ip 192

bridge local mosquitto to cloud broker

笑着哭i 提交于 2019-12-10 18:25:38
问题 I'm trying to bridge local mosquitto (on raspberry pi) to some cloud broker so I can send data and control some devices using that data. I tried with Cloudmqtt and dioty, but with no success. In case of cloudmqtt I've been told that everything is ok with mosquitto.conf file and for dioty I've been told that it uses Mosca broker which doesn't support bridging (with I've been told I refer to cloudmqtt and dioty support service). Does anybody knows some remote broker that can be bridged to local

mqtt on Laravel with PHP

▼魔方 西西 提交于 2019-12-10 11:53:06
问题 I'm using the MQTT on my raspberry and on my Ubuntu. I use terminal for start subscriber and publisher and it works so good. But now I want to create a website (using laravel) with this features. I googled it, but I don't find anything interesting. Is it possible to do and how? 回答1: Unlike with HTTP, MQTT is typically used by opening a long-running connection between an application process and a MQTT server. While it is perfectly possible to open a connection, publish a single message and

Mosquitto感知客户端上下线的方法

房东的猫 提交于 2019-12-10 04:20:51
国内最活跃的Mosquitto沟通社区,关于MQTT、Mosquitto、IM、推送系统、物联网、高并发处理等技术。 需要让设备上mqtt客户端配合来完成。 1、怎么知道设备下线? 异常断线(Mosquitto没有收到MQTT 的DISCONNECT报文)时,使用遗嘱机制,mqtt客户端在建立mqtt连接的时候,设置遗嘱(向什么topic发送什么数据):当前这个tcp连接断开的时候,Mosquitto自动按照遗嘱设置发送消息,这时利用这个机制,topic应用设定好,例如:iot/status/onoffline;所设置的遗嘱消息内容就是一个JSON字符串,里面包含当前连接的ID等信息,上线状态,例如: {"id":11232232432,//这个id就是当前设备的ID "status":"offline"//表示这是一个设备下线的通知; } 这样这个连接断开的时候(无论正常还是异常)谁订阅了这个topic就能收到这个消息. 正常断线(mqtt客户端主动发送了DISCONNECT报文)时,客户端要在发送DISCONNECT报文之前(及调用paho包的disconnect接口之前)主动向上下线topic发布一条设备下线的消息。 2、怎么知道设备上线? mqtt客户端在建立mqtt连接之后,无条件向某个topic(例如:iot/status/onoffline)发送一个消息

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