Hot answers tagged

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 {...
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()
user avatar
  • 12k
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'...
user avatar
  • 12k
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 ...
user avatar
  • 12k
4 votes

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 ...
user avatar
  • 12k
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/...
user avatar
  • 2,560
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 ...
user avatar
  • 167
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.
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" ...
user avatar
  • 12k
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 ...
user avatar
  • 12k
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 ...
user avatar
  • 12k
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 ...
user avatar
  • 12k
1 vote

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....
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,...
user avatar
  • 12k

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