6 votes
Accepted

MQTT packet validity check

The message above decoded: MQIsdp{03}{02}{00}{14}{00}{11}evolan_12345678900!{00}{06}evolanHello eevoLAN!à{00} It is mixed Ascii/Hex (topic, clientID and payload are plain ascii, special chars are {...
elasticman's user avatar
6 votes
Accepted

The MQTT Paho Python code doesn't work properly

Change the last line from client.start_loop() To client.loop_forever()
hardillb's user avatar
  • 12.6k
5 votes

Questions about MQTT max message size

First question: The payload of the message is limited to 268,435,456 bytes (256Mb) (see the Stack Overflow question What is the maximum message length for a MQTT broker?) Your second question doesn'...
hardillb's user avatar
  • 12.6k
4 votes
Accepted

How to process the MQTT queue once?

Retained messages will only be delivered once (per connection). And there can only be 1 retained message on a given topic at any one time. So just connect, start the loop and subscribe to the topics ...
hardillb's user avatar
  • 12.6k
4 votes
Accepted

MQTT messages hit queued or inflight limits, is it stated somewhere it's the oldest messages that are dropped?

The code that handles the max_queued_messages is here if self._max_queued_messages > 0 and len(self._out_messages) >= self._max_queued_messages: message.info.rc = MQTT_ERR_QUEUE_SIZE ...
hardillb's user avatar
  • 12.6k
3 votes
Accepted

How to cross compile Paho-MQTT-C library for ARM?

You are facing these build errors as you are missing the sysroot corresponding to the arm-gcc that you are using as your CC. You may try changing the Makefile as follows: diff --git a/Makefile b/...
sob's user avatar
  • 2,620
2 votes
Accepted

Make connection between react native & raspberry & MQTT

We solved this by edit the Mosquitto config file to either add a new listener port 8883 and to use the WebSocket protocol for that port. From Stack Overflow: Seting mosquitto broker to listen on two ...
Kindth's user avatar
  • 179
2 votes

Python Paho MQTT 2.5 KB messages not sending for days, while 0.1 KB messages send fine

There may be paths with a MTU of 1280 in the way. Try 1100 or 1200 and see if that fixes it. If not, try to find an MTU finder app to try to find the MTU to your destination from your source.
kalyanswaroop's user avatar
2 votes
Accepted

Python Paho MQTT 2.5 KB messages not sending for days, while 0.1 KB messages send fine

Based on what we've seen in the comments and edits, I think it might be worth setting a lower MTU for the cellular link. Try running something like the following: nmcli con mod "user_apn" ...
hardillb's user avatar
  • 12.6k
2 votes
Accepted

Python Paho MQTT doesn't work via LTE

The Paho Python library will work just fine via LTE. The library is built to interact with the OS's TCP/IP stack. It has no knowledge of the underlying hardware of how that TCP/IP stack talks to the ...
hardillb's user avatar
  • 12.6k
2 votes
Accepted

Unable to publish MQTT server in an infinite while loop in Python script

You should not be running long running (infinite loops) in the callbacks. All the callbacks run on the client network thread's main loop (the one started by client.loop_forever()). This means if the ...
hardillb's user avatar
  • 12.6k
2 votes
Accepted

Publish image data to MQTT not showing

This is because the message payload is way bigger than will fit into a single TCP packet so the problem is that you are not starting the Paho client network loop which will chunk the message up and ...
hardillb's user avatar
  • 12.6k
2 votes

Make connection in the background & closed app using MQTT

The only way to make sure notifications are shown is to use a server and the relevant platform’s push notifications. You’ll have a hard time keeping a process running, active, and connected in the ...
jcaron's user avatar
  • 2,283
1 vote

Make connection in the background & closed app using MQTT

I'll start with saying I've never worked with React or React Native. But you are going to need what Android calls a Background Service to run the MQTT client in so it can stay alive in the background. ...
hardillb's user avatar
  • 12.6k
1 vote
Accepted

How to handle the connection in MQTT using Paho

const client = new Paho.MQTT.Client(process.REACT_APP_HOST, Number(process.REACT_APP_PORT), clientID); client.onConnectionLost = this.onConnectionLost; client.onMessageArrived = this....
guitarpicva's user avatar
1 vote
Accepted

Determine state before publish

I suggest you store it in a local variable and then start a time which will time out after a period longer than the expected response time. If the local variable is set and the button is pressed again,...
hardillb's user avatar
  • 12.6k
1 vote

MQTT subscribing is not working

Just a flash from the past as I was trouble shooting this same issue, you need to have a unique name on the mqtt object created client = paho.Client("local_test") If you have multiple ...
user18242's user avatar
1 vote

MQTT subscribing is not working

As others have mentioned/implied in the comments: The actual sequence that is supposed to happen is: Setup your callbacks correctly first (including the on_message). Call connect. Wait until you get ...
kalyanswaroop's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible