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.

share|improve this question
    
Fixed IP or use DHCP? Seems to be a mix? – Mikael Patel Jul 28 '16 at 12:46
    
Fixed IP. I set static IP in raspberry(10.0.0.1). And I provided the IP in the arduino too(10.0.0.2). – Jitin Kodian Jul 28 '16 at 12:57
    
Netmasks both the same? What state are the LEDs in? Both on the shield and on the ethernet port of the Pi. – Majenko Jul 28 '16 at 15:29
    
Has the raspberry IP information been configured right? Run ifconfig eth0 and post the output. – Majenko Jul 28 '16 at 15:30
    
@Majenko All the LEDs are on. Both the netmasks are /24. I cant post the output now, the devices are not with me – Jitin Kodian Jul 28 '16 at 15:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.