Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: georsyme on May 03, 2023, 12:17:55 PM

Title: Cannot Publish to MQTT Broker
Post by: georsyme on May 03, 2023, 12:17:55 PM
I am trying to establish a connection with an MQTT Broker(cloud mqtt) and send messages to a topic. I am using wifi Client(<WiFi.h>) and pubsubClient(<PubSubClient.h>). The code i am using has been tested in arduino uno and it works. Although with ESP32-EVB-IND cannot publish messages to the topic. My credentials and hardware connections are corect and tested lots of times. I am using standar mqtt protocol(not ssl). After client.connect() i print the client state and its MQTT_CONNECTED(0). I can see the connection established in my borker. But when i am trying to publish a message the state changes to MQTT_CONNECTION_LOST(-3). Any ideas?
Title: Re: Cannot Publish to MQTT Broker
Post by: LubOlimex on May 03, 2023, 02:41:31 PM
https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ARDUINO/ESP32_PoE_MQTT-Azure_ETH_WiFi

https://github.com/OLIMEX/ESP32-POE/issues/6