Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By charlie
#56379 Hello,
I have a ESP8266 (ESP-12E) on a module that I got from ebay. It's this one:

http://www.ebay.com/itm/191607499973?_t ... EBIDX%3AIT

I can program with the Arduino IDE (1.6.11). I'm using the latest pubsubclient from Nick O'Leary (v2.4). I've updated my raspberry pi with the latest mosquitto. But the ESP8266 is having issues connecting to the MQTT broker. I get a return error code rc=-4.

I see that the ESP8266 has an IP address, and I can even ping it from my PC. I can publish/subscribe to Mosquitto on the Pi from my PC, so that part works. But the ESP8266 can never connect to the broker.

I'm tried loading the "Hello from ESP8266" webserver sketch, and that works. But MQTT refuses to work.

Are there any other things I'm missing? I've tried googling on MQTT issues and the most common one is not having updated Mosquitto.
User avatar
By bbx10node
#56399
The maximum message size, including header, is 128 bytes by default. This is configurable via MQTT_MAX_PACKET_SIZE in PubSubClient.h.

The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by changing value of MQTT_VERSION in PubSubClient.h.


I would try both of these. I think I currently have MQTT_MAX_PACKET_SIZE set to 256. Also check /var/log/mosquitto/mosquitto.log on the Pi for clues on the reason for the failures.