Hi
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.
*/
#define MQTTCLIENT_BAD_UTF8_STRING -5
The terminal log looks like so:
Starting rf95_server
Content of rf95_server.ini
project=ch_001659_2
dest_addr=tcp://192.168.1.65:1883
client_id=gs16
RF95 CS=GPIO25, IRQ=GPIO4, RST=GPIO17, LED=GPIO255 OK NodeID=1 @ 868.00MHz
Create MQTT client
Connect to MQTT broker on tcp://192.168.1.65:1883
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!
Christian
[Updated on: Sun, 24 May 2020 15:51]
Report message to a moderator