pubsubclient icon indicating copy to clipboard operation
pubsubclient copied to clipboard

How to connect to an mqtt broker using hostname instead using the ip address?

Open riskico21 opened this issue 9 years ago • 3 comments

riskico21 avatar Apr 12 '16 14:04 riskico21

It's simple, do

WiFiClient espClient;
PubSubClient client(espClient, "server adress");

g-goessel avatar Apr 13 '16 21:04 g-goessel

Did it work for you? If so you can close the issue

g-goessel avatar Apr 22 '16 05:04 g-goessel

i'm so sorry for the late reply, i already tested your solution and i think it might be work. But in my case i want to use "ngrok" to tunnel my mqtt broker connection so that i can publish a message from anywhere over the internet. the string address called "tcp.ngrok.io" and i also already changed the port number on the PubSubClient.h but nothing happened

riskico21 avatar Apr 24 '16 16:04 riskico21