I have an Arduino Uno to which an ethernet shield is connected. I have installed pubsubclient in arduino to use MQTT protocol. The ipaddress given for the ethernet shield is
IPAddress ip(10, 0, 0, 2);
And the MAC is the default MAC address in the PubSubClient's mqtt_basic example
I have directly connected the ethernet cable to the ethernet port of raspberry pi 3. I have installed Mosquitto in Raspberry pi and it is running Raspbian Jessie.
The ipaddress configuration(/etc/dhcpcd.conf
) of Raspberry pi is
interface eth0
static ip_address=10.0.0.1/24
I cant ping the arduino from the raspberry. And when I am running the mqtt_basic example with the above details, the client doesn't connect and returns -2 as error.
I have checked the cable and it works and the cable is cross over.
What should I do to make this work?
P.S: I don't know where to post this question. Here or in raspberry stack exchange or in networkengineering stack exchange.
ifconfig eth0
and post the output. – Majenko Jul 28 '16 at 15:30