mqtt

Local broker (MQTT) based Publish/Subscribe using Android Application

自古美人都是妖i 提交于 2019-12-12 19:20:06
问题 In my current project, I am using MQTT local broker based implementation and setup using this link. The local broker based MQTT implementation is working perfectly. At initially, I am using Node.js publisher and subscriber with this local broker to enable the exchange of messages and it works without internet connection also (as these devices are connected to the same network, mqtt API for local broker based implementation is like http://192.168.0.105 ). Now, I would like to replace Node.js

Restarting the mosquito broker

大憨熊 提交于 2019-12-12 07:59:12
问题 I have installed mosquito broker on my mac using brew install mosquitto . Normally I don't give any commands to start the mosquitto server. It is started automatically when I switch on my mac. I have verified that it is running by using the command ps -ef | grep mosquitto , which gives the following output 501 209 153 0 2:20PM ?? 0:06.93/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf 501 2559 1007 0 10:36AM ttys001 0:00.00 grep mosquitto 501 865 815 0 2:32PM

LNK2019 error when compiling a Visual C++ Win32 project with Eclipse Paho MQTT

本小妞迷上赌 提交于 2019-12-12 04:55:51
问题 I'm trying to build a Visual C++ Win32 project which uses the Eclipse Paho MQTT library - see https://eclipse.org/paho/clients/c/ The library takes the form of 2 files: paho-mqtt3c.lib paho-mqtt3c.dll The library is originally written in C - I've tried with the precompiled binary and when compiling it myself. In my client Visual C++ project, under the linker options, I've included the correct library path in the "Additional Library Directories" field and the paho-mqtt3c.lib file directly in

Mosquitto Error

僤鯓⒐⒋嵵緔 提交于 2019-12-12 04:03:59
问题 I am using Mosquitto for my project. I have installed mosquitto-1.4.8-install-win32.exe and also place the three binary in folder 1. pthreadVC2.dll 2. libeay32.dll 3. ssleay32.dll And reinstalled the mosquitto after that Started the services for mosquitto broker I entered following commands in cmd *C:\Users\ravindra-s>netstat -an Active Connections Proto Local Address Foreign Address State ... TCP 0.0.0.0:912 0.0.0.0:0 LISTENING TCP 0.0.0.0:1883 0.0.0.0:0 LISTENING TCP 0.0.0.0:2701 0.0.0.0:0

Paho Rabitmqq connection getting failed

会有一股神秘感。 提交于 2019-12-12 03:26:47
问题 Here is my paho client code // Create a client instance client = new Paho.MQTT.Client('127.0.0.1', 1883, "clientId"); // set callback handlers client.onConnectionLost = onConnectionLost; client.onMessageArrived = onMessageArrived; // connect the client client.connect({onSuccess:onConnect}); // called when the client connects function onConnect() { // Once a connection has been made, make a subscription and send a message. console.log("onConnect"); client.subscribe("/World"); message = new

How do I differentiate between MQTT Publish events originating from Users vs internal messages meant to broadcast only

十年热恋 提交于 2019-12-12 03:04:37
问题 I am using mosquitto mqtt client. For example, you have users that publish and subscribe to topics. The topic actually correlates to a REsT endpoint. Scenario 1 (typical pub/sub usage) UserA subscribes to topic /device/123/meta UserB publishes some data to topic /device/123/meta by definition, this publish is broadcasted out to the subscribers we have a script subscribed to /devices/# which knows how to save the payload for the topic /device/123/meta when it receives publish'ed data. This

Catch-up missed messages

夙愿已清 提交于 2019-12-12 02:58:22
问题 As far as my understanding goes, when a message is published to a topic, it is received by only the clients currently subscribed to that topic. If a client turns up after the message is published, it won't receive that message. Suppose a client is disconnected momentarily, is there a way to help the client catch-up with the messages missed when it is connected again? Thanks 回答1: If a client subscribes to a topic then the connection to the broker is dropped, the client will need to reconnect.

MQTT on ESP8266 with NodeMCU - problems with publishing

你。 提交于 2019-12-12 02:56:57
问题 I'm building a battery powered IoT device based on ESP8266 with NodeMCU. I use mqtt to periodically perform measurements and publish results. I know, that to allow network stack running, I should avoid tight loops and rely on callback functions. Therefore it seemed to me that the right organization of my measurement code should be: interval=60000000 function sleep_till_next_sample() node.dsleep(interval) end function close_after_sending() m:close() sleep_till_next_sample() end function

Verify that local mosquitto MQTT Broker is bridged to test.mosquitto.org

北战南征 提交于 2019-12-12 02:54:30
问题 I have a local (OSX 11) mosquitto broker (1.4.7) running with the following config: connection test address test.mosquitto.org topic in_topic in 0 topic out_topic out 0 try_private false notifications false bridge_attempt_unsubscribe true I got the conf settings form here: bridge local mosquitto to cloud broker (thanks) I now have 3 terminals. A : subscribed to test.mosquitto.org directly using a ruby script and ruby-mqtt . B : subscribed to local broker with mosquitto_sub -t in_topic C :

Proper MQTT subscription code that maintains persistence

不想你离开。 提交于 2019-12-12 02:47:20
问题 I am looking for a java code for MQTT client that subscribes to a given topic, every message published on that topic should reach the client only once.I have written many codes and in all the cases messages are delivered properly to the client when it is connected to the broker but if the subscribed client disconnects from the broker for some time and then again connects back, it does not receive the messages that were sent during the time that it was not connected and I have set the clean