user60829: I'm using an arduino nano with an ethernet shield (ENC28J60), and  ethernet eem to be working (I can create a webserver with Ethercard library).However, i'm stuck when i try to connect to a MQTT server.
I tried NanodeMQTT (stuck at waitforlink), Adafruit MQTT Library + Ethernet.h ( MQTT_connect() : Connection failed, endlessly retrying), PubSubClient + Ethernet.h (client.connect return 0) and some others.
At this point i am wondering if i am doing the right configuration each time:

when asked an ip, i set the static one i want for my arduino : 192.168.1.50
when asked an gwip, i set one of wy internet router : 192.168.1.254
when asked for a server, i set it to my mqtt server ipv4 : 192.168.1.185 (and port is 1883)
when asked for a mac adress, i keep the one in the example, or just write a random one

Do you know what can cause the ethernet.h or mqtt library to fail, but still ethercard is working fine ?

user60829: Thanks to Juraj pointing me that UIPEthernet is just a replacement for the Ethernet library, I finnally found this article Which works just fine.

60829: <p>I'm using an arduino nano with an <a href="https://www.amazon.fr/diymore-Blindage-Ethernet-ENC28J60-Webserver/dp/B01LANEBAA/ref=sr_1_2_sspa" rel="nofollow noreferrer">ethernet shield</a> (ENC28J60), and  ethernet eem to be working (I can create a webserver with <strong>Ethercard</strong> library).However, i'm stuck when i try to connect to a MQTT server.</p>
<p>I tried <strong>NanodeMQTT</strong> (stuck at waitforlink), <strong>Adafruit MQTT Library</strong> + Ethernet.h ( MQTT_connect() : Connection failed, endlessly retrying), <strong>PubSubClient</strong> + Ethernet.h (client.connect return 0) and some others.</p>
<p>At this point i am wondering if i am doing the right configuration each time:</p>
<blockquote>
<p>when asked an ip, i set the static one i want for my arduino : 192.168.1.50</p>
<p>when asked an gwip, i set one of wy internet router : 192.168.1.254</p>
<p>when asked for a server, i set it to my mqtt server ipv4 : 192.168.1.185 (and port is 1883)</p>
<p>when asked for a mac adress, i keep the one in the example, or just write a random one</p>
</blockquote>
<p>Do you know what can cause the ethernet.h or mqtt library to fail, but still ethercard is working fine ?</p>
 60829: <p>Thanks to Juraj pointing me that UIPEthernet is just a replacement for the Ethernet library, I finnally found <a href="https://www.instructables.com/id/A-Simple-MQTT-PubSub-Node-With-Arduino-UNO-and-ENC/" rel="nofollow noreferrer">this article</a> Which works just fine.</p>
