mqtt

MQTT on Android: connection lost

£可爱£侵袭症+ 提交于 2019-12-21 21:38:45
问题 I'm trying to use an MQTT client on Android application but I cannot get it working. My MQTT client is 0.4.0 and my Android is 4.0.3. The app is very simple: it has an EditText and a button to publish the text. Further it has a TextView to show the received message. Every time is click on the "Publish" button, the "connection lost" message is shown, sometimes two or three times, as it tried to connect multiple times and then disconnected. Also, without clicking on the button, if I try to

Node-RED, IOT Foundation Out Node Not Sending Commands

放肆的年华 提交于 2019-12-21 20:34:02
问题 I have a Node-RED application that is bound to an IOT Foundation (iotf) service. I can receive events from devices and handle them appropriately. However, I am now interested in sending commands back to my devices and am having some problems. Nothing is showing up at the device, but by creating an IOTF in node, I can confirm that the command is passing through iotf. I can definitely get commands to pass through iotf using pure python, as the follow code works well: Client code: #!/usr/bin

Very slow network performance of Docker containers with host's network

烈酒焚心 提交于 2019-12-21 12:29:44
问题 I'm having a problem with sluggish network performance between Docker containers and host's network. I asked this question on the Docker's forum but have received no answers so far. Problem Set-up: two Macs on the same local network; the first runs an MQTT broker (mosquitto); the second runs Docker for Mac. Two C++ programs run on the second Mac and exchange data multiple times through the MQTT broker (on the first Mac), using the Paho MQTT C library. Native run: when I ran the two C++

using mqtt protocol with kafka as a message broker

核能气质少年 提交于 2019-12-21 04:52:10
问题 How can we use mqtt protocol with kafka as a message broker? The clients(android/ios/desktop java apps etc) will be producing and consuming messages using mqtt phao client side libraries which are available in different languages using kafka as a message broker. Any advice? 回答1: You can use a Kafka source connector which will stream data from an MQTT broker like Mosquitto into a Kafka cluster. See https://github.com/evokly/kafka-connect-mqtt The simplest way to run the connector is in

golang mqtt publish and subscribe

半腔热情 提交于 2019-12-21 04:41:02
问题 Does anybody know where I can get some example MQTT client Go (golang) code that does both publish and subscribe in an infinite loop ? I am messaging with a Mosquitto broker running on MacOs. In more detail... Get a message from the network (a topic) Compute something based on that message Send the result of the computation back to the network (topic) Here is the code I am using: package main import ( "fmt" MQTT "github.com/eclipse/paho.mqtt.golang" "os" "time" ) var knt int var f MQTT

如何使用 MQTT 报文实现发布订阅功能

别来无恙 提交于 2019-12-20 11:08:45
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> MQTT 协议通过交换预定义的MQTT控制报文来通信。下面以 MQTTX 为例,展示如何通过 MQTT 报文实现发布订阅功能。 Connect 连接 MQTT 协议基于 TCP/IP 协议,MQTT Broker 和 Client 都有需要有 TCP/IP 地址。 Broker 如果你暂时没有一个可用的 MQTT Broker, EMQ X 提供了一个公共 Broker 地址用于测试: broker.emqx.io:1883 。 Client MQTTX 工具中 Client 的配置其实是 MQTT 协议中 Connect 报文的配置,下面解释一下相关配置项: Client ID 服务端使用 ClientId 识别客户端。连接服务端的每个客户端都有唯一的 ClientId 。客户端和服务端都必须使用 ClientId 识别两者之间的 MQTT 会话相关的状态。 ClientId 必须存在,但是服务端可以允许客户端提供一个零字节的 ClientId,如果这样做了,服务端必须将这看作特殊情况并分配唯一的 ClientId 给那个客户端。然后正常处理这个 CONNECT 报文。 Username/Password MQTT 可以通过发送用户名和密码来进行相关的认证和授权,但是,如果此信息未加密

IoT request response protocol

丶灬走出姿态 提交于 2019-12-20 09:59:57
问题 We need to build a server that can communicate with some embedded devices running a variant of Android. We need to be able to send commands to the device, and receive a response. A simple command might be asking the device for it's status. We won't have HTTP, so we need to have the client/device establish a connection with the server. We were considering using MQTT as it has a lot of nice properties (QoS, lightweight, built for IoT), but it doesn't natively support a request response workflow

mqtt mosquitto linux connection limit

爱⌒轻易说出口 提交于 2019-12-20 09:55:38
问题 How are users getting past a 1024 connection limit in Linux in association with doing MQTT for push notification? I am using Mosquitto server, which I think I read does not have a 1024 connection limit built into the linux version. So, can I use a single server (no bridging etc) and get 5,000, 10,000+ users? Or, do I absolutely need bridging? I haven't seen a lot of writing on how this is setup other than the config settings man page for mosquitto. Or, can I get by with just modify a few

The most accurate timer qt C++

有些话、适合烂在心里 提交于 2019-12-20 08:07:16
问题 I use QTimer to send periodically 'Ping' packet to the server (MQTT client). But it timer is not absolutely accurate. After some time of working it has some delay and server broken connection. I try to use different Qt::TimerType, but it does not help. I need the most accurate timer. Do you have any ideas? Thank you! EDIT (Frederik solution) I have done something this: tthread.h class TThread : public QThread { Q_OBJECT void run(); public: explicit TThread(QObject *parent = 0); signals:

Python Paho MQTT: Unable to publish immediately in a function

ぐ巨炮叔叔 提交于 2019-12-20 03:13:57
问题 I am implementing a program that listen to a specific topic and react to it when a new message is published by my ESP8266. When a new message is received from ESP8266, my program will trigger the callback and perform a set of tasks. I am publishing two messages in my callback function back to the topic that the Arduino is listening. However, the messages are published only after the function exits. Thank you for all your time in advance. I have tried to use loop(1) with a timeout of 1 second