Skip to main content
Arduino

Return to Question

Commonmark migration
Source Link

I'm using an arduino nano with an [ethernet shield][1]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 ? [1]: https://www.amazon.fr/diymore-Blindage-Ethernet-ENC28J60-Webserver/dp/B01LANEBAA/ref=sr_1_2_sspa

I'm using an arduino nano with an [ethernet shield][1] (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 ? [1]: https://www.amazon.fr/diymore-Blindage-Ethernet-ENC28J60-Webserver/dp/B01LANEBAA/ref=sr_1_2_sspa

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 ?

Source Link
Neil
  • 153
  • 1
  • 8

MQTT on nano with Ethernet shield not working

I'm using an arduino nano with an [ethernet shield][1] (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 ? [1]: https://www.amazon.fr/diymore-Blindage-Ethernet-ENC28J60-Webserver/dp/B01LANEBAA/ref=sr_1_2_sspa

AltStyle によって変換されたページ (->オリジナル) /