Imroy / pubsubclient

A client library for the ESP8266 that provides support for MQTT
MIT License
434 stars 115 forks source link

can't connect with String hostname #27

Closed marciogranzotto closed 4 years ago

marciogranzotto commented 9 years ago

I've set up a DDNS on my router and I'm tring to connect the ESP with your library using the constructor client(wclient, server) where server is a String with my hostname, Ex. "mybroker.ddns.net".

However this does not work.

Imroy commented 9 years ago

Hmm, I'm seeing this too. I'll see what I can find.

marciogranzotto commented 9 years ago

@Imroy maybe I could use the mDNS address of my broker (a raspberry pi), raspberrypi2.local, whould this work?

I'll try as soon as possible

marciogranzotto commented 9 years ago

Solved the problem declaring the hostname as a char array, not a string. (Ex.: char server[] = "mybroker,ddns.net")

However, I can't do the same with the mDNS/Bonjur address of my broker. Maybe a mDNS resolver is necessary?