pubsubclient
pubsubclient copied to clipboard
publish() fails on ESP32
Hello :)
I am trying to migrate my ESP8266 firmware to the ESP32 platform. However, publishing messages does return false
when being called. Short topic and payload have been tested, and the client.connected()
function is being checked before the attempt. In line 599 of PubSubClient.cpp
, rc
always returns 0
. Taking a look at buf
here reveals, that it starts with 0x10 0x1D
and then the incomplete topic several times in a row (instead of Kueche/Schalter/1
it's Kueche/SchalteKueche/SchalteKueche/SchalteKueche/Schalte
something is really strange here. Has anybody seen anything like that before?
The example mqtt_esp8266 publishes and subscribes with no problems on ESP32.I had to change include <WiFi.h> instead of <ESP8266WiFi.h>. And change "%ld" to "%d" in a sprintf. And with a few more changes, the example works on a Giga R1 WiFi.