Unable to connect to Embedded MQTT

Hi,
I’m running Home Assistant 0.62.1
I enabled the mqtt broker adding
mqtt:
to my configuration.yaml file and a new icon appeared in developer tools next to info icon.

I wrote code for arduino that uses PubSubClient class to connect to MQTT broker.
I tested it with “broker.hivemq.com” with no user & password and I got it working.
After that I switchet to my “hassbian” server using homeassistant user and my API Password.
Unfortunately I can’t connect to the broker:
client.setServer( MQTT_Server, 1883 );
client.connect(“Power Client”, MQTT_USER, MQTT_PSW); => false
client.state() => -2

Any Idea? I wouldn’t want to install mosquitto

Here an update.
My arduino is connected to the same network so my hassbian’s ip is 192.168.1.11 while my arduino has 192.168.1.67.

Changing the server address from “hassbian” to my public one XXXXX.duckdns.org and adding portmappint for 1883 I got it working…

So I tried using the hassbian IP 192.168.1.11 and it works as well.

Now I don’t understand why arduino can’t get the ip from the DNS…
I pinged hassbian from my pc and I receive the right IP…

Local names resolution (non FQDN) is not standard DNS protocol, but other protocols like Avahi or Bonjour. Your PC has a fun networking stack that can use those protocols, but Arduino has a simplified stack doing only basic DNS queries.

tl;dr if a network call with a name doesn’t work always try with the IP address

Thanks!!! I didn’t know it