Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » How to handle MQTTCLIENT_BAD_UTF8_STRING error(How to handle MQTTCLIENT_BAD_UTF8_STRING error)
How to handle MQTTCLIENT_BAD_UTF8_STRING error [message #1827797] Sun, 24 May 2020 12:27
Christian Eugster is currently offline Christian EugsterFriend
Messages: 195
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
working on raspberry 3B+ I want to send an mqtt message with paho. The raspberry works as a gateway that collects sensor data in CayenneLPP format and transfers them to the mqtt broker on another host.
The program runs until it tries to publish the message to broker. Here I get error -5 that says:
 * Return code: An invalid UTF-8 string has been detected.

The terminal log looks like so:
Starting rf95_server
Content of rf95_server.ini

RF95 CS=GPIO25, IRQ=GPIO4, RST=GPIO17, LED=GPIO255 OK NodeID=1 @ 868.00MHz
Create MQTT client
Connect to MQTT broker on tcp://
Listening packet...
Packet[07] #255 => #255 -25dB:
 01 67 00 00 02 68 00
Publish failed: -5

rf95_server ending

How can I update the code, so that this error does no longer show up? Is it eventually the object buf that contains wrong value? If so how do I convert the buff to utf8? The buf comes from an arduino device. Maybe I have to solve this there, but how?
I uploaded the changed source file.
Thank you!

[Updated on: Sun, 24 May 2020 15:51]

Report message to a moderator

Previous Topic:memory access error
Next Topic:Less data has more sendover time
Goto Forum:

Current Time: Sun Oct 25 15:00:19 GMT 2020

Powered by FUDForum. Page generated in 0.05591 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top