mlesniew / PicoMQTT

ESP MQTT client and broker library
GNU Lesser General Public License v3.0
219 stars 25 forks source link

Server_Local_pubsub example #12

Closed Berjastein closed 11 months ago

Berjastein commented 1 year ago

Hi, i am trying Server_Local_pubsub example but is it not working?

I am trying to publish and subscribe on the same device, but the subscription does not work?

I am just using the example, only changed ssid and password nothing else?

mlesniew commented 1 year ago

As explained in the documentation:

PicoMQTT::Server will not deliver published messages locally. This means that if you set up a PicoMQTT::Server and use subscribe, your callback will only be called when messages from clients are received. Messages published on the same device will not trigger the callback.

This is not a bug, it's implemented like this on purpose.