paho

Signing certificate by self signed CA

筅森魡賤 提交于 2020-01-25 07:52:07
问题 I have created selfsigned CA certificate on Ubuntu that runs on AWS . I have also created client and server certificates signed by current CA. SSL connection is used by Mosquitto MQTT service. Unfortunatly I have Received fatal alert: unknown_ca error from client side when it tries to connect to server. I was tested the same certificate generation procedure on my Raspberry Pi and SSL+MQTT works well. Creating certificates: # CA openssl req -new -newkey rsa:2048 -keyout private/cakey.pem -out

How to use the un-blocking method of MqttClient

拟墨画扇 提交于 2020-01-22 03:35:13
问题 When I try the below code to connect to the mosquitto broker, as you know, connecting to the broker might takes few seconds/minutes, and during that time when the button pressed to connect, it remains pressed till the connection established and when the connection established the button released back to its normal state. As far as I know, there are two way for connecting a client using paho java API , the blocking method and unblocking method . my question is, how to use the unblocking method

Saving MQTT data from subscribe topic on a text file

谁说我不能喝 提交于 2020-01-17 16:32:25
问题 I am setting up to receive MQTT data from a subscribed topic and I want to save the data in a text file. I have added the code to save the variable to a text file. However this doesn't work as it gives me just the variable and not the value of it i.e. doesn't give me the values of "on_message". Can someone please help me? Thanks My code is as follows: import paho.mqtt.client as mqttClient import time def on_connect(client, userdata, flags, rc): if rc == 0: print("Connected to broker") global

MQTT Creates Multiple connections when onCreate is called more than once

心不动则不痛 提交于 2020-01-15 10:02:27
问题 I am creating an instant messaging system using Paho Android MQTT Client. Its implementation works as expected, however I am facing these errors. I call the Connection Class ( This also calls for the creation of the connection to the broker) in the onCreate of the MainActivity Class . Now the problem is that, assuming I am on the MainActivity Class and I press back to move from the MainActivity Class to another activity, and I later come back to the MainActivity Class , another broker

MQTT Creates Multiple connections when onCreate is called more than once

本小妞迷上赌 提交于 2020-01-15 10:02:05
问题 I am creating an instant messaging system using Paho Android MQTT Client. Its implementation works as expected, however I am facing these errors. I call the Connection Class ( This also calls for the creation of the connection to the broker) in the onCreate of the MainActivity Class . Now the problem is that, assuming I am on the MainActivity Class and I press back to move from the MainActivity Class to another activity, and I later come back to the MainActivity Class , another broker

mqtt client gets disconnected frequently when running on multiple threads

旧街凉风 提交于 2020-01-11 13:47:14
问题 I have mosca mqtt broker runnning. I connect to it using paho-mqtt from a python client. I have two threads which I run parallely in my code, one to receive messages and the other to publish. def SendCommand(rpm,valve_opening): control_packet = { ######## } print(control_packet) print('sending command') # client.publish("cmd",control_packet) def on_connect(client, userdata, flags, rc): if rc==0: print("connected OK Returned code=",rc) client.subscribe('data/#') else: print("Bad connection

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

Is java client of PAHO proxy aware and enables sending of MQTT messages across enterprise proxy to brokers hosted in the internet?

六月ゝ 毕业季﹏ 提交于 2020-01-06 06:06:33
问题 Organization provides http proxy and https proxy. If not within enterprise network successfully establishing a secure connection (ssl://brokerhost:brokerport) 1.Passing relevant keystore and truststore 2.Setting default instance of SSLSocketFactory in MqttConnectOptions. 回答1: No, for native MQTT there is no way to use a HTTP/HTTPS proxy. You can not use a HTTP proxy to transport an arbitrary TCP based protocol. You need something like SOCKS (ssh can be used to to setup socks proxies or to do

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