mosquitto

MQTT (Mosquitto) Connection pool?

青春壹個敷衍的年華 提交于 2020-01-06 20:24:15
问题 What would you suggest for Mosquitto connection pooling in Java? We are wasting (blocking) too much time on establishing each connection, so we think some kind of reuse would be better. 回答1: I'd suggest using the generic object pooling in the Apache commons tools https://commons.apache.org/proper/commons-pool/ But also you could extend Thread to instantiate a MQTT connection object on creation and have a persistent connection per thread. This could be combined with the built in thread pool in

MOsquitto unexpected disconnection

妖精的绣舞 提交于 2020-01-06 19:29:40
问题 I am using python mosquitto(paho) library. I got the problem of Unexpected disconnection. I found constantly dropping and connection with the server. . I am unable to find the problem. some times it shows [Error 104] connection reset by peer. I hosted my broker on amazon web services... my error is --- Connected to xx.xx.xx.xx:1883 Unexpected disconnection. Connected to xx.xx.xx.xx:1883 Unexpected disconnection. Connected to xx.xx.xx.xx:1883 I am passing QOS=2, retain = true, clean session

Facing Error while running mosquitto broker using TLS with mosquitto

时光怂恿深爱的人放手 提交于 2020-01-06 06:30:09
问题 I am trying to use TLS for communicating over mqtt. I have ubuntu installed in my system. For using TLS, I have created certificates using the below link: http://www.embedded101.com/Blogs/PaoloPatierno/entryid/366/mqtt-over-ssl-tls-with-the-m2mqtt-library-and-the-mosquitto-broker I am able to create certificates. I have removed bind_address from config file. I am starting mosquitto with the new config file with mosquitto -c mosquitto_m2mqtt.conf -v . Mosquitto starts, but when I run mosquitto

Mosquitto configuration not accepting listener containing IP address

主宰稳场 提交于 2020-01-05 06:39:10
问题 I have Mosquitto running on a local server, and my aim is to have 3 listeners: all local network clients to connect without TLS on port 1883 (port 1883 is closed by router to public) External clients to connect using TLS on port 8883 External client to connect without TLS on port 8880 which using this config works fine; # Local MQTT listener 1883 # End Local MQTT # Insecure MQTT listener 8880 # End Insecure MQTT # Secure MQTT listener 8883 ## This is standard and should always be this cafile

How do I write tests for an MQTT client?

天大地大妈咪最大 提交于 2020-01-04 07:25:12
问题 I'm new to MQTT and testing and am unsure how the two should work together. I'm using mqtt.js and want to write some basic tests. How should I structure them? More specifically, do I need to mock the MQTT broker, or can I make a live connection? Should that connection be to a test service like HiveMQ, etc, or to the broker I'm setting up myself? My setup: I'm building a chat application. 3 docker containers. 1 broker (using mosquitto, 2 clients. Clients are using mqtt.js within a script that

Request all published topics

你离开我真会死。 提交于 2020-01-03 16:35:34
问题 I'm using Mosquitto for my MQTT Broker. I was wondering if it would be possible to request all published topics? Thus NOT by subscribing to everything, i.e. # . EDIT: I don't want to subscribe to every available topic. I'm just looking for a way to retrieve all published topics. The broker could for instance response with a string array containing all the published topics. 回答1: Manageability of MQTT brokers is very immature at this point. I also don't know of a way to retrieve the list of

published message store by mosquitto broker when subscriber is offline with QOS=2

て烟熏妆下的殇ゞ 提交于 2020-01-02 19:25:10
问题 My both publisher and subscriber are both connected to mosquitto (paho) broker with QOS=2 and maintaining persistent session by clean_session=false. When i publish message with subscriber connected to broker, it successfully received by subscriber, now if I disconnect the subscriber , then again publish message and connect subscriber after, I will be able to retrieve message those messages when my subscriber was offline. My question is -- Is there any storage in the broker which stores all

Receive offline messages mqtt

穿精又带淫゛_ 提交于 2020-01-01 03:43:06
问题 I'm using mosquitto as broker and paho(python) as client. I'm trying to make subscriber to receive offline messages. For that I made following changes: Fixed client ID qos level 2 but, still the subscriber is not able to receive messages. any help? Thanks, Rahul 回答1: In order to have your client as a durable client and receive messages that were sent to topics when it was offline, you need to meet the following criteria: Fixed client ID (as you've done) Always connect with clean_session=False

Why is this MQTT client example failing?

让人想犯罪 __ 提交于 2019-12-25 06:17:27
问题 I am trying out MQTT for the first time using Python and the mosquitto library. My client program is below. I'm trying to use the public demo MQTT server at http://www.mqtt-dashboard.com/subscribe. However the client code is failing, see error below. Any ideas on what's going on? #!/usr/bin/env python import mosquitto client = mosquitto.Mosquitto("fredtest", clean_session=True) client.connect("broker.mqttdashboard.com", 1883) client.publish("fred.test", "hello world", 1) client.loop_forever()

Can't connect to localhost Mosquitto Broker with Javascript?

拟墨画扇 提交于 2019-12-25 02:47:27
问题 I have a raspberry pi with a Mosquitto Broker running on it connected to a sensor module with MQTT Protocol inbuilt. If I use this code in terminal, I can subscribe and see my data coming back. mosquitto_sub -h 169.254.118.199 -t Advantech/00D0C9FA9984/data When using a websocket method in my HTML/Javascript I can't make a connection. I am not 100% sure what port I need to specify, I have seen most posts using port 1883 but this doesn't seem to work. In terminal there is no port required.