For questions regarding Eclipse Paho project, that provides open-source client implementations of MQTT and MQTT-SN messaging protocols aimed at applications for the IoT.
Questions tagged [paho]
22 questions
7
votes
1 answer
The MQTT Paho Python code doesn't work properly
This question is related to this one, I created the code below:
import paho.mqtt.client as mqtt
import time
import serial
# Open grbl serial port
s = serial.Serial('COM3',9600)
# Wake up grbl
s.write("\r\n\r\n")
time.sleep(2) # Wait for grbl to…
Balsam Qassem
- 693
- 4
- 11
6
votes
2 answers
MQTT subscribing is not working
I am working to connect my server to the clients via an MQTT broker. The MQTT client gets connected. But after publishing a message, the subscribe code receives a connection acknowledgment. The on_message() function never gets called.
I am stuck…
ron123456
- 423
- 4
- 12
6
votes
0 answers
Offline messages not being send to Adafruit IoT portal by Mosquitto broker
I have a Raspberry Pi in which I have installed Mosquitto broker and MQTT. Pi is connected to sensor and I need to send this data to Adafruit IoT protal. I am able to send all the data when the Pi is connected but when the Pi goes offline, I am…
S Andrew
- 161
- 1
- 3
6
votes
1 answer
MQTT packet validity check
Is there any tool to check my generated packets for being a valid MQTT (3.1.1) packet? Background: I'm using Paho embedded (MQTTPacket) on my microcontroller to generate packets to be send over my ethernet driver. But something seems to be wrong…
elasticman
- 221
- 1
- 5
5
votes
0 answers
Paho MQTT connect() fails ungracefully if internet connection not ready, can't trap the exception
My python script turns on the Raspberry Pi's WiFi and after a short delay tries to connect with Paho MQTT. If the delay isn't long enough, it fails ungracefully.
I'm using paho-mqtt version 1.4.1
EDIT: I've added the line that starts status_con =…
uhoh
- 225
- 4
- 12
5
votes
1 answer
MQTT messages hit queued or inflight limits, is it stated somewhere it's the oldest messages that are dropped?
I am learning MQTT in python and the protocol for QOS = 1 and 2. I'm concerned about my Raspberry Pi getting too bogged down, or if there are other unexpected problems at the server. I can see there are limits for queued and inflight messages as…
uhoh
- 225
- 4
- 12
4
votes
1 answer
How to process the MQTT queue once?
I am developing a helper app to clean the retained messages on my Mosquitto MQTT service. The problem I have is how to process the queue once with Paho MQTT.
I know how to
block the thread (loop_forever())
query the queue asynchronously…
WoJ
- 865
- 1
- 6
- 14
3
votes
1 answer
Unable to publish MQTT server in an infinite while loop in Python script
I'm curious to know what the performance of an MQTT server is like. So I created this Python script:
import time
import paho.mqtt.client as mqtt
from multiprocessing import Pool
def on_connect(client, userdata, flags, rc):
print("Connected…
learningtech
- 357
- 1
- 3
- 12
3
votes
1 answer
Questions about MQTT max message size
I am using MQTT Paho, and I have 2 questions about it:
How many words can I send as a payload message? For example, can I send all lines below as one payload?
O1000
T1 M6
(Linear / Feed - Absolute)
G0 G90 G40 G21 G17 G94 G80
G54 X-75 Y-75 S500 M3 …
Balsam Qassem
- 693
- 4
- 11
2
votes
0 answers
Paho MQTT Client - on_message callback never happens
I have a Mosquitto MQTT broker (mosquitto version 2.0.11) running on a Raspberry Pi.
It is publishing regular messages on a specific topic, which can be seen by running
$ mosquitto_sub -h 192.168.27.177 -d -t HouseMon -t notification
from another…
tim11g
- 121
- 1
2
votes
1 answer
Make connection between react native & raspberry & MQTT
I am currently making an IoT App that I'm trying to connect to a Raspberry Pi using MQTT. I use the react_native_mqtt package. The problem I have is that it doesn't connect. What I'm trying to achieve is to receive data from the rasp and use that…
Kindth
- 179
- 10
2
votes
2 answers
Python Paho MQTT 2.5 KB messages not sending for days, while 0.1 KB messages send fine
I've got powerful dual-core IoT gateways in the field with high-speed cellular modems and good internet connections, but they fail to send 2.5 KB MQTT messages to my AWS IoT message broker. My program sends messages of various sizes, and the 0.1 KB…
Sean McCarthy
- 123
- 5
2
votes
1 answer
Publish image data to MQTT not showing
I am trying to publish image data to MQTT (CloudMQTT) with following code, but the data is not appearing on MQTT, don't even see any data on MQTT broker.
import identity
import json
import paho.mqtt.client as mqtt
import time
import datetime
import…
rp346
- 175
- 6
1
vote
2 answers
Make connection in the background & closed app using MQTT
What is the proper way to show notifications of the message's received from mqtt when app is running in the background or when app is closed using react native.
So far I have achieved to show notifications when app is in the foreground using…
Kindth
- 179
- 10
1
vote
0 answers
Receiving MQTT publishes as files with paho
So far, I've been able to use a python script with the paho library to subscribe to a topic, and to write a single incoming message into a file. In this way, I've been able to send text files and 200kB jpg images over MQTT if the whole payload is…
Ivan Hu
- 11
- 1